Passed
Push — master ( 239fe0...528f7d )
by Kacper
05:10
created
Xml/XmlParser.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -78,13 +78,13 @@  discard block
 block discarded – undo
78 78
         xml_parser_set_option($this->parser, XML_OPTION_SKIP_WHITE, 1);
79 79
         xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0);
80 80
 
81
-        xml_set_element_handler($this->parser, function ($parser, $name, $attrs) {
81
+        xml_set_element_handler($this->parser, function($parser, $name, $attrs) {
82 82
             $this->handleElementStart($name, $attrs);
83
-        }, function ($parser, $name) {
83
+        }, function($parser, $name) {
84 84
             $this->handleElementEnd();
85 85
         });
86 86
 
87
-        xml_set_character_data_handler($this->parser, function ($parser, $data) {
87
+        xml_set_character_data_handler($this->parser, function($parser, $data) {
88 88
             $this->handleTextData($data);
89 89
         });
90 90
 
@@ -140,10 +140,10 @@  discard block
 block discarded – undo
140 140
         list($attributes, $namespaces) = $this->_attributes($attrs);
141 141
         list($tag, $prefix)            = $this->_name($name);
142 142
 
143
-        $uri   = $this->_lookup($prefix, $namespaces);
143
+        $uri = $this->_lookup($prefix, $namespaces);
144 144
 
145 145
         /** @var XmlElement $element */
146
-        $element = $this->document->importNode($this->factory->create($uri, $tag, [ $name, null, $uri ]), true);
146
+        $element = $this->document->importNode($this->factory->create($uri, $tag, [$name, null, $uri]), true);
147 147
         foreach ($attributes as $name => $value) {
148 148
             $element->setAttribute($name, $value);
149 149
         }
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
         if (count($this->stack) > 1) {
159 159
             end($this->stack)->appendChild($element);
160 160
         }
161
-        $this->emit('parse.begin', [ $element ]);
161
+        $this->emit('parse.begin', [$element]);
162 162
 
163 163
         $this->stack[] = $element;
164 164
     }
@@ -171,10 +171,10 @@  discard block
 block discarded – undo
171 171
 
172 172
         $element = array_pop($this->stack);
173 173
         if (count($this->stack) == 1) {
174
-            $this->emit('element', [ $element ]);
174
+            $this->emit('element', [$element]);
175 175
         }
176 176
 
177
-        $this->emit('parse.end', [ $element ]);
177
+        $this->emit('parse.end', [$element]);
178 178
     }
179 179
 
180 180
     private function handleTextData($data)
Please login to merge, or discard this patch.
Utils/StreamDecorator.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types=1);
1
+<?php declare(strict_types = 1);
2 2
 /**
3 3
  * XMPP Library
4 4
  *
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
     {
84 84
         static $events = ['data', 'end', 'drain', 'error', 'close', 'pipe'];
85 85
 
86
-        if($this->decorated !== null) {
86
+        if ($this->decorated !== null) {
87 87
             $this->unsubscribe($this->decorated, $events);
88 88
         }
89 89
 
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
     private function unsubscribe(DuplexStreamInterface $stream, array $events)
95 95
     {
96 96
         foreach ($events as $event) {
97
-            if(!isset($this->_listeners[$event])) {
97
+            if (!isset($this->_listeners[$event])) {
98 98
                 continue;
99 99
             }
100 100
 
@@ -105,8 +105,8 @@  discard block
 block discarded – undo
105 105
     private function subscribe(DuplexStreamInterface $stream, array $events)
106 106
     {
107 107
         foreach ($events as $event) {
108
-            if(!isset($this->_listeners[$event])) {
109
-                $this->_listeners[$event] = function (...$arguments) use ($event) {
108
+            if (!isset($this->_listeners[$event])) {
109
+                $this->_listeners[$event] = function(...$arguments) use ($event) {
110 110
                     $this->emit($event, $arguments);
111 111
                 };
112 112
             }
Please login to merge, or discard this patch.