@@ -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 | ) |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | public function load(string $class): ?ClassMetadata |
| 24 | 24 | { |
| 25 | - $this->lastItem = $this->pool->getItem(strtr($this->prefix . $class, '\\', '.')); |
|
| 25 | + $this->lastItem = $this->pool->getItem(strtr($this->prefix.$class, '\\', '.')); |
|
| 26 | 26 | |
| 27 | 27 | return $this->lastItem->get(); |
| 28 | 28 | } |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | public function put(ClassMetadata $metadata): void |
| 34 | 34 | { |
| 35 | - $key = strtr($this->prefix . $metadata->name, '\\', '.'); |
|
| 35 | + $key = strtr($this->prefix.$metadata->name, '\\', '.'); |
|
| 36 | 36 | |
| 37 | 37 | if (null === $this->lastItem || $this->lastItem->getKey() !== $key) { |
| 38 | 38 | $this->lastItem = $this->pool->getItem($key); |
@@ -46,6 +46,6 @@ discard block |
||
| 46 | 46 | */ |
| 47 | 47 | public function evict(string $class): void |
| 48 | 48 | { |
| 49 | - $this->pool->deleteItem(strtr($this->prefix . $class, '\\', '.')); |
|
| 49 | + $this->pool->deleteItem(strtr($this->prefix.$class, '\\', '.')); |
|
| 50 | 50 | } |
| 51 | 51 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | public function load(string $class): ?ClassMetadata |
| 36 | 36 | { |
| 37 | - $cache = $this->cache->fetch($this->prefix . $class); |
|
| 37 | + $cache = $this->cache->fetch($this->prefix.$class); |
|
| 38 | 38 | return false === $cache ? null : $cache; |
| 39 | 39 | } |
| 40 | 40 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | public function put(ClassMetadata $metadata): void |
| 45 | 45 | { |
| 46 | - $this->cache->save($this->prefix . $metadata->name, $metadata); |
|
| 46 | + $this->cache->save($this->prefix.$metadata->name, $metadata); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
@@ -51,6 +51,6 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | public function evict(string $class): void |
| 53 | 53 | { |
| 54 | - $this->cache->delete($this->prefix . $class); |
|
| 54 | + $this->cache->delete($this->prefix.$class); |
|
| 55 | 55 | } |
| 56 | 56 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | */ |
| 28 | 28 | public function load(string $class): ?ClassMetadata |
| 29 | 29 | { |
| 30 | - $path = $this->dir . '/' . strtr($class, '\\', '-') . '.cache.php'; |
|
| 30 | + $path = $this->dir.'/'.strtr($class, '\\', '-').'.cache.php'; |
|
| 31 | 31 | if (!file_exists($path)) { |
| 32 | 32 | return null; |
| 33 | 33 | } |
@@ -44,13 +44,13 @@ discard block |
||
| 44 | 44 | throw new \InvalidArgumentException(sprintf('The directory "%s" is not writable.', $this->dir)); |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - $path = $this->dir . '/' . strtr($metadata->name, '\\', '-') . '.cache.php'; |
|
| 47 | + $path = $this->dir.'/'.strtr($metadata->name, '\\', '-').'.cache.php'; |
|
| 48 | 48 | |
| 49 | 49 | $tmpFile = tempnam($this->dir, 'metadata-cache'); |
| 50 | 50 | if (false === $tmpFile) { |
| 51 | 51 | return; |
| 52 | 52 | } |
| 53 | - $data = '<?php return unserialize(' . var_export(serialize($metadata), true) . ');'; |
|
| 53 | + $data = '<?php return unserialize('.var_export(serialize($metadata), true).');'; |
|
| 54 | 54 | $bytesWritten = file_put_contents($tmpFile, $data); |
| 55 | 55 | // use strlen and not mb_strlen. if there is utf8 in the code, it also writes more bytes. |
| 56 | 56 | if ($bytesWritten !== strlen($data)) { |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | */ |
| 92 | 92 | public function evict(string $class): void |
| 93 | 93 | { |
| 94 | - $path = $this->dir . '/' . strtr($class, '\\', '-') . '.cache.php'; |
|
| 94 | + $path = $this->dir.'/'.strtr($class, '\\', '-').'.cache.php'; |
|
| 95 | 95 | if (file_exists($path)) { |
| 96 | 96 | unlink($path); |
| 97 | 97 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | $fqcn = str_replace('\\', '.', substr($class->name, $len)); |
| 36 | 36 | |
| 37 | 37 | while (true) { |
| 38 | - $path = $dir . '/' . $fqcn . '.' . $extension; |
|
| 38 | + $path = $dir.'/'.$fqcn.'.'.$extension; |
|
| 39 | 39 | if (file_exists($path)) { |
| 40 | 40 | return $path; |
| 41 | 41 | } |
@@ -63,13 +63,13 @@ discard block |
||
| 63 | 63 | new \RecursiveDirectoryIterator($dir), |
| 64 | 64 | \RecursiveIteratorIterator::LEAVES_ONLY |
| 65 | 65 | ); |
| 66 | - $nsPrefix = '' !== $prefix ? $prefix . '\\' : ''; |
|
| 66 | + $nsPrefix = '' !== $prefix ? $prefix.'\\' : ''; |
|
| 67 | 67 | foreach ($iterator as $file) { |
| 68 | - if (($fileName = $file->getBasename('.' . $extension)) === $file->getBasename()) { |
|
| 68 | + if (($fileName = $file->getBasename('.'.$extension)) === $file->getBasename()) { |
|
| 69 | 69 | continue; |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | - $classes[] = $nsPrefix . str_replace('.', '\\', $fileName); |
|
| 72 | + $classes[] = $nsPrefix.str_replace('.', '\\', $fileName); |
|
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | |