Completed
Push — master ( 641e7a...5eff09 )
by Kacper
02:52
created
Exception/Protocol/StreamErrorException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,6 +40,6 @@
 block discarded – undo
40 40
 
41 41
     private function generateMessage(Error $error) : string
42 42
     {
43
-        return 'Stream error: '.str_replace('-', ' ', $error->kind).($error->text ? " ({$error->text})" : null);
43
+        return 'Stream error: ' . str_replace('-', ' ', $error->kind) . ($error->text ? " ({$error->text})" : null);
44 44
     }
45 45
 }
Please login to merge, or discard this patch.
Utils/DnsResolver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
                 continue;
55 55
             }
56 56
 
57
-            $this->_results = array_merge($this->_results, array_map(function ($record) {
57
+            $this->_results = array_merge($this->_results, array_map(function($record) {
58 58
                 return [$record['target'], $record['port']];
59 59
             }, $result));
60 60
         }
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.
Network/Connector/TcpXmppConnector.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,13 +42,13 @@
 block discarded – undo
42 42
 
43 43
             if ($stream = @stream_socket_client("tcp://$ip:$port")) {
44 44
                 $stream = new TcpStream($stream, $this->_loop);
45
-                $this->emit('connect', [ $stream ]);
45
+                $this->emit('connect', [$stream]);
46 46
 
47 47
                 return $stream;
48 48
             }
49 49
         }
50 50
 
51
-        throw new \RuntimeException('Cannot connect to '.$this->_host);
51
+        throw new \RuntimeException('Cannot connect to ' . $this->_host);
52 52
     }
53 53
 
54 54
     public function __construct(string $host, LoopInterface $loop)
Please login to merge, or discard this patch.
Module/StartTls.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,11 +29,11 @@
 block discarded – undo
29 29
     {
30 30
         parent::setClient($client);
31 31
 
32
-        $client->on('features', function (Features $features) {
32
+        $client->on('features', function(Features $features) {
33 33
             return $this->handleFeatures($features);
34 34
         }, null, 10);
35 35
 
36
-        $client->on('element', function (XmlElement $element) {
36
+        $client->on('element', function(XmlElement $element) {
37 37
             $this->handleTls($element);
38 38
         }, with\xmlns(Features\StartTls::XMLNS));
39 39
     }
Please login to merge, or discard this patch.
Stream/Features.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
 
41 41
     public function getMechanisms()
42 42
     {
43
-        return array_map(function (XmlElement $element) {
43
+        return array_map(function(XmlElement $element) {
44 44
             return $element->innerXml;
45 45
         }, $this->get(\Kadet\Xmpp\Utils\filter\tag('mechanisms'))->children ?? []);
46 46
     }
Please login to merge, or discard this patch.
Utils/Dumper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -72,9 +72,9 @@  discard block
 block discarded – undo
72 72
     {
73 73
         $console = Console::get();
74 74
 
75
-        $result = $console->styled(['color' => 'yellow'], 'array').' with '.$console->styled(['color' => 'magenta'], count($array)).' elements:'.PHP_EOL;
75
+        $result = $console->styled(['color' => 'yellow'], 'array') . ' with ' . $console->styled(['color' => 'magenta'], count($array)) . ' elements:' . PHP_EOL;
76 76
         foreach ($array as $key => $value) {
77
-            $result .= "\t".str_replace("\n", "\n\t", '['.$this->dump($key).']: '.$this->dump($value)).PHP_EOL;
77
+            $result .= "\t" . str_replace("\n", "\n\t", '[' . $this->dump($key) . ']: ' . $this->dump($value)) . PHP_EOL;
78 78
         }
79 79
 
80 80
         return $result;
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
     public function init()
84 84
     {
85
-        $this->register('array',  [$this, '_dumpArray']);
85
+        $this->register('array', [$this, '_dumpArray']);
86 86
         $this->register('object', [$this, '_dumpObject']);
87 87
     }
88 88
 }
Please login to merge, or discard this patch.
Utils/StreamDecorator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@
 block discarded – undo
107 107
     {
108 108
         foreach ($events as $event) {
109 109
             if (!isset($this->_redirectors[$event])) {
110
-                $this->_redirectors[$event] = function (...$arguments) use ($event) {
110
+                $this->_redirectors[$event] = function(...$arguments) use ($event) {
111 111
                     $this->emit($event, $arguments);
112 112
                 };
113 113
             }
Please login to merge, or discard this patch.
Utils/PriorityCollection.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
     public function remove($value)
63 63
     {
64
-        $this->_collection = array_filter($this->_collection, function ($e) use ($value) {
64
+        $this->_collection = array_filter($this->_collection, function($e) use ($value) {
65 65
             return $e[1] !== $value;
66 66
         });
67 67
 
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 
71 71
     private function rebuildCache()
72 72
     {
73
-        usort($this->_collection, function ($a, $b) {
73
+        usort($this->_collection, function($a, $b) {
74 74
             return $b[0] <=> $a[0];
75 75
         });
76 76
 
Please login to merge, or discard this patch.