@@ -21,7 +21,7 @@ |
||
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | // Provides read-only access to $length and $dom |
| 24 | - public function __get ($prop) { |
|
| 24 | + public function __get($prop) { |
|
| 25 | 25 | if ($prop == 'length') { |
| 26 | 26 | return $this->length; |
| 27 | 27 | } |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | $prefix = $parts[0]; |
| 325 | 325 | if (isset($namespaces[$prefix])) { |
| 326 | 326 | if (!strpos($root_match[0], "xmlns:$prefix")) { |
| 327 | - $new_root .= " xmlns:$prefix='" . $namespaces[$prefix] . "'"; |
|
| 327 | + $new_root .= " xmlns:$prefix='".$namespaces[$prefix]."'"; |
|
| 328 | 328 | } |
| 329 | 329 | } |
| 330 | 330 | } |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | |
| 334 | 334 | $dom = new DOMDoc($xml, $this->auto_ns); |
| 335 | 335 | if (!$dom->documentElement) { |
| 336 | - trigger_error('BetterDomDocument\DOMDoc Error: Invalid XML: ' . $xml); |
|
| 336 | + trigger_error('BetterDomDocument\DOMDoc Error: Invalid XML: '.$xml); |
|
| 337 | 337 | } |
| 338 | 338 | $element = $dom->documentElement; |
| 339 | 339 | |
@@ -438,7 +438,7 @@ discard block |
||
| 438 | 438 | $this->createContext($newnode, 'xml'); |
| 439 | 439 | $this->createContext($context, 'xpath'); |
| 440 | 440 | |
| 441 | - if (!$context){ |
|
| 441 | + if (!$context) { |
|
| 442 | 442 | return FALSE; |
| 443 | 443 | } |
| 444 | 444 | |
@@ -509,7 +509,7 @@ discard block |
||
| 509 | 509 | |
| 510 | 510 | if ($node) { |
| 511 | 511 | if (is_array($node) || get_class($node) == 'BetterDOMDocument\DOMList') { |
| 512 | - foreach($node as $item) { |
|
| 512 | + foreach ($node as $item) { |
|
| 513 | 513 | $this->remove($item); |
| 514 | 514 | } |
| 515 | 515 | } |
@@ -581,7 +581,7 @@ discard block |
||
| 581 | 581 | $xsl = ' |
| 582 | 582 | <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
| 583 | 583 | <xsl:template match="*"> |
| 584 | - <xsl:element name="' . $prefix . ':{local-name()}" namespace="' . $url . '"> |
|
| 584 | + <xsl:element name="' . $prefix.':{local-name()}" namespace="'.$url.'"> |
|
| 585 | 585 | <xsl:copy-of select="@*"/> |
| 586 | 586 | <xsl:apply-templates/> |
| 587 | 587 | </xsl:element> |
@@ -593,7 +593,7 @@ discard block |
||
| 593 | 593 | } |
| 594 | 594 | else { |
| 595 | 595 | // @@TODO: Report the correct calling file and number |
| 596 | - throw new \Exception("Changing the namespace of a " . get_class($node) . " is not supported"); |
|
| 596 | + throw new \Exception("Changing the namespace of a ".get_class($node)." is not supported"); |
|
| 597 | 597 | } |
| 598 | 598 | } |
| 599 | 599 | |
@@ -668,7 +668,7 @@ discard block |
||
| 668 | 668 | foreach ($this->getNamespaces() as $prefix => $url) { |
| 669 | 669 | $namespaces = ''; |
| 670 | 670 | if ($prefix != 'xsl' && $prefix != 'xlink') { |
| 671 | - $namespaces .= 'xmlns:' . $prefix . '="' . $url. '" '; |
|
| 671 | + $namespaces .= 'xmlns:'.$prefix.'="'.$url.'" '; |
|
| 672 | 672 | } |
| 673 | 673 | $xslOptions = str_replace("||namespaces||", $namespaces, $xslOptions); |
| 674 | 674 | } |
@@ -707,8 +707,8 @@ discard block |
||
| 707 | 707 | |
| 708 | 708 | // Copy namespace prefixes |
| 709 | 709 | foreach ($this->ns as $prefix => $namespace) { |
| 710 | - if (!empty($namespace) && !$context->hasAttribute('xmlns:' . $prefix)) { |
|
| 711 | - $context->setAttribute('xmlns:' . $prefix, $namespace); |
|
| 710 | + if (!empty($namespace) && !$context->hasAttribute('xmlns:'.$prefix)) { |
|
| 711 | + $context->setAttribute('xmlns:'.$prefix, $namespace); |
|
| 712 | 712 | } |
| 713 | 713 | } |
| 714 | 714 | |
@@ -718,7 +718,7 @@ discard block |
||
| 718 | 718 | // The types listed are html "void" elements. |
| 719 | 719 | // Find any of these elements that have no child nodes and are therefore candidates for self-closing, replace them with a self-closed version. |
| 720 | 720 | $pattern = '<(area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)(\b[^<]*)><\/\1>'; |
| 721 | - return preg_replace('/' . $pattern . '/', '<$1$2/>', $output); |
|
| 721 | + return preg_replace('/'.$pattern.'/', '<$1$2/>', $output); |
|
| 722 | 722 | } |
| 723 | 723 | else { |
| 724 | 724 | return $this->saveXML($context, LIBXML_NOEMPTYTAG); |
@@ -805,7 +805,7 @@ discard block |
||
| 805 | 805 | |
| 806 | 806 | // If it's an "XML" document, then get namespaces via xpath |
| 807 | 807 | $xpath = new \DOMXPath($this); |
| 808 | - foreach($xpath->query('namespace::*') as $namespace) { |
|
| 808 | + foreach ($xpath->query('namespace::*') as $namespace) { |
|
| 809 | 809 | if (!empty($namespace->prefix)) { |
| 810 | 810 | if ($namespace->prefix != 'xml' && $namespace->nodeValue != 'http://www.w3.org/XML/1998/namespace') { |
| 811 | 811 | $this->registerNamespace($namespace->prefix, $namespace->nodeValue); |
@@ -843,8 +843,8 @@ discard block |
||
| 843 | 843 | } |
| 844 | 844 | } |
| 845 | 845 | } |
| 846 | - else if (substr($attr->name,0,6) == 'xmlns:') { |
|
| 847 | - $prefix = substr($attr->name,6); |
|
| 846 | + else if (substr($attr->name, 0, 6) == 'xmlns:') { |
|
| 847 | + $prefix = substr($attr->name, 6); |
|
| 848 | 848 | $this->registerNamespace($prefix, $attr->value); |
| 849 | 849 | } |
| 850 | 850 | } |
@@ -901,7 +901,7 @@ discard block |
||
| 901 | 901 | @$this->loadXML($xml, LIBXML_COMPACT); |
| 902 | 902 | } |
| 903 | 903 | else if (!$this->loadXML($xml, LIBXML_COMPACT)) { |
| 904 | - trigger_error('BetterDOMDocument\DOMDoc: Could not load: ' . htmlspecialchars($xml), E_USER_WARNING); |
|
| 904 | + trigger_error('BetterDOMDocument\DOMDoc: Could not load: '.htmlspecialchars($xml), E_USER_WARNING); |
|
| 905 | 905 | } |
| 906 | 906 | } |
| 907 | 907 | } |