@@ -36,7 +36,7 @@ |
||
| 36 | 36 | */ |
| 37 | 37 | public function __construct($data = null, $isOutOfBand = false) |
| 38 | 38 | { |
| 39 | - $this->data = $data !== null ? (string) $data : null; |
|
| 39 | + $this->data = $data !== null ? (string) $data : null; |
|
| 40 | 40 | $this->isOutOfBand = $isOutOfBand; |
| 41 | 41 | } |
| 42 | 42 | |
@@ -60,8 +60,8 @@ |
||
| 60 | 60 | $lastError = $includeLastError ? error_get_last() : null; |
| 61 | 61 | if ($lastError) { |
| 62 | 62 | $phpMessage = explode(':', $lastError['message'], 2); |
| 63 | - $phpMessage = trim(trim(end($phpMessage)), '.') . '.'; |
|
| 64 | - $message .= ' ' . $phpMessage; |
|
| 63 | + $phpMessage = trim(trim(end($phpMessage)), '.').'.'; |
|
| 64 | + $message .= ' '.$phpMessage; |
|
| 65 | 65 | } |
| 66 | 66 | throw new NetworkSocketException($this->socket, $message); |
| 67 | 67 | } |
@@ -71,9 +71,8 @@ discard block |
||
| 71 | 71 | private function resolveReadAttempts(array $context, $currentAttempts) |
| 72 | 72 | { |
| 73 | 73 | return ($context['countCycles'] === 1 && empty($context['dataBeforeIo'])) || |
| 74 | - ($context['countCycles'] > 1 && $context['isStreamDataEmpty']) ? |
|
| 75 | - $currentAttempts - 1 : |
|
| 76 | - self::READ_ATTEMPTS; |
|
| 74 | + ($context['countCycles'] > 1 && $context['isStreamDataEmpty']) ? |
|
| 75 | + $currentAttempts - 1 : self::READ_ATTEMPTS; |
|
| 77 | 76 | |
| 78 | 77 | } |
| 79 | 78 | |
@@ -85,8 +84,7 @@ discard block |
||
| 85 | 84 | $this->throwNetworkSocketExceptionIf($test !== 0, 'Failed to send data.', true); |
| 86 | 85 | |
| 87 | 86 | $written = $isOutOfBand ? |
| 88 | - $this->writeOobData($resource, $data) : |
|
| 89 | - fwrite($resource, $data, strlen($data)); |
|
| 87 | + $this->writeOobData($resource, $data) : fwrite($resource, $data, strlen($data)); |
|
| 90 | 88 | |
| 91 | 89 | $this->throwNetworkSocketExceptionIf($written === false, 'Failed to send data.', true); |
| 92 | 90 | |
@@ -211,9 +211,9 @@ |
||
| 211 | 211 | private function onEvent(LeEvent $event, $eventFlags) |
| 212 | 212 | { |
| 213 | 213 | $map = [ |
| 214 | - LeCallbackInterface::EVENT_READ => [ EV_READ, RequestDescriptor::RDS_READ ], |
|
| 215 | - LeCallbackInterface::EVENT_WRITE => [ EV_WRITE, RequestDescriptor::RDS_WRITE ], |
|
| 216 | - LeCallbackInterface::EVENT_TIMEOUT => [ EV_TIMEOUT, 0 ], |
|
| 214 | + LeCallbackInterface::EVENT_READ => [EV_READ, RequestDescriptor::RDS_READ], |
|
| 215 | + LeCallbackInterface::EVENT_WRITE => [EV_WRITE, RequestDescriptor::RDS_WRITE], |
|
| 216 | + LeCallbackInterface::EVENT_TIMEOUT => [EV_TIMEOUT, 0], |
|
| 217 | 217 | ]; |
| 218 | 218 | |
| 219 | 219 | $descriptor = $event->getRequestDescriptor(); |
@@ -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 | } |