@@ -60,7 +60,7 @@ |
||
| 60 | 60 | /** |
| 61 | 61 | * @param string $className |
| 62 | 62 | * |
| 63 | - * @return ClassHierarchyMetadata|MergeableClassMetadata|null |
|
| 63 | + * @return ClassMetadata|null |
|
| 64 | 64 | */ |
| 65 | 65 | public function getMetadataForClass($className) |
| 66 | 66 | { |
@@ -85,7 +85,7 @@ |
||
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | if (null !== $classMetadata) { |
| 88 | - if ( ! $classMetadata instanceof ClassMetadata) { |
|
| 88 | + if (!$classMetadata instanceof ClassMetadata) { |
|
| 89 | 89 | throw new \LogicException(sprintf('The cache must return instances of ClassMetadata, but got %s.', var_export($classMetadata, true))); |
| 90 | 90 | } |
| 91 | 91 | |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | private $loadedMetadata = array(); |
| 30 | 30 | private $loadedClassMetadata = array(); |
| 31 | 31 | private $hierarchyMetadataClass; |
| 32 | - private $includeInterfaces = FALSE; |
|
| 32 | + private $includeInterfaces = false; |
|
| 33 | 33 | private $debug; |
| 34 | 34 | |
| 35 | 35 | /** |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | * @param string $hierarchyMetadataClass |
| 38 | 38 | * @param boolean $debug |
| 39 | 39 | */ |
| 40 | - public function __construct(DriverInterface $driver, $hierarchyMetadataClass = 'Metadata\ClassHierarchyMetadata', $debug = FALSE) |
|
| 40 | + public function __construct(DriverInterface $driver, $hierarchyMetadataClass = 'Metadata\ClassHierarchyMetadata', $debug = false) |
|
| 41 | 41 | { |
| 42 | 42 | $this->driver = $driver; |
| 43 | 43 | $this->hierarchyMetadataClass = $hierarchyMetadataClass; |
@@ -169,9 +169,9 @@ discard block |
||
| 169 | 169 | do { |
| 170 | 170 | $classes[] = $refl; |
| 171 | 171 | $refl = $refl->getParentClass(); |
| 172 | - } while (FALSE !== $refl); |
|
| 172 | + } while (false !== $refl); |
|
| 173 | 173 | |
| 174 | - $classes = array_reverse($classes, FALSE); |
|
| 174 | + $classes = array_reverse($classes, false); |
|
| 175 | 175 | |
| 176 | 176 | if (!$this->includeInterfaces) { |
| 177 | 177 | return $classes; |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | if (isset($addedInterfaces[$interface->getName()])) { |
| 186 | 186 | continue; |
| 187 | 187 | } |
| 188 | - $addedInterfaces[$interface->getName()] = TRUE; |
|
| 188 | + $addedInterfaces[$interface->getName()] = true; |
|
| 189 | 189 | |
| 190 | 190 | $newHierarchy[] = $interface; |
| 191 | 191 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | public function loadClassMetadataFromCache(\ReflectionClass $class) |
| 37 | 37 | { |
| 38 | - $cache = $this->cache->fetch($this->prefix . $class->name); |
|
| 38 | + $cache = $this->cache->fetch($this->prefix.$class->name); |
|
| 39 | 39 | return false === $cache ? null : $cache; |
| 40 | 40 | } |
| 41 | 41 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | public function putClassMetadataInCache(ClassMetadata $metadata) |
| 46 | 46 | { |
| 47 | - $this->cache->save($this->prefix . $metadata->name, $metadata); |
|
| 47 | + $this->cache->save($this->prefix.$metadata->name, $metadata); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
@@ -52,6 +52,6 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function evictClassMetadataFromCache(\ReflectionClass $class) |
| 54 | 54 | { |
| 55 | - $this->cache->delete($this->prefix . $class->name); |
|
| 55 | + $this->cache->delete($this->prefix.$class->name); |
|
| 56 | 56 | } |
| 57 | 57 | } |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | public function loadClassMetadataFromCache(\ReflectionClass $class) |
| 37 | 37 | { |
| 38 | 38 | $cache = $this->cache->fetch($this->prefix . $class->name); |
| 39 | - return FALSE === $cache ? null : $cache; |
|
| 39 | + return false === $cache ? null : $cache; |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | /** |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $this->name = $name; |
| 39 | 39 | |
| 40 | 40 | $this->reflection = new \ReflectionProperty($class, $name); |
| 41 | - $this->reflection->setAccessible(TRUE); |
|
| 41 | + $this->reflection->setAccessible(true); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -73,6 +73,6 @@ discard block |
||
| 73 | 73 | list($this->class, $this->name) = unserialize($str); |
| 74 | 74 | |
| 75 | 75 | $this->reflection = new \ReflectionProperty($this->class, $this->name); |
| 76 | - $this->reflection->setAccessible(TRUE); |
|
| 76 | + $this->reflection->setAccessible(true); |
|
| 77 | 77 | } |
| 78 | 78 | } |
@@ -58,9 +58,9 @@ discard block |
||
| 58 | 58 | return true; |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | - public function isFresh($timestamp = NULL) |
|
| 61 | + public function isFresh($timestamp = null) |
|
| 62 | 62 | { |
| 63 | - if (NULL === $timestamp) { |
|
| 63 | + if (null === $timestamp) { |
|
| 64 | 64 | $timestamp = $this->createdAt; |
| 65 | 65 | } |
| 66 | 66 | |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - return TRUE; |
|
| 77 | + return true; |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | public function serialize() |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | $path = $this->dir.'/'.strtr($metadata->name, '\\', '-').'.cache.php'; |
| 42 | 42 | |
| 43 | 43 | $tmpFile = tempnam($this->dir, 'metadata-cache'); |
| 44 | - file_put_contents($tmpFile, '<?php return unserialize('.var_export(serialize($metadata), TRUE).');'); |
|
| 44 | + file_put_contents($tmpFile, '<?php return unserialize('.var_export(serialize($metadata), true).');'); |
|
| 45 | 45 | chmod($tmpFile, 0666 & ~umask()); |
| 46 | 46 | |
| 47 | 47 | $this->renameFile($tmpFile, $path); |
@@ -54,12 +54,12 @@ discard block |
||
| 54 | 54 | * @param string $target |
| 55 | 55 | */ |
| 56 | 56 | private function renameFile($source, $target) { |
| 57 | - if (FALSE === @rename($source, $target)) { |
|
| 57 | + if (false === @rename($source, $target)) { |
|
| 58 | 58 | if (defined('PHP_WINDOWS_VERSION_BUILD')) { |
| 59 | - if (FALSE === copy($source, $target)) { |
|
| 59 | + if (false === copy($source, $target)) { |
|
| 60 | 60 | throw new \RuntimeException(sprintf('(WIN) Could not write new cache file to %s.', $target)); |
| 61 | 61 | } |
| 62 | - if (FALSE === unlink($source)) { |
|
| 62 | + if (false === unlink($source)) { |
|
| 63 | 63 | throw new \RuntimeException(sprintf('(WIN) Could not delete temp cache file to %s.', $source)); |
| 64 | 64 | } |
| 65 | 65 | } else { |
@@ -46,10 +46,10 @@ |
||
| 46 | 46 | { |
| 47 | 47 | foreach ($this->classMetadata as $metadata) { |
| 48 | 48 | if (!$metadata->isFresh($timestamp)) { |
| 49 | - return FALSE; |
|
| 49 | + return false; |
|
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - return TRUE; |
|
| 53 | + return true; |
|
| 54 | 54 | } |
| 55 | 55 | } |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $this->name = $name; |
| 39 | 39 | |
| 40 | 40 | $this->reflection = new \ReflectionMethod($class, $name); |
| 41 | - $this->reflection->setAccessible(TRUE); |
|
| 41 | + $this->reflection->setAccessible(true); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -62,6 +62,6 @@ discard block |
||
| 62 | 62 | list($this->class, $this->name) = unserialize($str); |
| 63 | 63 | |
| 64 | 64 | $this->reflection = new \ReflectionMethod($this->class, $this->name); |
| 65 | - $this->reflection->setAccessible(TRUE); |
|
| 65 | + $this->reflection->setAccessible(true); |
|
| 66 | 66 | } |
| 67 | 67 | } |