public function process(\DOMDocument $xml)
    {
        $ignoreQry = '//long-description[contains(., "{@internal")]';

        $xpath = new \DOMXPath($xml);
        $nodes = $xpath->query($ignoreQry);

        // either replace it with nothing or with the 'stored' value
        $replacement = $this->internalAllowed ? '$1' : '';

        /** @var \DOMElement $node */
        foreach ($nodes as $node) {
            $node->nodeValue = preg_replace('/\{@internal\s(.+?)\}\}/', $replacement, $node->nodeValue);
        }

        return $xml;
    }
public function process(\DOMDocument $xml)
    {
        $ignoreQry = '//long-description[contains(., "{@internal")]';

        $xpath = new \DOMXPath($xml);
        $nodes = $xpath->query($ignoreQry);

        // either replace it with nothing or with the 'stored' value
        $replacement = $this->internalAllowed ? '$1' : '';

        /** @var \DOMElement $node */
        foreach ($nodes as $node) {
            $node->nodeValue = preg_replace('/\{@internal\s(.+?)\}\}/', $replacement, $node->nodeValue);
        }

        return $xml;
    }
public function process ( \ DOMDocument $ xml ) { $ ignoreQry = '//long-description[contains(., "{@internal")]' ; $ xpath = new \ DOMXPath ( $ xml ) ; $ nodes = $ xpath -> query ( $ ignoreQry ) ; // either replace it with nothing or with the 'stored' value $ replacement = $ this -> internalAllowed ? '$1' : '' ; /** @var \DOMElement $node */ foreach ( $ nodes as $ node ) { $ node -> nodeValue = preg_replace ( '/\{@internal\s(.+?)\}\}/' , $ replacement , $ node -> nodeValue ) ; } return $ xml ; }
Converts the 'internal' tags in Long Descriptions.

@param \DOMDocument $xml Structure source to apply behaviour onto.

@todo This behaviours actions should be moved to the parser / Reflector builder so that it can be cached
and is available to all writers.

@return \DOMDocument
Converts the internal tags in Long Descriptions .