@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | $code = socket_last_error(); |
| 157 | 157 | if ($code != 0) { |
| 158 | 158 | if ($code != 10053) { |
| 159 | - throw new SocketException(socket_strerror($code), array(), $code); |
|
| 159 | + throw new SocketException(socket_strerror($code), array(), $code); |
|
| 160 | 160 | } else { |
| 161 | 161 | $this->handle = null; |
| 162 | 162 | } |
@@ -210,6 +210,6 @@ discard block |
||
| 210 | 210 | */ |
| 211 | 211 | public function isOpen() |
| 212 | 212 | { |
| 213 | - return is_resource($this->handle); |
|
| 213 | + return is_resource($this->handle); |
|
| 214 | 214 | } |
| 215 | 215 | } |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | $this->endpoint = $endpoint; |
| 43 | 43 | $this->handle = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP); |
| 44 | 44 | |
| 45 | - if (! is_resource($this->handle)) { |
|
| 45 | + if (!is_resource($this->handle)) { |
|
| 46 | 46 | $code = socket_last_error(); |
| 47 | 47 | throw new SocketException(socket_strerror($code), array(), $code); |
| 48 | 48 | } |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | public function ready() |
| 76 | 76 | { |
| 77 | - if (! is_resource($this->handle)) { |
|
| 77 | + if (!is_resource($this->handle)) { |
|
| 78 | 78 | return false; |
| 79 | 79 | } |
| 80 | 80 | |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | return false; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | - if (! in_array($this->handle, $read)) { |
|
| 98 | + if (!in_array($this->handle, $read)) { |
|
| 99 | 99 | return false; |
| 100 | 100 | } |
| 101 | 101 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | */ |
| 109 | 109 | public function isWriteable() |
| 110 | 110 | { |
| 111 | - if (! is_resource($this->handle)) { |
|
| 111 | + if (!is_resource($this->handle)) { |
|
| 112 | 112 | return false; |
| 113 | 113 | } |
| 114 | 114 | |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | return false; |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | - if (! in_array($this->handle, $write)) { |
|
| 132 | + if (!in_array($this->handle, $write)) { |
|
| 133 | 133 | return false; |
| 134 | 134 | } |
| 135 | 135 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | $this->handle = $clientHandle; |
| 37 | 37 | $this->conntected = false; |
| 38 | 38 | |
| 39 | - if (! is_resource($clientHandle)) { |
|
| 39 | + if (!is_resource($clientHandle)) { |
|
| 40 | 40 | parent::__construct($endpoint); |
| 41 | 41 | } |
| 42 | 42 | } |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | */ |
| 49 | 49 | public function connect() |
| 50 | 50 | { |
| 51 | - if (! @socket_connect($this->handle, $this->endpoint->getAddress(), $this->endpoint->getPort())) { |
|
| 51 | + if (!@socket_connect($this->handle, $this->endpoint->getAddress(), $this->endpoint->getPort())) { |
|
| 52 | 52 | $code = socket_last_error($this->handle); |
| 53 | 53 | throw new SocketException(socket_strerror($code), array(), $code); |
| 54 | 54 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | public function disconnect() |
| 64 | 64 | { |
| 65 | - if (! $this->conntected) { |
|
| 65 | + if (!$this->conntected) { |
|
| 66 | 66 | throw new SocketException("Socket is not connected"); |
| 67 | 67 | } |
| 68 | 68 | |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | public function __construct(Endpoint $endpoint) |
| 27 | 27 | { |
| 28 | 28 | parent::__construct($endpoint); |
| 29 | - if (! @socket_set_option($this->handle, SOL_SOCKET, SO_REUSEADDR, 1)) { |
|
| 29 | + if (!@socket_set_option($this->handle, SOL_SOCKET, SO_REUSEADDR, 1)) { |
|
| 30 | 30 | $code = socket_last_error($this->handle); |
| 31 | 31 | throw new SocketException(socket_strerror($code), array(), $code); |
| 32 | 32 | } |
@@ -48,14 +48,14 @@ discard block |
||
| 48 | 48 | while ($runOn) { |
| 49 | 49 | $clientHandle = @socket_accept($this->handle); |
| 50 | 50 | |
| 51 | - if (! is_resource($clientHandle)) { |
|
| 51 | + if (!is_resource($clientHandle)) { |
|
| 52 | 52 | $code = socket_last_error($this->handle); |
| 53 | 53 | throw new SocketException(socket_strerror($code), array(), $code); |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | $address = null; |
| 57 | 57 | $port = 0; |
| 58 | - if (! @socket_getpeername($clientHandle, $address, $port)) { |
|
| 58 | + if (!@socket_getpeername($clientHandle, $address, $port)) { |
|
| 59 | 59 | $code = socket_last_error($clientHandle); |
| 60 | 60 | throw new SocketException(socket_strerror($code), array(), $code); |
| 61 | 61 | } |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | */ |
| 74 | 74 | private function bind() |
| 75 | 75 | { |
| 76 | - if (! @socket_bind($this->handle, $this->endpoint->getAddress(), $this->endpoint->getPort())) { |
|
| 76 | + if (!@socket_bind($this->handle, $this->endpoint->getAddress(), $this->endpoint->getPort())) { |
|
| 77 | 77 | $code = socket_last_error($this->handle); |
| 78 | 78 | throw new SocketException(socket_strerror($code), array(), $code); |
| 79 | 79 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | private function listen() |
| 88 | 88 | { |
| 89 | - if (! @socket_listen($this->handle, 5)) { |
|
| 89 | + if (!@socket_listen($this->handle, 5)) { |
|
| 90 | 90 | $code = socket_last_error($this->handle); |
| 91 | 91 | throw new SocketException(socket_strerror($code), array(), $code); |
| 92 | 92 | } |