Completed
Branch feature-persistent-connect (647c46)
by Evgenij
03:19
created
src/Socket/SocketInterface.php 1 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/WithoutConnectionInterface.php 1 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/UdpClientSocket.php 1 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/SelectContext.php 1 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/AsyncSocketFactory.php 2 patches
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.
Spacing   +5 added lines, -7 removed lines patch added patch discarded remove patch
@@ -75,15 +75,13 @@
 block discarded – undo
75 75
     {
76 76
         switch ($type) {
77 77
             case self::SOCKET_CLIENT:
78
-                $isPersistent  = isset($options[ self::SOCKET_OPTION_IS_PERSISTENT ]) &&
79
-                                 $options[ self::SOCKET_OPTION_IS_PERSISTENT ];
80
-                $persistentKey = isset($options[ self::SOCKET_OPTION_PERSISTENT_KEY ]) ?
81
-                    $options[ self::SOCKET_OPTION_PERSISTENT_KEY ] :
82
-                    null;
78
+                $isPersistent  = isset($options[self::SOCKET_OPTION_IS_PERSISTENT]) &&
79
+                                 $options[self::SOCKET_OPTION_IS_PERSISTENT];
80
+                $persistentKey = isset($options[self::SOCKET_OPTION_PERSISTENT_KEY]) ?
81
+                    $options[self::SOCKET_OPTION_PERSISTENT_KEY] : null;
83 82
 
84 83
                 return $isPersistent ?
85
-                    new PersistentClientSocket($persistentKey) :
86
-                    new ClientSocket();
84
+                    new PersistentClientSocket($persistentKey) : new ClientSocket();
87 85
             case self::SOCKET_SERVER:
88 86
                 return new ServerSocket();
89 87
             default:
Please login to merge, or discard this patch.
src/Socket/AsyncSelector.php 2 patches
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.
Spacing   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -239,8 +239,8 @@  discard block
 block discarded – undo
239 239
      */
240 240
     public function removeAllSocketOperations(StreamResourceInterface $streamResource)
241 241
     {
242
-        $opList = [ OperationInterface::OPERATION_READ,
243
-                    OperationInterface::OPERATION_WRITE  ];
242
+        $opList = [OperationInterface::OPERATION_READ,
243
+                    OperationInterface::OPERATION_WRITE];
244 244
 
245 245
         foreach ($opList as $op) {
246 246
             $this->removeSocketOperation($streamResource, $op);
@@ -281,8 +281,7 @@  discard block
 block discarded – undo
281 281
      */
282 282
     private function calculateAttemptsCount($seconds, $usec)
283 283
     {
284
-        $result = $seconds !== null ? ceil(($seconds * 1E6 + $usec) / self::ATTEMPT_DELAY) :
285
-            self::ATTEMPT_COUNT_FOR_INFINITE_TIMEOUT;
284
+        $result = $seconds !== null ? ceil(($seconds * 1E6 + $usec) / self::ATTEMPT_DELAY) : self::ATTEMPT_COUNT_FOR_INFINITE_TIMEOUT;
286 285
         if ($result < self::ATTEMPT_COUNT_FOR_INFINITE_TIMEOUT) {
287 286
             $result = self::ATTEMPT_COUNT_FOR_INFINITE_TIMEOUT;
288 287
         }
Please login to merge, or discard this patch.
src/Socket/StreamResourceInterface.php 1 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/DatagramServerIo.php 1 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/AbstractIo.php 1 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.