Iterate given content array and call `process` for every element inside

@param array $content
@param null|BaseElement $parent
320956
private function iterate(array $content, $parent = null)
    {
        foreach ($content as $element) {
            $this->process($element, $parent);
        }
    }
1159347
public function parseInline(Text $content, InlineNodeAcceptorInterface $target)
    {
        if ($content->contains('[')) {
            $this->parseInlineLink($content, $target);
        } else {
            $this->next->parseInline($content, $target);
        }
    }
238575
public function deleteContent($content)
    {
        $this->deleNodeEntity($this->contentType, array('content' => $content));
        $this->deleNodeEntity(
            $this->subContent, array('father' => $content),
            function ($entity) {
                $this->deleteContent($entity->getChild());
            }
        );
        $this->deleNodeEntity($this->subContent, array('child' => $content));
        $this->deleNodeEntity($this->contentRegion, array('content' => $content));
        $this->manager->remove($content);
        $this->manager->flush();
    }
1066021
protected function processVars(string &$content): void
    {
        $pattern = $this->getTagPattern('(\$.+?)');
        $content = preg_replace_callback($pattern, function ($match) {
            return '<?php echo ' . $match[1] . '; ?>';
        }, $content);
    }
909111
public static function purgeByParentAndContentObjectID( $parentNodeID, $contentObjectID )
    {
        eZDB::instance()->query(
            "DELETE FROM eznode_assignment WHERE parent_node=" . (int)$parentNodeID ." AND contentobject_id=" . (int)$contentObjectID
        );
    }
1116810
private function processContent($content)
    {
        $this->mimetype = null;
        foreach ($content as $asset) {
            if (null === $this->mimetype) {
                $this->mimetype = $asset->mimetype;
            }

            if ($asset->mimetype !== $this->mimetype) {
                throw new Exception\RuntimeException(
                    sprintf(
                        'Asset "%s" doesn\'t have the expected mime-type "%s".',
                        $asset->getTargetPath(),
                        $this->mimetype
                    )
                );
            }

            $this->setLastModified(
                max(
                    $asset->getLastModified(),
                    $this->getLastModified()
                )
            );
            $this->setContent(
                $this->getContent() . $asset->dump()
            );
        }
    }
362351
function() {
        var nodes = this.tree.content;
        for (var i = 0; i < nodes.length; i++) {
            if (nodes[i].type === "template") {
                this._processNodeContent(nodes[i].content,nodes[i]);
            }
        }
    }
489060
function(content) {
        if (content.callback) {
            var namespaces = content.callback.split('.'),
                func = window, prev = func;

            for (var i = 0; i < namespaces.length; i++) {
                prev = func;
                func = func[namespaces[i]];
            }

            func.call(prev, content);
        }

        this.fireEvent('process', [content]);

        this.hide();
    }
1261695
public function setContent( Content $content )
    {
        foreach ( $this->handlers as $handler )
        {
            if ( $handler instanceof ContentAwareHandlerInterface )
            {
                $handler->setContent( $content );
            }
        }
    }
67074
public function parseElements(array $elements, ElementInterface $parent = null)
    {
        foreach ($elements as &$element) {
            $element = $this->applyStyles($element);
        }

        return parent::parseElements($elements, $parent);
    }
519785
protected function processUrlTag(string &$content): void
    {
        $pattern = $this->getTagPattern('url(\s+(.+?))?' . preg_quote($this->endTag, '/') . '(.+?)' . preg_quote($this->startTag . '/url', '/'));
        $content = preg_replace_callback($pattern, function ($match) {
            $matchName = $match[2];
            $matchPath = $match[3];
            $urlAsset = Application::$app->getService('urlAsset');
            if ($matchName == '') {
                return $urlAsset->getUrl($matchPath);
            } else {
                return $urlAsset->getUrl($matchPath, $matchName);
            }
        }, $content);
    }
1363551
def processChildElements( element, leafElementsOnly, block )
      if element
         if element.is_a?( Array )
            element.each{ |e| processChildElements( e, leafElementsOnly, block ) }
         elsif element.is_a?( REXML::Element ) and element.has_elements?
            block.call( element ) if not leafElementsOnly
            element.each{ |e|
               if e.is_a?( REXML::Element ) and e.has_elements?
                 processChildElements( e, leafElementsOnly, block )
               else
                 block.call( e )
               end
            }
         end
      end
    end
1366798
public function execute($path = null, $parents = array())
    {
        $content = '';

        // loop CSS data (raw data and files)
        foreach ($this->data as $source => $css) {
            /*
             * Let's first take out strings & comments, since we can't just
             * remove whitespace anywhere. If whitespace occurs inside a string,
             * we should leave it alone. E.g.:
             * p { content: "a   test" }
             */
            $this->extractStrings();
            $this->stripComments();
            $css = $this->replace($css);

            $css = $this->stripWhitespace($css);
            $css = $this->shortenHex($css);
            $css = $this->shortenZeroes($css);
            $css = $this->shortenFontWeights($css);
            $css = $this->stripEmptyTags($css);

            // restore the string we've extracted earlier
            $css = $this->restoreExtractedData($css);

            $source = is_int($source) ? '' : $source;
            $parents = $source ? array_merge($parents, array($source)) : $parents;
            $css = $this->combineImports($source, $css, $parents);
            $css = $this->importFiles($source, $css);

            /*
             * If we'll save to a new path, we'll have to fix the relative paths
             * to be relative no longer to the source file, but to the new path.
             * If we don't write to a file, fall back to same path so no
             * conversion happens (because we still want it to go through most
             * of the move code, which also addresses url() & @import syntax...)
             */
            $converter = $this->getPathConverter($source, $path ?: $source);
            $css = $this->move($converter, $css);

            // combine css
            $content .= $css;
        }

        $content = $this->moveImportsToTop($content);

        return $content;
    }
735568
function processObject( $contentObject, $returnArray )
    {
        if ( $this->ogIni->hasVariable( $contentObject->contentClassIdentifier(), 'LiteralMap' ) )
        {
            $literalValues = $this->ogIni->variable( $contentObject->contentClassIdentifier(), 'LiteralMap' );
            if ( $this->debug )
            {
                eZDebug::writeDebug( $literalValues, 'LiteralMap' );
            }

            if ( $literalValues )
            {
                foreach ( $literalValues as $key => $value )
                {
                    if ( !empty( $value ) )
                    {
                        $returnArray[$key] = $value;
                    }
                }
            }
        }

        if ( $this->ogIni->hasVariable( $contentObject->contentClassIdentifier(), 'AttributeMap' ) )
        {
            $attributeValues = $this->ogIni->variableArray( $contentObject->contentClassIdentifier(), 'AttributeMap' );
            if ( $this->debug )
            {
                eZDebug::writeDebug( $attributeValues, 'AttributeMap' );
            }

            if ( $attributeValues )
            {
                foreach ( $attributeValues as $key => $value )
                {
                    $contentObjectAttributeArray = $contentObject->fetchAttributesByIdentifier( array( $value[0] ) );
                    if ( !is_array( $contentObjectAttributeArray ) )
                    {
                        continue;
                    }

                    $contentObjectAttributeArray = array_values( $contentObjectAttributeArray );
                    $contentObjectAttribute = $contentObjectAttributeArray[0];

                    if ( $contentObjectAttribute instanceof eZContentObjectAttribute )
                    {
                        $openGraphHandler = ngOpenGraphBase::getInstance( $contentObjectAttribute );

                        if ( count( $value ) == 1 )
                        {
                            $data = $openGraphHandler->getData();
                        }
                        else if ( count( $value ) == 2 )
                        {
                            $data = $openGraphHandler->getDataMember( $value[1] );
                        }
                        else
                        {
                            $data = "";
                        }

                        if ( !empty( $data ) )
                        {
                            $returnArray[$key] = $data;
                        }
                    }
                }
            }
        }

        return $returnArray;
    }
1055956
public function invoke($node, NodeInterface $parent): void
    {
        if (! $node instanceof Doc || ! $parent instanceof DocumentationInterface) {
            throw new Exception('DocumentationNodeParser is made to parse a documentation node');
        }

        $documentation = $node->getText();
        $parent->setDocumentation($documentation);

        $this->annotationParser->invoke($parent, $documentation);
    }
317206
private function processNestedAttributes($property, $content)
    {
        $results = array();

        if ($this->isAssociativeArray($content)) {
            foreach ($content as $key => $value) {
                $results = array_merge($results, $this->processNestedAttributes("{$property}:{$key}", $value));
            }
        }
        else {
            foreach((array)$content as $con) {
                if ($this->isAssociativeArray($con))
                    $results = array_merge($results, $this->processNestedAttributes($property, $con));
                else
                     $results[] =  $this->metaTag($property, $con);
            }
        }

        return $results;
    }
683249
protected function _processTree($parent)
    {
        foreach ($parent->tree as $node) {
            if ($node->hasMethods && $node->type !== 'interface') {
                $this->_processMethods($node);
            } elseif (!empty($node->tree)) {
                $this->_processTree($node);
            }
        }
    }