@@ -71,13 +71,13 @@ discard block |
||
71 | 71 | xml_parser_set_option($this->_parser, XML_OPTION_SKIP_WHITE, 1); |
72 | 72 | xml_parser_set_option($this->_parser, XML_OPTION_CASE_FOLDING, 0); |
73 | 73 | |
74 | - xml_set_element_handler($this->_parser, function ($parser, $name, $attrs) { |
|
74 | + xml_set_element_handler($this->_parser, function($parser, $name, $attrs) { |
|
75 | 75 | $this->handleElementStart($name, $attrs); |
76 | - }, function () { |
|
76 | + }, function() { |
|
77 | 77 | $this->handleElementEnd(); |
78 | 78 | }); |
79 | 79 | |
80 | - xml_set_character_data_handler($this->_parser, function ($parser, $data) { |
|
80 | + xml_set_character_data_handler($this->_parser, function($parser, $data) { |
|
81 | 81 | $this->handleTextData($data); |
82 | 82 | }); |
83 | 83 | |
@@ -119,10 +119,10 @@ discard block |
||
119 | 119 | list($attributes, $namespaces) = $this->_attributes($attrs); |
120 | 120 | list($tag, $prefix) = XmlElement::resolve($name); |
121 | 121 | |
122 | - $uri = $this->_lookup($prefix, $namespaces); |
|
122 | + $uri = $this->_lookup($prefix, $namespaces); |
|
123 | 123 | |
124 | 124 | /** @var XmlElement $element */ |
125 | - $element = $this->factory->create($uri, $tag, [ $name, $uri ]); |
|
125 | + $element = $this->factory->create($uri, $tag, [$name, $uri]); |
|
126 | 126 | foreach ($attributes as $name => $value) { |
127 | 127 | $element->setAttribute($name, $value); |
128 | 128 | } |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | if (count($this->_stack) > 1) { |
138 | 138 | end($this->_stack)->append($element); |
139 | 139 | } |
140 | - $this->emit('parse.begin', [ $element ]); |
|
140 | + $this->emit('parse.begin', [$element]); |
|
141 | 141 | |
142 | 142 | $this->_stack[] = $element; |
143 | 143 | } |
@@ -150,10 +150,10 @@ discard block |
||
150 | 150 | |
151 | 151 | $element = array_pop($this->_stack); |
152 | 152 | if (count($this->_stack) == 1) { |
153 | - $this->emit('element', [ $element ]); |
|
153 | + $this->emit('element', [$element]); |
|
154 | 154 | } |
155 | 155 | |
156 | - $this->emit('parse.end', [ $element ]); |
|
156 | + $this->emit('parse.end', [$element]); |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | private function handleTextData($data) |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | */ |
128 | 128 | public function getInnerXml() |
129 | 129 | { |
130 | - return implode('', array_map(function ($element) { |
|
130 | + return implode('', array_map(function($element) { |
|
131 | 131 | if (is_string($element)) { |
132 | 132 | return htmlspecialchars($element); |
133 | 133 | } elseif ($element instanceof XmlElement) { |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | $attributes = $this->attributes(); |
155 | 155 | |
156 | 156 | $result = "<{$this->name}"; |
157 | - $result .= ' ' . implode(' ', array_map(function ($key, $value) { |
|
157 | + $result .= ' ' . implode(' ', array_map(function($key, $value) { |
|
158 | 158 | return $key . '="' . htmlspecialchars($value, ENT_QUOTES) . '"'; |
159 | 159 | }, array_keys($attributes), array_values($attributes))); |
160 | 160 | |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | private function attributes(): array |
420 | 420 | { |
421 | 421 | $namespaces = $this->getNamespaces(false); |
422 | - $namespaces = array_map(function ($prefix, $uri) { |
|
422 | + $namespaces = array_map(function($prefix, $uri) { |
|
423 | 423 | return [$prefix ? "xmlns:{$prefix}" : 'xmlns', $uri]; |
424 | 424 | }, array_values($namespaces), array_keys($namespaces)); |
425 | 425 | |
@@ -439,7 +439,7 @@ discard block |
||
439 | 439 | */ |
440 | 440 | protected function _prefix(string $name, string $uri = null): string |
441 | 441 | { |
442 | - if($uri === null) { |
|
442 | + if ($uri === null) { |
|
443 | 443 | return $name; |
444 | 444 | } |
445 | 445 |