@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | * If the resource is closed or not a socket, `SOCKET_EBADF` is returned. |
| 29 | 29 | * @return int |
| 30 | 30 | */ |
| 31 | - public static function getLast ($resource = null) { |
|
| 31 | + public static function getLast($resource = null) { |
|
| 32 | 32 | if (isset($resource)) { |
| 33 | 33 | if (@get_resource_type($resource) !== 'Socket') { |
| 34 | 34 | return SOCKET_EBADF; |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | * PHP's last suppressed warning is used for the message. |
| 55 | 55 | * |
| 56 | 56 | */ |
| 57 | - public function __construct ($subject = null, $fallback = 0) { |
|
| 57 | + public function __construct($subject = null, $fallback = 0) { |
|
| 58 | 58 | if (is_int($subject)) { |
| 59 | 59 | $errno = $subject; |
| 60 | 60 | } |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | /** |
| 75 | 75 | * @return mixed |
| 76 | 76 | */ |
| 77 | - public function getExtra () { |
|
| 77 | + public function getExtra() { |
|
| 78 | 78 | return $this->extra; |
| 79 | 79 | } |
| 80 | 80 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | * @param mixed $extra |
| 83 | 83 | * @return $this |
| 84 | 84 | */ |
| 85 | - public function setExtra ($extra) { |
|
| 85 | + public function setExtra($extra) { |
|
| 86 | 86 | $this->extra = $extra; |
| 87 | 87 | return $this; |
| 88 | 88 | } |
@@ -57,14 +57,12 @@ |
||
| 57 | 57 | public function __construct ($subject = null, $fallback = 0) { |
| 58 | 58 | if (is_int($subject)) { |
| 59 | 59 | $errno = $subject; |
| 60 | - } |
|
| 61 | - else { |
|
| 60 | + } else { |
|
| 62 | 61 | $errno = static::getLast($subject); |
| 63 | 62 | } |
| 64 | 63 | if ($errno) { |
| 65 | 64 | $message = socket_strerror($errno); |
| 66 | - } |
|
| 67 | - else { |
|
| 65 | + } else { |
|
| 68 | 66 | $errno = $fallback; |
| 69 | 67 | $message = error_get_last()['message']; |
| 70 | 68 | } |