Completed
Push — master ( ad4336...02147a )
by Evgenij
02:47
created
src/Socket/AsyncSelector.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -254,7 +254,7 @@
 block discarded – undo
254 254
      * @param resource[] $write List of sockets to check for write. After function return it will be filled with
255 255
      *      sockets, which are ready to write
256 256
      *
257
-     * @return bool|int False in case of system error, int - amount of sockets ready for I/O
257
+     * @return integer False in case of system error, int - amount of sockets ready for I/O
258 258
      */
259 259
     private function doStreamSelect($seconds, $usec = null, array &$read = null, array &$write = null)
260 260
     {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -236,8 +236,8 @@
 block discarded – undo
236 236
      */
237 237
     public function removeAllSocketOperations(StreamResourceInterface $streamResource)
238 238
     {
239
-        $opList = [ OperationInterface::OPERATION_READ,
240
-                    OperationInterface::OPERATION_WRITE  ];
239
+        $opList = [OperationInterface::OPERATION_READ,
240
+                    OperationInterface::OPERATION_WRITE];
241 241
 
242 242
         foreach ($opList as $op) {
243 243
             $this->removeSocketOperation($streamResource, $op);
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Async sockets
4
- *
5
- * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
- *
7
- * This source file is subject to the MIT license that is bundled
8
- * with this source code in the file LICENSE.
9
- */
3
+     * Async sockets
4
+     *
5
+     * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
+     *
7
+     * This source file is subject to the MIT license that is bundled
8
+     * with this source code in the file LICENSE.
9
+     */
10 10
 namespace AsyncSockets\Exception;
11 11
 
12 12
 /**
Please login to merge, or discard this patch.
src/Frame/MarkerFramePicker.php 2 patches
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -126,7 +126,6 @@
 block discarded – undo
126 126
     protected function findMarker($haystack, $needle, $offset = 0)
127 127
     {
128 128
         return $this->isCaseSensitive ?
129
-            strpos($haystack, $needle, $offset) :
130
-            stripos($haystack, $needle, $offset);
129
+            strpos($haystack, $needle, $offset) : stripos($haystack, $needle, $offset);
131 130
     }
132 131
 }
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Async sockets
4
- *
5
- * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
- *
7
- * This source file is subject to the MIT license that is bundled
8
- * with this source code in the file LICENSE.
9
- */
3
+     * Async sockets
4
+     *
5
+     * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
+     *
7
+     * This source file is subject to the MIT license that is bundled
8
+     * with this source code in the file LICENSE.
9
+     */
10 10
 namespace AsyncSockets\Exception;
11 11
 
12 12
 /**
Please login to merge, or discard this patch.
src/Socket/Io/StreamedClientIo.php 2 patches
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -64,9 +64,8 @@
 block discarded – undo
64 64
     private function resolveReadAttempts(array $context, $currentAttempts)
65 65
     {
66 66
         return ($context['countCycles'] === 1 && $context['dataBeforeIo'] === false) ||
67
-               ($context['countCycles'] > 1   && $context['isStreamDataEmpty']) ?
68
-            $currentAttempts - 1 :
69
-            self::READ_ATTEMPTS;
67
+               ($context['countCycles'] > 1 && $context['isStreamDataEmpty']) ?
68
+            $currentAttempts - 1 : self::READ_ATTEMPTS;
70 69
 
71 70
     }
72 71
 
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Async sockets
4
- *
5
- * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
- *
7
- * This source file is subject to the MIT license that is bundled
8
- * with this source code in the file LICENSE.
9
- */
3
+     * Async sockets
4
+     *
5
+     * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
+     *
7
+     * This source file is subject to the MIT license that is bundled
8
+     * with this source code in the file LICENSE.
9
+     */
10 10
 namespace AsyncSockets\Exception;
11 11
 
12 12
 /**
Please login to merge, or discard this patch.
src/Socket/Io/AbstractClientIo.php 2 patches
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -143,8 +143,7 @@
 block discarded – undo
143 143
         $resource = $this->socket->getStreamResource();
144 144
         if (!is_resource($resource)) {
145 145
             $message = $this->state === self::STATE_CONNECTED ?
146
-                'Connection was unexpectedly closed.' :
147
-                'Can not start io operation on uninitialized socket.';
146
+                'Connection was unexpectedly closed.' : 'Can not start io operation on uninitialized socket.';
148 147
             throw new ConnectionException($this->socket, $message);
149 148
         }
150 149
 
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Async sockets
4
- *
5
- * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
- *
7
- * This source file is subject to the MIT license that is bundled
8
- * with this source code in the file LICENSE.
9
- */
3
+     * Async sockets
4
+     *
5
+     * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
+     *
7
+     * This source file is subject to the MIT license that is bundled
8
+     * with this source code in the file LICENSE.
9
+     */
10 10
 namespace AsyncSockets\Exception;
11 11
 
12 12
 /**
Please login to merge, or discard this patch.
src/Socket/AbstractSocket.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -184,7 +184,7 @@
 block discarded – undo
184 184
             'unix' => self::SOCKET_TYPE_UNIX,
185 185
         ];
186 186
 
187
-        $regexp = '#^('. implode('|', array_keys($map)) . ')_socket$#';
187
+        $regexp = '#^(' . implode('|', array_keys($map)) . ')_socket$#';
188 188
         foreach ($parts as $part) {
189 189
             if (preg_match($regexp, $part, $pockets)) {
190 190
                 return $map[$pockets[1]];
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Async sockets
4
- *
5
- * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
- *
7
- * This source file is subject to the MIT license that is bundled
8
- * with this source code in the file LICENSE.
9
- */
3
+     * Async sockets
4
+     *
5
+     * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
+     *
7
+     * This source file is subject to the MIT license that is bundled
8
+     * with this source code in the file LICENSE.
9
+     */
10 10
 namespace AsyncSockets\Exception;
11 11
 
12 12
 /**
Please login to merge, or discard this patch.
src/Socket/ServerSocket.php 2 patches
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -68,9 +68,8 @@
 block discarded – undo
68 68
             'udg' => 1,
69 69
         ];
70 70
 
71
-        return isset($connectionLessMap[ $scheme ]) ?
72
-            STREAM_SERVER_BIND :
73
-            STREAM_SERVER_BIND | STREAM_SERVER_LISTEN;
71
+        return isset($connectionLessMap[$scheme]) ?
72
+            STREAM_SERVER_BIND : STREAM_SERVER_BIND | STREAM_SERVER_LISTEN;
74 73
     }
75 74
 
76 75
     /** {@inheritdoc} */
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Async sockets
4
- *
5
- * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
- *
7
- * This source file is subject to the MIT license that is bundled
8
- * with this source code in the file LICENSE.
9
- */
3
+     * Async sockets
4
+     *
5
+     * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
+     *
7
+     * This source file is subject to the MIT license that is bundled
8
+     * with this source code in the file LICENSE.
9
+     */
10 10
 namespace AsyncSockets\Exception;
11 11
 
12 12
 /**
Please login to merge, or discard this patch.
src/Configuration/Configuration.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -50,9 +50,9 @@  discard block
 block discarded – undo
50 50
     {
51 51
         $options = $options + $this->getDefaultOptions();
52 52
 
53
-        $this->connectTimeout   = (double) $options[ 'connectTimeout' ];
54
-        $this->ioTimeout        = (double) $options[ 'ioTimeout' ];
55
-        $this->preferredEngines = (array) $options[ 'preferredEngines' ];
53
+        $this->connectTimeout   = (double) $options['connectTimeout'];
54
+        $this->ioTimeout        = (double) $options['ioTimeout'];
55
+        $this->preferredEngines = (array) $options['preferredEngines'];
56 56
     }
57 57
 
58 58
     /**
@@ -95,9 +95,9 @@  discard block
 block discarded – undo
95 95
         $result        = [];
96 96
         $socketTimeout = (double) ini_get('default_socket_timeout');
97 97
 
98
-        $result[ 'connectTimeout' ]   = $socketTimeout;
99
-        $result[ 'ioTimeout' ]        = $socketTimeout;
100
-        $result[ 'preferredEngines' ] = [ 'libevent', 'native' ];
98
+        $result['connectTimeout']   = $socketTimeout;
99
+        $result['ioTimeout']        = $socketTimeout;
100
+        $result['preferredEngines'] = ['libevent', 'native'];
101 101
 
102 102
         return $result;
103 103
     }
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Async sockets
4
- *
5
- * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
- *
7
- * This source file is subject to the MIT license that is bundled
8
- * with this source code in the file LICENSE.
9
- */
3
+     * Async sockets
4
+     *
5
+     * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
+     *
7
+     * This source file is subject to the MIT license that is bundled
8
+     * with this source code in the file LICENSE.
9
+     */
10 10
 namespace AsyncSockets\Exception;
11 11
 
12 12
 /**
Please login to merge, or discard this patch.
src/RequestExecutor/Metadata/SocketBag.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
     public function __construct(RequestExecutorInterface $executor, $connectTimeout, $ioTimeout)
59 59
     {
60 60
         $this->executor       = $executor;
61
-        $this->items          = [ ];
61
+        $this->items          = [];
62 62
         $this->connectTimeout = $connectTimeout;
63 63
         $this->ioTimeout      = $ioTimeout;
64 64
     }
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
         ];
157 157
 
158 158
         if (!is_array($key)) {
159
-            $key = [ $key => $value ];
159
+            $key = [$key => $value];
160 160
         }
161 161
 
162 162
         $key = array_intersect_key($key, $writableKeys);
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Async sockets
4
- *
5
- * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
- *
7
- * This source file is subject to the MIT license that is bundled
8
- * with this source code in the file LICENSE.
9
- */
3
+     * Async sockets
4
+     *
5
+     * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
+     *
7
+     * This source file is subject to the MIT license that is bundled
8
+     * with this source code in the file LICENSE.
9
+     */
10 10
 namespace AsyncSockets\Exception;
11 11
 
12 12
 /**
Please login to merge, or discard this patch.
src/RequestExecutor/Pipeline/WriteIoHandler.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
                 $operation,
51 51
                 $executor,
52 52
                 $socket,
53
-                $meta[ RequestExecutorInterface::META_USER_CONTEXT ]
53
+                $meta[RequestExecutorInterface::META_USER_CONTEXT]
54 54
             );
55 55
             $eventHandler->invokeEvent($event);
56 56
             $nextOperation = $event->getNextOperation();
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Async sockets
4
- *
5
- * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
- *
7
- * This source file is subject to the MIT license that is bundled
8
- * with this source code in the file LICENSE.
9
- */
3
+     * Async sockets
4
+     *
5
+     * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
+     *
7
+     * This source file is subject to the MIT license that is bundled
8
+     * with this source code in the file LICENSE.
9
+     */
10 10
 namespace AsyncSockets\Exception;
11 11
 
12 12
 /**
Please login to merge, or discard this patch.