@@ -40,12 +40,12 @@ |
||
| 40 | 40 | $ids = array(); |
| 41 | 41 | |
| 42 | 42 | foreach ($id as $key => $value) { |
| 43 | - $ids[] = $key . '(' . $value . ')'; |
|
| 43 | + $ids[] = $key.'('.$value.')'; |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | |
| 47 | 47 | return new self( |
| 48 | - 'Entity of type \'' . $className . '\'' . ($ids ? ' for IDs ' . implode(', ', $ids) : '') . ' was not found' |
|
| 48 | + 'Entity of type \''.$className.'\''.($ids ? ' for IDs '.implode(', ', $ids) : '').' was not found' |
|
| 49 | 49 | ); |
| 50 | 50 | } |
| 51 | 51 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | $expectedLockVersion = ($expectedLockVersion instanceof \DateTime) ? $expectedLockVersion->getTimestamp() : $expectedLockVersion; |
| 77 | 77 | $actualLockVersion = ($actualLockVersion instanceof \DateTime) ? $actualLockVersion->getTimestamp() : $actualLockVersion; |
| 78 | 78 | |
| 79 | - return new self("The optimistic lock failed, version " . $expectedLockVersion . " was expected, but is actually ".$actualLockVersion, $entity); |
|
| 79 | + return new self("The optimistic lock failed, version ".$expectedLockVersion." was expected, but is actually ".$actualLockVersion, $entity); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | /** |
@@ -86,6 +86,6 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | public static function notVersioned($entityName) |
| 88 | 88 | { |
| 89 | - return new self("Cannot obtain optimistic lock on unversioned entity " . $entityName, null); |
|
| 89 | + return new self("Cannot obtain optimistic lock on unversioned entity ".$entityName, null); |
|
| 90 | 90 | } |
| 91 | 91 | } |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | |
| 56 | 56 | $assoc = $class->associationMappings[$fieldName]; |
| 57 | 57 | |
| 58 | - if (! $assoc['isOwningSide']) { |
|
| 58 | + if ( ! $assoc['isOwningSide']) { |
|
| 59 | 59 | return self::getTypeOfField($assoc['mappedBy'], $em->getClassMetadata($assoc['targetEntity']), $em); |
| 60 | 60 | } |
| 61 | 61 | |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | { |
| 126 | 126 | $wakeupProxy = $classMetadata->getReflectionClass()->hasMethod('__wakeup'); |
| 127 | 127 | |
| 128 | - return function (BaseProxy $proxy) use ($entityPersister, $classMetadata, $wakeupProxy) { |
|
| 128 | + return function(BaseProxy $proxy) use ($entityPersister, $classMetadata, $wakeupProxy) { |
|
| 129 | 129 | $initializer = $proxy->__getInitializer(); |
| 130 | 130 | $cloner = $proxy->__getCloner(); |
| 131 | 131 | |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | */ |
| 178 | 178 | private function createCloner(ClassMetadata $classMetadata, EntityPersister $entityPersister) |
| 179 | 179 | { |
| 180 | - return function (BaseProxy $proxy) use ($entityPersister, $classMetadata) { |
|
| 180 | + return function(BaseProxy $proxy) use ($entityPersister, $classMetadata) { |
|
| 181 | 181 | if ($proxy->__isInitialized()) { |
| 182 | 182 | return; |
| 183 | 183 | } |
@@ -212,10 +212,10 @@ |
||
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | /** |
| 215 | - * Obtain the name of the second level query cache region in which query results will be stored |
|
| 216 | - * |
|
| 217 | - * @return string|null The cache region name; NULL indicates the default region. |
|
| 218 | - */ |
|
| 215 | + * Obtain the name of the second level query cache region in which query results will be stored |
|
| 216 | + * |
|
| 217 | + * @return string|null The cache region name; NULL indicates the default region. |
|
| 218 | + */ |
|
| 219 | 219 | public function getCacheRegion() |
| 220 | 220 | { |
| 221 | 221 | return $this->cacheRegion; |
@@ -3,12 +3,10 @@ |
||
| 3 | 3 | namespace Doctrine\Tests\ORM\Cache\Persister\Entity; |
| 4 | 4 | |
| 5 | 5 | use Doctrine\Tests\OrmTestCase; |
| 6 | - |
|
| 7 | 6 | use Doctrine\ORM\Cache\Region; |
| 8 | 7 | use Doctrine\ORM\EntityManager; |
| 9 | 8 | use Doctrine\ORM\Mapping\ClassMetadata; |
| 10 | 9 | use Doctrine\ORM\Persisters\Entity\EntityPersister; |
| 11 | - |
|
| 12 | 10 | use Doctrine\Tests\Models\Cache\Country; |
| 13 | 11 | use Doctrine\Common\Collections\Criteria; |
| 14 | 12 | use Doctrine\Common\Collections\ArrayCollection; |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | public function getParameter($key) |
| 325 | 325 | { |
| 326 | 326 | $filteredParameters = $this->parameters->filter( |
| 327 | - function ($parameter) use ($key) |
|
| 327 | + function($parameter) use ($key) |
|
| 328 | 328 | { |
| 329 | 329 | // Must not be identical because of string to integer conversion |
| 330 | 330 | return ($key == $parameter->getName()); |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | public function setParameter($key, $value, $type = null) |
| 374 | 374 | { |
| 375 | 375 | $filteredParameters = $this->parameters->filter( |
| 376 | - function ($parameter) use ($key) |
|
| 376 | + function($parameter) use ($key) |
|
| 377 | 377 | { |
| 378 | 378 | // Must not be identical because of string to integer conversion |
| 379 | 379 | return ($key == $parameter->getName()); |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | */ |
| 470 | 470 | private function translateNamespaces(Query\ResultSetMapping $rsm) |
| 471 | 471 | { |
| 472 | - $translate = function ($alias) { |
|
| 472 | + $translate = function($alias) { |
|
| 473 | 473 | return $this->_em->getClassMetadata($alias)->getName(); |
| 474 | 474 | }; |
| 475 | 475 | |
@@ -1000,7 +1000,7 @@ discard block |
||
| 1000 | 1000 | $this->getTimestampKey() |
| 1001 | 1001 | ); |
| 1002 | 1002 | |
| 1003 | - $result = $queryCache->get($queryKey, $rsm, $this->_hints); |
|
| 1003 | + $result = $queryCache->get($queryKey, $rsm, $this->_hints); |
|
| 1004 | 1004 | |
| 1005 | 1005 | if ($result !== null) { |
| 1006 | 1006 | if ($this->cacheLogger) { |
@@ -1136,6 +1136,6 @@ discard block |
||
| 1136 | 1136 | |
| 1137 | 1137 | ksort($hints); |
| 1138 | 1138 | |
| 1139 | - return sha1($query . '-' . serialize($params) . '-' . serialize($hints)); |
|
| 1139 | + return sha1($query.'-'.serialize($params).'-'.serialize($hints)); |
|
| 1140 | 1140 | } |
| 1141 | 1141 | } |
@@ -45,9 +45,9 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | private $uow; |
| 47 | 47 | |
| 48 | - /** |
|
| 49 | - * @var \Doctrine\ORM\Cache\CacheFactory |
|
| 50 | - */ |
|
| 48 | + /** |
|
| 49 | + * @var \Doctrine\ORM\Cache\CacheFactory |
|
| 50 | + */ |
|
| 51 | 51 | private $cacheFactory; |
| 52 | 52 | |
| 53 | 53 | /** |
@@ -289,12 +289,12 @@ discard block |
||
| 289 | 289 | return $this->queryCaches[$regionName]; |
| 290 | 290 | } |
| 291 | 291 | |
| 292 | - /** |
|
| 293 | - * @param \Doctrine\ORM\Mapping\ClassMetadata $metadata The entity metadata. |
|
| 294 | - * @param mixed $identifier The entity identifier. |
|
| 295 | - * |
|
| 296 | - * @return \Doctrine\ORM\Cache\EntityCacheKey |
|
| 297 | - */ |
|
| 292 | + /** |
|
| 293 | + * @param \Doctrine\ORM\Mapping\ClassMetadata $metadata The entity metadata. |
|
| 294 | + * @param mixed $identifier The entity identifier. |
|
| 295 | + * |
|
| 296 | + * @return \Doctrine\ORM\Cache\EntityCacheKey |
|
| 297 | + */ |
|
| 298 | 298 | private function buildEntityCacheKey(ClassMetadata $metadata, $identifier) |
| 299 | 299 | { |
| 300 | 300 | if ( ! is_array($identifier)) { |
@@ -278,8 +278,7 @@ |
||
| 278 | 278 | public function getQueryCache($regionName = null) |
| 279 | 279 | { |
| 280 | 280 | if ($regionName === null) { |
| 281 | - return $this->defaultQueryCache ?: |
|
| 282 | - $this->defaultQueryCache = $this->cacheFactory->buildQueryCache($this->em); |
|
| 281 | + return $this->defaultQueryCache ?: $this->defaultQueryCache = $this->cacheFactory->buildQueryCache($this->em); |
|
| 283 | 282 | } |
| 284 | 283 | |
| 285 | 284 | if ( ! isset($this->queryCaches[$regionName])) { |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | */ |
| 74 | 74 | public function getCacheLogger() |
| 75 | 75 | { |
| 76 | - return $this->cacheLogger; |
|
| 76 | + return $this->cacheLogger; |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | /** |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | $this->queryValidator = new TimestampQueryCacheValidator(); |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - return $this->queryValidator; |
|
| 116 | + return $this->queryValidator; |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | /** |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | */ |
| 125 | 125 | protected function getCacheEntryKey(CacheKey $key) |
| 126 | 126 | { |
| 127 | - return $this->name . self::REGION_KEY_SEPARATOR . $key->hash; |
|
| 127 | + return $this->name.self::REGION_KEY_SEPARATOR.$key->hash; |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | /** |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | */ |
| 149 | 149 | public function evictAll() |
| 150 | 150 | { |
| 151 | - if (! $this->cache instanceof ClearableCache) { |
|
| 151 | + if ( ! $this->cache instanceof ClearableCache) { |
|
| 152 | 152 | throw new \BadMethodCallException(sprintf( |
| 153 | 153 | 'Clearing all cache entries is not supported by the supplied cache adapter of type %s', |
| 154 | 154 | get_class($this->cache) |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | */ |
| 119 | 119 | private function getLockFileName(CacheKey $key) |
| 120 | 120 | { |
| 121 | - return $this->directory . DIRECTORY_SEPARATOR . $key->hash . '.' . self::LOCK_EXTENSION; |
|
| 121 | + return $this->directory.DIRECTORY_SEPARATOR.$key->hash.'.'.self::LOCK_EXTENSION; |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | /** |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | { |
| 217 | 217 | // The check below is necessary because on some platforms glob returns false |
| 218 | 218 | // when nothing matched (even though no errors occurred) |
| 219 | - $filenames = glob(sprintf("%s/*.%s" , $this->directory, self::LOCK_EXTENSION)); |
|
| 219 | + $filenames = glob(sprintf("%s/*.%s", $this->directory, self::LOCK_EXTENSION)); |
|
| 220 | 220 | |
| 221 | 221 | if ($filenames) { |
| 222 | 222 | foreach ($filenames as $filename) { |