@@ -88,7 +88,7 @@ |
||
| 88 | 88 | { |
| 89 | 89 | clearstatcache(); |
| 90 | 90 | |
| 91 | - if (! file_exists($this->file)) { |
|
| 91 | + if (!file_exists($this->file)) { |
|
| 92 | 92 | return false; |
| 93 | 93 | } |
| 94 | 94 | |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | |
| 198 | 198 | $ms = $this->appendPayloadToRequest($ms); |
| 199 | 199 | |
| 200 | - if (! $this->isConnected()) { |
|
| 200 | + if (!$this->isConnected()) { |
|
| 201 | 201 | $this->connect(); |
| 202 | 202 | } |
| 203 | 203 | |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | */ |
| 222 | 222 | private function checkConnection($start) |
| 223 | 223 | { |
| 224 | - if (! $this->ready()) { |
|
| 224 | + if (!$this->ready()) { |
|
| 225 | 225 | if (time() - $start > $this->timeout) { |
| 226 | 226 | $this->disconnect(); |
| 227 | 227 | throw new HttpException("Connection timed out!"); |
@@ -52,8 +52,8 @@ discard block |
||
| 52 | 52 | setlocale(LC_ALL, "C"); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - for ($i = 32; $i < 256; $i ++) { |
|
| 56 | - if (($allowed == RandomString::ASCII && ! ctype_alnum(chr($i))) || (! ctype_print(chr($i)))) { |
|
| 55 | + for ($i = 32; $i < 256; $i++) { |
|
| 56 | + if (($allowed == RandomString::ASCII && !ctype_alnum(chr($i))) || (!ctype_print(chr($i)))) { |
|
| 57 | 57 | continue; |
| 58 | 58 | } |
| 59 | 59 | $allowedChars[] = $i; |
@@ -67,12 +67,12 @@ discard block |
||
| 67 | 67 | $i = $length; |
| 68 | 68 | while ($i > 0) { |
| 69 | 69 | $index = mt_rand(0, count($allowedChars) - 1); |
| 70 | - if (! $repeatable && in_array($index, $used)) { |
|
| 70 | + if (!$repeatable && in_array($index, $used)) { |
|
| 71 | 71 | continue; |
| 72 | 72 | } |
| 73 | 73 | $string .= chr($allowedChars[$index]); |
| 74 | 74 | $used[] = $i; |
| 75 | - $i --; |
|
| 75 | + $i--; |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | return $string; |
@@ -96,7 +96,7 @@ |
||
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | $httpStatus = new HttpStatus(401, '1.0'); |
| 99 | - header('WWW-Authenticate: Basic realm=' . $this->realm); |
|
| 99 | + header('WWW-Authenticate: Basic realm='.$this->realm); |
|
| 100 | 100 | header(sprintf('HTTP/%s', $httpStatus)); |
| 101 | 101 | echo "Forbidden!"; |
| 102 | 102 | return false; |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | |
| 31 | 31 | if ($context !== null) { |
| 32 | 32 | foreach ($context as $key => $val) { |
| 33 | - $replace['{' . $key . '}'] = $val; |
|
| 33 | + $replace['{'.$key.'}'] = $val; |
|
| 34 | 34 | } |
| 35 | 35 | } |
| 36 | 36 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | */ |
| 49 | 49 | public function isEmpty($filter = null) |
| 50 | 50 | { |
| 51 | - if (! $this->exists()) { |
|
| 51 | + if (!$this->exists()) { |
|
| 52 | 52 | throw new DirectoryException("Directory {dir} does not exist", array( |
| 53 | 53 | 'dir' => $this->path |
| 54 | 54 | )); |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | $iter = new \DirectoryIterator($this->path); |
| 58 | 58 | while ($iter->valid()) { |
| 59 | - if (! $iter->isDot() && ($filter === null || ! preg_match("/$filter/", $iter->getFilename()))) { |
|
| 59 | + if (!$iter->isDot() && ($filter === null || !preg_match("/$filter/", $iter->getFilename()))) { |
|
| 60 | 60 | return false; |
| 61 | 61 | } |
| 62 | 62 | $iter->next(); |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | public function remove($recursive = false) |
| 77 | 77 | { |
| 78 | - if (! $this->exists()) { |
|
| 78 | + if (!$this->exists()) { |
|
| 79 | 79 | return; |
| 80 | 80 | } |
| 81 | 81 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | return; |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - if (! $recursive) { |
|
| 91 | + if (!$recursive) { |
|
| 92 | 92 | throw new DirectoryException("Directory {dir} is not empty", array( |
| 93 | 93 | 'dir' => $this->path |
| 94 | 94 | )); |
@@ -145,11 +145,11 @@ discard block |
||
| 145 | 145 | */ |
| 146 | 146 | public function exists() |
| 147 | 147 | { |
| 148 | - if (! file_exists($this->path)) { |
|
| 148 | + if (!file_exists($this->path)) { |
|
| 149 | 149 | return false; |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | - if (! is_dir($this->path)) { |
|
| 152 | + if (!is_dir($this->path)) { |
|
| 153 | 153 | throw new DirectoryException("Entry {path} exists, but it is not a directory!", array( |
| 154 | 154 | 'path' => $this->path |
| 155 | 155 | )); |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | */ |
| 181 | 181 | public function fileExists($fileName) |
| 182 | 182 | { |
| 183 | - if (! $this->exists()) { |
|
| 183 | + if (!$this->exists()) { |
|
| 184 | 184 | return false; |
| 185 | 185 | } |
| 186 | 186 | |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | */ |
| 200 | 200 | private function fixDirectorySeparator($path) |
| 201 | 201 | { |
| 202 | - $path = str_replace("\\", DIRECTORY_SEPARATOR , $path); |
|
| 202 | + $path = str_replace("\\", DIRECTORY_SEPARATOR, $path); |
|
| 203 | 203 | $path = str_replace("/", DIRECTORY_SEPARATOR, $path); |
| 204 | 204 | |
| 205 | 205 | return $path; |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | */ |
| 90 | 90 | public function log($level, $message, array $context = array()) |
| 91 | 91 | { |
| 92 | - if( $this->levelHasReached($level) ) { |
|
| 92 | + if ($this->levelHasReached($level)) { |
|
| 93 | 93 | $this->logImpl($level, $message, $context); |
| 94 | 94 | } |
| 95 | 95 | } |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | LogLevel::DEBUG => 7 |
| 110 | 110 | ); |
| 111 | 111 | |
| 112 | - if ( $this->level ) { |
|
| 112 | + if ($this->level) { |
|
| 113 | 113 | $threshold = $orderedLevels[$this->level]; |
| 114 | 114 | $reached = $orderedLevels[$level]; |
| 115 | 115 | $result = $reached <= $threshold; |
@@ -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 | } |