@@ -105,9 +105,9 @@ discard block |
||
105 | 105 | */ |
106 | 106 | if(array_diff_key($array, get_object_vars($this))){ |
107 | 107 | throw new PhpfastcacheInvalidConfigurationException(\sprintf( |
108 | - 'Invalid option(s) for the config %s: %s', |
|
109 | - static::class, |
|
110 | - implode(', ', array_keys(array_diff_key($array, get_object_vars($this)))) |
|
108 | + 'Invalid option(s) for the config %s: %s', |
|
109 | + static::class, |
|
110 | + implode(', ', array_keys(array_diff_key($array, get_object_vars($this)))) |
|
111 | 111 | )); |
112 | 112 | } |
113 | 113 | |
@@ -139,10 +139,10 @@ discard block |
||
139 | 139 | $typeHintExpected = ($parameter instanceof \ReflectionParameter ? ($parameter->getType() === 'object' ? $parameter->getClass() : $parameter->getType()) : 'Unknown type'); |
140 | 140 | |
141 | 141 | throw new PhpfastcacheInvalidConfigurationException(\sprintf( |
142 | - 'Invalid type hint found for "%s", expected "%s" got "%s"', |
|
143 | - lcfirst(substr($method, 3)), |
|
144 | - $typeHintExpected, |
|
145 | - $typeHintGot |
|
142 | + 'Invalid type hint found for "%s", expected "%s" got "%s"', |
|
143 | + lcfirst(substr($method, 3)), |
|
144 | + $typeHintExpected, |
|
145 | + $typeHintGot |
|
146 | 146 | )); |
147 | 147 | } |
148 | 148 | } |
@@ -360,9 +360,9 @@ discard block |
||
360 | 360 | { |
361 | 361 | if($fallbackConfig !== null && !($fallbackConfig instanceof self)){ |
362 | 362 | throw new PhpfastcacheInvalidArgumentException(\sprintf( |
363 | - 'Invalid argument "%s" for %s', |
|
364 | - gettype($fallbackConfig) === 'object' ? get_class($fallbackConfig) : gettype($fallbackConfig), |
|
365 | - __METHOD__ |
|
363 | + 'Invalid argument "%s" for %s', |
|
364 | + gettype($fallbackConfig) === 'object' ? get_class($fallbackConfig) : gettype($fallbackConfig), |
|
365 | + __METHOD__ |
|
366 | 366 | )); |
367 | 367 | } |
368 | 368 | $this->fallbackConfig = $fallbackConfig; |
@@ -461,10 +461,10 @@ discard block |
||
461 | 461 | * by opening a pull request :) |
462 | 462 | */ |
463 | 463 | static $safeFileExtensions = [ |
464 | - 'txt', |
|
465 | - 'cache', |
|
466 | - 'db', |
|
467 | - 'pfc', |
|
464 | + 'txt', |
|
465 | + 'cache', |
|
466 | + 'db', |
|
467 | + 'pfc', |
|
468 | 468 | ]; |
469 | 469 | |
470 | 470 | if (\strpos($cacheFileExtension, '.') !== false) { |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | } |
473 | 473 | if (!\in_array($cacheFileExtension, $safeFileExtensions, true)) { |
474 | 474 | throw new PhpfastcacheInvalidConfigurationException( |
475 | - "Extension \"{$cacheFileExtension}\" is not safe, currently allowed extension names: " . \implode(', ', $safeFileExtensions) |
|
475 | + "Extension \"{$cacheFileExtension}\" is not safe, currently allowed extension names: " . \implode(', ', $safeFileExtensions) |
|
476 | 476 | ); |
477 | 477 | } |
478 | 478 |
@@ -194,9 +194,9 @@ discard block |
||
194 | 194 | protected static function cleanFileName($filename): string |
195 | 195 | { |
196 | 196 | $regex = [ |
197 | - '/[\?\[\]\/\\\=\<\>\:\;\,\'\"\&\$\#\*\(\)\|\~\`\!\{\}]/', |
|
198 | - '/\.$/', |
|
199 | - '/^\./', |
|
197 | + '/[\?\[\]\/\\\=\<\>\:\;\,\'\"\&\$\#\*\(\)\|\~\`\!\{\}]/', |
|
198 | + '/\.$/', |
|
199 | + '/^\./', |
|
200 | 200 | ]; |
201 | 201 | $replace = ['-', '', '']; |
202 | 202 | |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | $tmpFilename = Directory::getAbsolutePath(\dirname($file) . '/tmp_' . $this->getConfig()->getDefaultFileNameHashFunction()( |
293 | 293 | \str_shuffle(\uniqid($this->getDriverName(), false)) |
294 | 294 | . \str_shuffle(\uniqid($this->getDriverName(), false)) |
295 | - )); |
|
295 | + )); |
|
296 | 296 | |
297 | 297 | $f = \fopen($tmpFilename, 'w+'); |
298 | 298 | \flock($f, \LOCK_EX); |
@@ -334,11 +334,11 @@ discard block |
||
334 | 334 | } |
335 | 335 | |
336 | 336 | $stat->setData(\implode(', ', \array_keys($this->itemInstances))) |
337 | - ->setRawData([ |
|
337 | + ->setRawData([ |
|
338 | 338 | 'tmp' => $this->tmp, |
339 | - ]) |
|
340 | - ->setSize(Directory::dirSize($path)) |
|
341 | - ->setInfo('Number of files used to build the cache: ' . Directory::getFileCount($path)); |
|
339 | + ]) |
|
340 | + ->setSize(Directory::dirSize($path)) |
|
341 | + ->setInfo('Number of files used to build the cache: ' . Directory::getFileCount($path)); |
|
342 | 342 | |
343 | 343 | return $stat; |
344 | 344 | } |