Completed
Push — master ( a3140b...10de85 )
by Kacper
04:29
created
Xml/XmlParser.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -71,13 +71,13 @@  discard block
 block discarded – undo
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
 
@@ -111,8 +111,8 @@  discard block
 block discarded – undo
111 111
             return 'http://www.w3.org/2000/xmlns/';
112 112
         }
113 113
 
114
-        if (isset($namespaces[ $prefix ])) {
115
-            return $namespaces[ $prefix ];
114
+        if (isset($namespaces[$prefix])) {
115
+            return $namespaces[$prefix];
116 116
         }
117 117
 
118 118
         return !empty($this->_stack) ? end($this->_stack)->lookupUri($prefix) : null;
@@ -123,10 +123,10 @@  discard block
 block discarded – undo
123 123
         list($attributes, $namespaces) = $this->_attributes($attrs);
124 124
         list($tag, $prefix)            = XmlElement::resolve($name);
125 125
 
126
-        $uri   = $this->_lookup($prefix, $namespaces);
126
+        $uri = $this->_lookup($prefix, $namespaces);
127 127
 
128 128
         /** @var XmlElement $element */
129
-        $element = $this->factory->create($uri, $tag, [ $name, $uri ], $this->_getCollocations());
129
+        $element = $this->factory->create($uri, $tag, [$name, $uri], $this->_getCollocations());
130 130
 
131 131
         foreach ($namespaces as $prefix => $uri) {
132 132
             $element->setNamespace($uri, $prefix);
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 
141 141
     private function _getCollocations()
142 142
     {
143
-        if(empty($this->_stack)) {
143
+        if (empty($this->_stack)) {
144 144
             return [];
145 145
         }
146 146
 
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
         if (count($this->_stack) > 0) {
160 160
             end($this->_stack)->append($element);
161 161
         }
162
-        $this->emit('parse.begin', [ $element, count($this->_stack) ]);
162
+        $this->emit('parse.begin', [$element, count($this->_stack)]);
163 163
 
164 164
         $this->_stack[] = $element;
165 165
     }
@@ -172,10 +172,10 @@  discard block
 block discarded – undo
172 172
 
173 173
         $element = array_pop($this->_stack);
174 174
         if (count($this->_stack) == 1) {
175
-            $this->emit('element', [ $element, count($this->_stack) ]);
175
+            $this->emit('element', [$element, count($this->_stack)]);
176 176
         }
177 177
 
178
-        $this->emit('parse.end', [ $element, count($this->_stack) ]);
178
+        $this->emit('parse.end', [$element, count($this->_stack)]);
179 179
     }
180 180
 
181 181
     private function handleTextData($data)
Please login to merge, or discard this patch.