@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | $len = '' === $prefix ? 0 : strlen($prefix) + 1; |
| 30 | - $path = $dir . '/' . str_replace('\\', '.', substr($class->name, $len)) . '.' . $extension; |
|
| 30 | + $path = $dir.'/'.str_replace('\\', '.', substr($class->name, $len)).'.'.$extension; |
|
| 31 | 31 | if (file_exists($path)) { |
| 32 | 32 | return $path; |
| 33 | 33 | } |
@@ -48,13 +48,13 @@ discard block |
||
| 48 | 48 | new \RecursiveDirectoryIterator($dir), |
| 49 | 49 | \RecursiveIteratorIterator::LEAVES_ONLY |
| 50 | 50 | ); |
| 51 | - $nsPrefix = '' !== $prefix ? $prefix . '\\' : ''; |
|
| 51 | + $nsPrefix = '' !== $prefix ? $prefix.'\\' : ''; |
|
| 52 | 52 | foreach ($iterator as $file) { |
| 53 | - if (($fileName = $file->getBasename('.' . $extension)) === $file->getBasename()) { |
|
| 53 | + if (($fileName = $file->getBasename('.'.$extension)) === $file->getBasename()) { |
|
| 54 | 54 | continue; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - $classes[] = $nsPrefix . str_replace('.', '\\', $fileName); |
|
| 57 | + $classes[] = $nsPrefix.str_replace('.', '\\', $fileName); |
|
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | if (!$driver instanceof AdvancedDriverInterface) { |
| 40 | 40 | throw new \RuntimeException( |
| 41 | 41 | sprintf( |
| 42 | - 'Driver "%s" must be an instance of "AdvancedDriverInterface" to use ' . |
|
| 42 | + 'Driver "%s" must be an instance of "AdvancedDriverInterface" to use '. |
|
| 43 | 43 | '"DriverChain::getAllClassNames()".', |
| 44 | 44 | get_class($driver) |
| 45 | 45 | ) |
@@ -31,18 +31,18 @@ |
||
| 31 | 31 | |
| 32 | 32 | public function load(string $class): ?ClassMetadata |
| 33 | 33 | { |
| 34 | - $cache = $this->cache->fetch($this->prefix . $class); |
|
| 34 | + $cache = $this->cache->fetch($this->prefix.$class); |
|
| 35 | 35 | |
| 36 | 36 | return false === $cache ? null : $cache; |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | public function put(ClassMetadata $metadata): void |
| 40 | 40 | { |
| 41 | - $this->cache->save($this->prefix . $metadata->name, $metadata); |
|
| 41 | + $this->cache->save($this->prefix.$metadata->name, $metadata); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | public function evict(string $class): void |
| 45 | 45 | { |
| 46 | - $this->cache->delete($this->prefix . $class); |
|
| 46 | + $this->cache->delete($this->prefix.$class); |
|
| 47 | 47 | } |
| 48 | 48 | } |
@@ -35,14 +35,14 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | public function load(string $class): ?ClassMetadata |
| 37 | 37 | { |
| 38 | - $this->lastItem = $this->pool->getItem($this->sanitizeCacheKey($this->prefix . $class)); |
|
| 38 | + $this->lastItem = $this->pool->getItem($this->sanitizeCacheKey($this->prefix.$class)); |
|
| 39 | 39 | |
| 40 | 40 | return $this->lastItem->get(); |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | public function put(ClassMetadata $metadata): void |
| 44 | 44 | { |
| 45 | - $key = $this->sanitizeCacheKey($this->prefix . $metadata->name); |
|
| 45 | + $key = $this->sanitizeCacheKey($this->prefix.$metadata->name); |
|
| 46 | 46 | |
| 47 | 47 | if (null === $this->lastItem || $this->lastItem->getKey() !== $key) { |
| 48 | 48 | $this->lastItem = $this->pool->getItem($key); |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | public function evict(string $class): void |
| 55 | 55 | { |
| 56 | - $this->pool->deleteItem($this->sanitizeCacheKey($this->prefix . $class)); |
|
| 56 | + $this->pool->deleteItem($this->sanitizeCacheKey($this->prefix.$class)); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | return; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - $data = '<?php return unserialize(' . var_export(serialize($metadata), true) . ');'; |
|
| 64 | + $data = '<?php return unserialize('.var_export(serialize($metadata), true).');'; |
|
| 65 | 65 | $bytesWritten = file_put_contents($tmpFile, $data); |
| 66 | 66 | // use strlen and not mb_strlen. if there is utf8 in the code, it also writes more bytes. |
| 67 | 67 | if ($bytesWritten !== strlen($data)) { |
@@ -116,6 +116,6 @@ discard block |
||
| 116 | 116 | { |
| 117 | 117 | $fileName = str_replace(['\\', "\0", '@', '/', '$', '{', '}', ':'], '-', $key); |
| 118 | 118 | |
| 119 | - return $this->dir . '/' . $fileName . '.cache.php'; |
|
| 119 | + return $this->dir.'/'.$fileName.'.cache.php'; |
|
| 120 | 120 | } |
| 121 | 121 | } |