@@ -1,12 +1,12 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Async sockets |
|
4 | - * |
|
5 | - * @copyright Copyright (c) 2016, 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) 2016, 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\Operation; |
11 | 11 | |
12 | 12 | /** |
@@ -1,12 +1,12 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Async sockets |
|
4 | - * |
|
5 | - * @copyright Copyright (c) 2016, 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) 2016, 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\Operation; |
11 | 11 | |
12 | 12 | /** |
@@ -1,12 +1,12 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Async sockets |
|
4 | - * |
|
5 | - * @copyright Copyright (c) 2016, 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) 2016, 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\Operation; |
11 | 11 | |
12 | 12 | /** |
@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Async sockets |
|
4 | - * |
|
5 | - * @copyright Copyright (c) 2016, 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) 2016, 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\RequestExecutor\Pipeline; |
11 | 11 | |
12 | 12 | use AsyncSockets\Event\DataAlertEvent; |
@@ -125,9 +125,9 @@ discard block |
||
125 | 125 | $operation = $descriptor->getOperation(); |
126 | 126 | return ($operation instanceof NullOperation) || |
127 | 127 | ( |
128 | - $operation instanceof ReadOperation && |
|
128 | + $operation instanceof ReadOperation && |
|
129 | 129 | $operation->getFramePicker() instanceof EmptyFramePicker |
130 | - ); |
|
130 | + ); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
@@ -104,7 +104,7 @@ |
||
104 | 104 | return new Event( |
105 | 105 | $this->executor, |
106 | 106 | $operation->getSocket(), |
107 | - $meta[ RequestExecutorInterface::META_USER_CONTEXT ], |
|
107 | + $meta[RequestExecutorInterface::META_USER_CONTEXT], |
|
108 | 108 | $eventName |
109 | 109 | ); |
110 | 110 | } |
@@ -1,12 +1,12 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Async sockets |
|
4 | - * |
|
5 | - * @copyright Copyright (c) 2016, 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) 2016, 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\Operation; |
11 | 11 | |
12 | 12 | /** |
@@ -1,12 +1,12 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Async sockets |
|
4 | - * |
|
5 | - * @copyright Copyright (c) 2016, 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) 2016, 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\Operation; |
11 | 11 | |
12 | 12 | /** |
@@ -239,8 +239,8 @@ discard block |
||
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 |
||
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 | } |
@@ -53,7 +53,7 @@ |
||
53 | 53 | private function isDescriptorActive(OperationMetadata $descriptor) |
54 | 54 | { |
55 | 55 | $meta = $descriptor->getMetadata(); |
56 | - return !$meta[ RequestExecutorInterface::META_REQUEST_COMPLETE ] && |
|
56 | + return !$meta[RequestExecutorInterface::META_REQUEST_COMPLETE] && |
|
57 | 57 | $descriptor->isRunning() && |
58 | 58 | !$descriptor->isPostponed(); |
59 | 59 | } |
@@ -41,8 +41,7 @@ discard block |
||
41 | 41 | { |
42 | 42 | $meta = $operation->getMetadata(); |
43 | 43 | return !$this->hasConnected($operation) ? |
44 | - $meta[ RequestExecutorInterface::META_CONNECTION_TIMEOUT ] : |
|
45 | - $meta[ RequestExecutorInterface::META_IO_TIMEOUT ]; |
|
44 | + $meta[RequestExecutorInterface::META_CONNECTION_TIMEOUT] : $meta[RequestExecutorInterface::META_IO_TIMEOUT]; |
|
46 | 45 | } |
47 | 46 | |
48 | 47 | /** |
@@ -56,8 +55,7 @@ discard block |
||
56 | 55 | { |
57 | 56 | $meta = $operation->getMetadata(); |
58 | 57 | return !$this->hasConnected($operation) ? |
59 | - $meta[ RequestExecutorInterface::META_CONNECTION_START_TIME ] : |
|
60 | - $meta[ RequestExecutorInterface::META_LAST_IO_START_TIME ]; |
|
58 | + $meta[RequestExecutorInterface::META_CONNECTION_START_TIME] : $meta[RequestExecutorInterface::META_LAST_IO_START_TIME]; |
|
61 | 59 | } |
62 | 60 | |
63 | 61 | /** |
@@ -74,7 +72,7 @@ discard block |
||
74 | 72 | $meta = $operationMetadata->getMetadata(); |
75 | 73 | $table = [ |
76 | 74 | RequestExecutorInterface::META_CONNECTION_START_TIME => |
77 | - $meta[ RequestExecutorInterface::META_CONNECTION_START_TIME ] === null, |
|
75 | + $meta[RequestExecutorInterface::META_CONNECTION_START_TIME] === null, |
|
78 | 76 | |
79 | 77 | RequestExecutorInterface::META_CONNECTION_FINISH_TIME => |
80 | 78 | $meta[RequestExecutorInterface::META_CONNECTION_FINISH_TIME] === null, |