@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $packages = $this->splitToChunks($message); |
| 38 | 38 | $bytes = 0; |
| 39 | 39 | foreach ($packages as $package) { |
| 40 | - $bytes += (int)parent::write($package, $length); |
|
| 40 | + $bytes += (int) parent::write($package, $length); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | return $bytes; |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $id = substr(md5(uniqid('', true), true), 0, 8); |
| 51 | 51 | |
| 52 | 52 | foreach ($chunks as $n => &$chunk) { |
| 53 | - $chunk = self::CHUNK_MAGIC_ID . $id . pack('CC', $n, $count) . $chunk; |
|
| 53 | + $chunk = self::CHUNK_MAGIC_ID.$id.pack('CC', $n, $count).$chunk; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | return $chunks; |
@@ -26,8 +26,8 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | public function connect(string $address, int $port = 0, array $options = []): TransportInterface |
| 28 | 28 | { |
| 29 | - $timeout = (float)($options['timeout'] ??(float) ini_get('default_socket_timeout')); |
|
| 30 | - $url = $this->socketPrefix . $address; |
|
| 29 | + $timeout = (float) ($options['timeout'] ??(float) ini_get('default_socket_timeout')); |
|
| 30 | + $url = $this->socketPrefix.$address; |
|
| 31 | 31 | $this->socket = @fsockopen($url, $port, $this->errorNumber, $this->errorMessage, $timeout); |
| 32 | 32 | |
| 33 | 33 | return $this; |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | parent::connect($address, $port, $options); |
| 15 | 15 | |
| 16 | 16 | if ($this->socket === false) { |
| 17 | - throw new RuntimeException('can`t open socket - ' . $this->errorNumber . ': ' . $this->errorMessage); |
|
| 17 | + throw new RuntimeException('can`t open socket - '.$this->errorNumber.': '.$this->errorMessage); |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | return $this; |
@@ -22,6 +22,6 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | public function write(string $buffer, int $length = null): int |
| 24 | 24 | { |
| 25 | - return parent::write($buffer . "\0", $length); |
|
| 25 | + return parent::write($buffer."\0", $length); |
|
| 26 | 26 | } |
| 27 | 27 | } |