@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | protected function doFetch($id) |
| 67 | 67 | { |
| 68 | - if (! $this->doContains($id)) { |
|
| 68 | + if ( ! $this->doContains($id)) { |
|
| 69 | 69 | $this->missesCount += 1; |
| 70 | 70 | |
| 71 | 71 | return false; |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | */ |
| 82 | 82 | protected function doContains($id) |
| 83 | 83 | { |
| 84 | - if (! isset($this->data[$id])) { |
|
| 84 | + if ( ! isset($this->data[$id])) { |
|
| 85 | 85 | return false; |
| 86 | 86 | } |
| 87 | 87 | |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | // No lifetime, use MSET |
| 73 | - $response = $this->client->mset(array_map(function ($value) { |
|
| 73 | + $response = $this->client->mset(array_map(function($value) { |
|
| 74 | 74 | return serialize($value); |
| 75 | 75 | }, $keysAndValues)); |
| 76 | 76 | |
@@ -142,7 +142,7 @@ |
||
| 142 | 142 | { |
| 143 | 143 | $stats = $this->memcached->getStats(); |
| 144 | 144 | $servers = $this->memcached->getServerList(); |
| 145 | - $key = $servers[0]['host'] . ':' . $servers[0]['port']; |
|
| 145 | + $key = $servers[0]['host'].':'.$servers[0]['port']; |
|
| 146 | 146 | $stats = $stats[$key]; |
| 147 | 147 | return [ |
| 148 | 148 | Cache::STATS_HITS => $stats['get_hits'], |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | { |
| 79 | 79 | $item = $this->findById($id); |
| 80 | 80 | |
| 81 | - if (! $item) { |
|
| 81 | + if ( ! $item) { |
|
| 82 | 82 | return false; |
| 83 | 83 | } |
| 84 | 84 | |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | { |
| 157 | 157 | list($idField) = $fields = $this->getFields(); |
| 158 | 158 | |
| 159 | - if (! $includeData) { |
|
| 159 | + if ( ! $includeData) { |
|
| 160 | 160 | $key = array_search(static::DATA_FIELD, $fields); |
| 161 | 161 | unset($fields[$key]); |
| 162 | 162 | } |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | { |
| 34 | 34 | parent::__construct($directory, $extension, $umask); |
| 35 | 35 | |
| 36 | - self::$emptyErrorHandler = function () { |
|
| 36 | + self::$emptyErrorHandler = function() { |
|
| 37 | 37 | }; |
| 38 | 38 | } |
| 39 | 39 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | |
| 112 | 112 | restore_error_handler(); |
| 113 | 113 | |
| 114 | - if (! isset($value['lifetime'])) { |
|
| 114 | + if ( ! isset($value['lifetime'])) { |
|
| 115 | 115 | return null; |
| 116 | 116 | } |
| 117 | 117 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | $lifetime = -1; |
| 37 | 37 | $filename = $this->getFilename($id); |
| 38 | 38 | |
| 39 | - if (! is_file($filename)) { |
|
| 39 | + if ( ! is_file($filename)) { |
|
| 40 | 40 | return false; |
| 41 | 41 | } |
| 42 | 42 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | $lifetime = -1; |
| 71 | 71 | $filename = $this->getFilename($id); |
| 72 | 72 | |
| 73 | - if (! is_file($filename)) { |
|
| 73 | + if ( ! is_file($filename)) { |
|
| 74 | 74 | return false; |
| 75 | 75 | } |
| 76 | 76 | |
@@ -98,6 +98,6 @@ discard block |
||
| 98 | 98 | $data = serialize($data); |
| 99 | 99 | $filename = $this->getFilename($id); |
| 100 | 100 | |
| 101 | - return $this->writeFile($filename, $lifeTime . PHP_EOL . $data); |
|
| 101 | + return $this->writeFile($filename, $lifeTime.PHP_EOL.$data); |
|
| 102 | 102 | } |
| 103 | 103 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | $response = $this->bucket->get($id); |
| 42 | 42 | |
| 43 | 43 | // No objects found |
| 44 | - if (! $response->hasObject()) { |
|
| 44 | + if ( ! $response->hasObject()) { |
|
| 45 | 45 | return false; |
| 46 | 46 | } |
| 47 | 47 | |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | $response = $this->bucket->get($id, $input); |
| 84 | 84 | |
| 85 | 85 | // No objects found |
| 86 | - if (! $response->hasObject()) { |
|
| 86 | + if ( ! $response->hasObject()) { |
|
| 87 | 87 | return false; |
| 88 | 88 | } |
| 89 | 89 | |
@@ -90,7 +90,7 @@ |
||
| 90 | 90 | $stats = $this->couchbase->getStats(); |
| 91 | 91 | $servers = $this->couchbase->getServers(); |
| 92 | 92 | $server = explode(':', $servers[0]); |
| 93 | - $key = $server[0] . ':11210'; |
|
| 93 | + $key = $server[0].':11210'; |
|
| 94 | 94 | $stats = $stats[$key]; |
| 95 | 95 | return [ |
| 96 | 96 | Cache::STATS_HITS => $stats['get_hits'], |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | public function __construct($directory, $extension = '', $umask = 0002) |
| 68 | 68 | { |
| 69 | 69 | // YES, this needs to be *before* createPathIfNeeded() |
| 70 | - if (! is_int($umask)) { |
|
| 70 | + if ( ! is_int($umask)) { |
|
| 71 | 71 | throw new \InvalidArgumentException(sprintf( |
| 72 | 72 | 'The umask parameter is required to be integer, was: %s', |
| 73 | 73 | gettype($umask) |
@@ -75,14 +75,14 @@ discard block |
||
| 75 | 75 | } |
| 76 | 76 | $this->umask = $umask; |
| 77 | 77 | |
| 78 | - if (! $this->createPathIfNeeded($directory)) { |
|
| 78 | + if ( ! $this->createPathIfNeeded($directory)) { |
|
| 79 | 79 | throw new \InvalidArgumentException(sprintf( |
| 80 | 80 | 'The directory "%s" does not exist and could not be created.', |
| 81 | 81 | $directory |
| 82 | 82 | )); |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | - if (! is_writable($directory)) { |
|
| 85 | + if ( ! is_writable($directory)) { |
|
| 86 | 86 | throw new \InvalidArgumentException(sprintf( |
| 87 | 87 | 'The directory "%s" is not writable.', |
| 88 | 88 | $directory |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | // And there is a bug in PHP (https://bugs.php.net/bug.php?id=70943) with path lengths of 259. |
| 138 | 138 | // So if the id in hex representation would surpass the limit, we use the hash instead. The prefix prevents |
| 139 | 139 | // collisions between the hash and bin2hex. |
| 140 | - $filename = '_' . $hash; |
|
| 140 | + $filename = '_'.$hash; |
|
| 141 | 141 | } else { |
| 142 | 142 | $filename = bin2hex($id); |
| 143 | 143 | } |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | */ |
| 214 | 214 | private function createPathIfNeeded(string $path) : bool |
| 215 | 215 | { |
| 216 | - if (! is_dir($path)) { |
|
| 216 | + if ( ! is_dir($path)) { |
|
| 217 | 217 | if (@mkdir($path, 0777 & (~$this->umask), true) === false && ! is_dir($path)) { |
| 218 | 218 | return false; |
| 219 | 219 | } |
@@ -234,11 +234,11 @@ discard block |
||
| 234 | 234 | { |
| 235 | 235 | $filepath = pathinfo($filename, PATHINFO_DIRNAME); |
| 236 | 236 | |
| 237 | - if (! $this->createPathIfNeeded($filepath)) { |
|
| 237 | + if ( ! $this->createPathIfNeeded($filepath)) { |
|
| 238 | 238 | return false; |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | - if (! is_writable($filepath)) { |
|
| 241 | + if ( ! is_writable($filepath)) { |
|
| 242 | 242 | return false; |
| 243 | 243 | } |
| 244 | 244 | |