Completed
Push — master ( 3cecaa...777c1d )
by Kacper
03:21
created
Utils/Helper.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -24,10 +24,10 @@  discard block
 block discarded – undo
24 24
  */
25 25
 function typeof($value) : string
26 26
 {
27
-    if(is_object($value)) {
28
-        return "object of type ".get_class($value);
29
-    } elseif(is_resource($value)) {
30
-        return get_resource_type($value).' resource';
27
+    if (is_object($value)) {
28
+        return "object of type " . get_class($value);
29
+    } elseif (is_resource($value)) {
30
+        return get_resource_type($value) . ' resource';
31 31
     } else {
32 32
         return gettype($value);
33 33
     }
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
     return function(...$arguments) use ($callable, $argument, $position) {
39 39
         $arguments = array_merge(
40 40
             array_slice($arguments, 0, $position),
41
-            [ $argument ],
41
+            [$argument],
42 42
             array_slice($arguments, $position)
43 43
         );
44 44
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 
49 49
 function dd($value)
50 50
 {
51
-    echo Dumper::get()->dump($value).PHP_EOL.PHP_EOL;
51
+    echo Dumper::get()->dump($value) . PHP_EOL . PHP_EOL;
52 52
 }
53 53
 
54 54
 function format($string, array $arguments = [])
Please login to merge, or discard this patch.
XmppClient.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@
 block discarded – undo
106 106
 
107 107
     protected function handleFeatures(Features $element)
108 108
     {
109
-        if(!parent::handleFeatures($element)) {
109
+        if (!parent::handleFeatures($element)) {
110 110
             return false;
111 111
         }
112 112
 
Please login to merge, or discard this patch.
Xml/XmlParser.php 1 patch
Spacing   +8 added lines, -8 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
 
@@ -119,10 +119,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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)
Please login to merge, or discard this patch.
Xml/XmlElement.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
     public function find($predicate)
400 400
     {
401 401
         foreach ($this->_children as $index => $child) {
402
-            if($predicate($child)) {
402
+            if ($predicate($child)) {
403 403
                 return $child;
404 404
             }
405 405
         }
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
     private function attributes(): array
425 425
     {
426 426
         $namespaces = $this->getNamespaces(false);
427
-        $namespaces = array_map(function ($prefix, $uri) {
427
+        $namespaces = array_map(function($prefix, $uri) {
428 428
             return [$prefix ? "xmlns:{$prefix}" : 'xmlns', $uri];
429 429
         }, array_values($namespaces), array_keys($namespaces));
430 430
 
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
      */
445 445
     protected function _prefix(string $name, string $uri = null): string
446 446
     {
447
-        if($uri === null) {
447
+        if ($uri === null) {
448 448
             return $name;
449 449
         }
450 450
 
Please login to merge, or discard this patch.
Xml/XmlElementFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
     }
50 50
 
51 51
     public function load(array $dictionary) {
52
-        foreach($dictionary as $element) {
52
+        foreach ($dictionary as $element) {
53 53
             $this->register($element[0], $element['uri'] ?? null, $element['name'] ?? null);
54 54
         }
55 55
     }
Please login to merge, or discard this patch.
XmppStream.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,15 +34,15 @@
 block discarded – undo
34 34
     {
35 35
         parent::__construct($parser, $transport);
36 36
 
37
-        $this->_parser->factory->load(require __DIR__.'/XmlElementLookup.php');
37
+        $this->_parser->factory->load(require __DIR__ . '/XmlElementLookup.php');
38 38
 
39 39
         $this->_lang = $lang;
40 40
 
41
-        $this->on('element', function (Features $element) {
41
+        $this->on('element', function(Features $element) {
42 42
             $this->handleFeatures($element);
43 43
         }, Features::class);
44 44
 
45
-        $this->on('element', function (XmlElement $element) {
45
+        $this->on('element', function(XmlElement $element) {
46 46
             $this->handleTls($element);
47 47
         }, with\xmlns(Features\StartTls::XMLNS));
48 48
     }
Please login to merge, or discard this patch.