@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | ? $this->persister->expandCriteriaParameters($criteria) |
| 260 | 260 | : $this->persister->expandParameters($criteria); |
| 261 | 261 | |
| 262 | - return sha1($query . serialize($params) . serialize($orderBy) . $limit . $offset); |
|
| 262 | + return sha1($query.serialize($params).serialize($orderBy).$limit.$offset); |
|
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | /** |
@@ -557,7 +557,7 @@ discard block |
||
| 557 | 557 | $hasCache = ($persister instanceof CachedPersister); |
| 558 | 558 | $key = null; |
| 559 | 559 | |
| 560 | - if (! $hasCache) { |
|
| 560 | + if ( ! $hasCache) { |
|
| 561 | 561 | return $this->persister->loadManyToManyCollection($association, $sourceEntity, $collection); |
| 562 | 562 | } |
| 563 | 563 | |
@@ -596,7 +596,7 @@ discard block |
||
| 596 | 596 | $persister = $uow->getCollectionPersister($association); |
| 597 | 597 | $hasCache = ($persister instanceof CachedPersister); |
| 598 | 598 | |
| 599 | - if (! $hasCache) { |
|
| 599 | + if ( ! $hasCache) { |
|
| 600 | 600 | return $this->persister->loadOneToManyCollection($association, $sourceEntity, $collection); |
| 601 | 601 | } |
| 602 | 602 | |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | $isInitialized = $collection->isInitialized(); |
| 62 | 62 | $isDirty = $collection->isDirty(); |
| 63 | 63 | |
| 64 | - if (! $isInitialized && ! $isDirty) { |
|
| 64 | + if ( ! $isInitialized && ! $isDirty) { |
|
| 65 | 65 | return; |
| 66 | 66 | } |
| 67 | 67 | |
@@ -143,7 +143,7 @@ |
||
| 143 | 143 | $targetHydrator = $targetPersister->getEntityHydrator(); |
| 144 | 144 | |
| 145 | 145 | // Only preserve ordering if association configured it |
| 146 | - if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
| 146 | + if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
| 147 | 147 | // Elements may be an array or a Collection |
| 148 | 148 | $elements = array_values($elements instanceof Collection ? $elements->getValues() : $elements); |
| 149 | 149 | } |
@@ -181,14 +181,14 @@ discard block |
||
| 181 | 181 | ; |
| 182 | 182 | |
| 183 | 183 | if ($cache->getUsage() === CacheUsage::READ_WRITE) { |
| 184 | - if (! $this->fileLockRegionDirectory) { |
|
| 184 | + if ( ! $this->fileLockRegionDirectory) { |
|
| 185 | 185 | throw new \LogicException( |
| 186 | - 'If you want to use a "READ_WRITE" cache an implementation of "Doctrine\ORM\Cache\ConcurrentRegion" is required, ' . |
|
| 186 | + 'If you want to use a "READ_WRITE" cache an implementation of "Doctrine\ORM\Cache\ConcurrentRegion" is required, '. |
|
| 187 | 187 | 'The default implementation provided by doctrine is "Doctrine\ORM\Cache\Region\FileLockRegion" if you want to use it please provide a valid directory, DefaultCacheFactory#setFileLockRegionDirectory(). ' |
| 188 | 188 | ); |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | - $directory = $this->fileLockRegionDirectory . DIRECTORY_SEPARATOR . $regionName; |
|
| 191 | + $directory = $this->fileLockRegionDirectory.DIRECTORY_SEPARATOR.$regionName; |
|
| 192 | 192 | $region = new FileLockRegion($region, $directory, $this->regionsConfig->getLockLifetime($regionName)); |
| 193 | 193 | } |
| 194 | 194 | |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | { |
| 205 | 205 | $cacheAdapter = clone $this->cache; |
| 206 | 206 | |
| 207 | - if (! $cacheAdapter instanceof CacheProvider) { |
|
| 207 | + if ( ! $cacheAdapter instanceof CacheProvider) { |
|
| 208 | 208 | return $cacheAdapter; |
| 209 | 209 | } |
| 210 | 210 | |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | $namespace .= ':'; |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | - $cacheAdapter->setNamespace($namespace . $name); |
|
| 217 | + $cacheAdapter->setNamespace($namespace.$name); |
|
| 218 | 218 | |
| 219 | 219 | return $cacheAdapter; |
| 220 | 220 | } |
@@ -47,6 +47,6 @@ |
||
| 47 | 47 | $this->ownerIdentifier = $ownerIdentifier; |
| 48 | 48 | $this->entityClass = (string) $entityClass; |
| 49 | 49 | $this->association = (string) $association; |
| 50 | - $this->hash = str_replace('\\', '.', strtolower($entityClass)) . '_' . implode(' ', $ownerIdentifier) . '__' . $association; |
|
| 50 | + $this->hash = str_replace('\\', '.', strtolower($entityClass)).'_'.implode(' ', $ownerIdentifier).'__'.$association; |
|
| 51 | 51 | } |
| 52 | 52 | } |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | public static function fromDriver(Cache $cache) : self |
| 13 | 13 | { |
| 14 | 14 | return new self( |
| 15 | - 'Metadata Cache uses a non-persistent cache driver, ' . get_class($cache) . '.' |
|
| 15 | + 'Metadata Cache uses a non-persistent cache driver, '.get_class($cache).'.' |
|
| 16 | 16 | ); |
| 17 | 17 | } |
| 18 | 18 | } |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | public static function fromDriver(Cache $cache) : self |
| 13 | 13 | { |
| 14 | 14 | return new self( |
| 15 | - 'Query Cache uses a non-persistent cache driver, ' . get_class($cache) . '.' |
|
| 15 | + 'Query Cache uses a non-persistent cache driver, '.get_class($cache).'.' |
|
| 16 | 16 | ); |
| 17 | 17 | } |
| 18 | 18 | } |
@@ -57,8 +57,8 @@ |
||
| 57 | 57 | */ |
| 58 | 58 | public function resolveAssociationEntries(EntityManagerInterface $em) |
| 59 | 59 | { |
| 60 | - return array_map(function ($value) use ($em) { |
|
| 61 | - if (! ($value instanceof AssociationCacheEntry)) { |
|
| 60 | + return array_map(function($value) use ($em) { |
|
| 61 | + if ( ! ($value instanceof AssociationCacheEntry)) { |
|
| 62 | 62 | return $value; |
| 63 | 63 | } |
| 64 | 64 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $metadata = $this->em->getClassMetadata($className); |
| 56 | 56 | $persister = $this->uow->getEntityPersister($metadata->getRootClassName()); |
| 57 | 57 | |
| 58 | - if (! ($persister instanceof CachedPersister)) { |
|
| 58 | + if ( ! ($persister instanceof CachedPersister)) { |
|
| 59 | 59 | return null; |
| 60 | 60 | } |
| 61 | 61 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | $metadata = $this->em->getClassMetadata($className); |
| 71 | 71 | $persister = $this->uow->getCollectionPersister($metadata->getProperty($association)); |
| 72 | 72 | |
| 73 | - if (! ($persister instanceof CachedPersister)) { |
|
| 73 | + if ( ! ($persister instanceof CachedPersister)) { |
|
| 74 | 74 | return null; |
| 75 | 75 | } |
| 76 | 76 | |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | $metadata = $this->em->getClassMetadata($className); |
| 86 | 86 | $persister = $this->uow->getEntityPersister($metadata->getRootClassName()); |
| 87 | 87 | |
| 88 | - if (! ($persister instanceof CachedPersister)) { |
|
| 88 | + if ( ! ($persister instanceof CachedPersister)) { |
|
| 89 | 89 | return false; |
| 90 | 90 | } |
| 91 | 91 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $metadata = $this->em->getClassMetadata($className); |
| 101 | 101 | $persister = $this->uow->getEntityPersister($metadata->getRootClassName()); |
| 102 | 102 | |
| 103 | - if (! ($persister instanceof CachedPersister)) { |
|
| 103 | + if ( ! ($persister instanceof CachedPersister)) { |
|
| 104 | 104 | return; |
| 105 | 105 | } |
| 106 | 106 | |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | $metadata = $this->em->getClassMetadata($className); |
| 116 | 116 | $persister = $this->uow->getEntityPersister($metadata->getRootClassName()); |
| 117 | 117 | |
| 118 | - if (! ($persister instanceof CachedPersister)) { |
|
| 118 | + if ( ! ($persister instanceof CachedPersister)) { |
|
| 119 | 119 | return; |
| 120 | 120 | } |
| 121 | 121 | |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | foreach ($metadatas as $metadata) { |
| 133 | 133 | $persister = $this->uow->getEntityPersister($metadata->getRootClassName()); |
| 134 | 134 | |
| 135 | - if (! ($persister instanceof CachedPersister)) { |
|
| 135 | + if ( ! ($persister instanceof CachedPersister)) { |
|
| 136 | 136 | continue; |
| 137 | 137 | } |
| 138 | 138 | |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | $metadata = $this->em->getClassMetadata($className); |
| 149 | 149 | $persister = $this->uow->getCollectionPersister($metadata->getProperty($association)); |
| 150 | 150 | |
| 151 | - if (! ($persister instanceof CachedPersister)) { |
|
| 151 | + if ( ! ($persister instanceof CachedPersister)) { |
|
| 152 | 152 | return false; |
| 153 | 153 | } |
| 154 | 154 | |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | $metadata = $this->em->getClassMetadata($className); |
| 164 | 164 | $persister = $this->uow->getCollectionPersister($metadata->getProperty($association)); |
| 165 | 165 | |
| 166 | - if (! ($persister instanceof CachedPersister)) { |
|
| 166 | + if ( ! ($persister instanceof CachedPersister)) { |
|
| 167 | 167 | return; |
| 168 | 168 | } |
| 169 | 169 | |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | $metadata = $this->em->getClassMetadata($className); |
| 179 | 179 | $persister = $this->uow->getCollectionPersister($metadata->getProperty($association)); |
| 180 | 180 | |
| 181 | - if (! ($persister instanceof CachedPersister)) { |
|
| 181 | + if ( ! ($persister instanceof CachedPersister)) { |
|
| 182 | 182 | return; |
| 183 | 183 | } |
| 184 | 184 | |
@@ -194,13 +194,13 @@ discard block |
||
| 194 | 194 | |
| 195 | 195 | foreach ($metadatas as $metadata) { |
| 196 | 196 | foreach ($metadata->getDeclaredPropertiesIterator() as $association) { |
| 197 | - if (! $association instanceof ToManyAssociationMetadata) { |
|
| 197 | + if ( ! $association instanceof ToManyAssociationMetadata) { |
|
| 198 | 198 | continue; |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | $persister = $this->uow->getCollectionPersister($association); |
| 202 | 202 | |
| 203 | - if (! ($persister instanceof CachedPersister)) { |
|
| 203 | + if ( ! ($persister instanceof CachedPersister)) { |
|
| 204 | 204 | continue; |
| 205 | 205 | } |
| 206 | 206 | |
@@ -251,11 +251,10 @@ discard block |
||
| 251 | 251 | public function getQueryCache($regionName = null) |
| 252 | 252 | { |
| 253 | 253 | if ($regionName === null) { |
| 254 | - return $this->defaultQueryCache ?: |
|
| 255 | - $this->defaultQueryCache = $this->cacheFactory->buildQueryCache($this->em); |
|
| 254 | + return $this->defaultQueryCache ?: $this->defaultQueryCache = $this->cacheFactory->buildQueryCache($this->em); |
|
| 256 | 255 | } |
| 257 | 256 | |
| 258 | - if (! isset($this->queryCaches[$regionName])) { |
|
| 257 | + if ( ! isset($this->queryCaches[$regionName])) { |
|
| 259 | 258 | $this->queryCaches[$regionName] = $this->cacheFactory->buildQueryCache($this->em, $regionName); |
| 260 | 259 | } |
| 261 | 260 | |
@@ -270,7 +269,7 @@ discard block |
||
| 270 | 269 | */ |
| 271 | 270 | private function buildEntityCacheKey(ClassMetadata $metadata, $identifier) |
| 272 | 271 | { |
| 273 | - if (! is_array($identifier)) { |
|
| 272 | + if ( ! is_array($identifier)) { |
|
| 274 | 273 | $identifier = $this->toIdentifierArray($metadata, $identifier); |
| 275 | 274 | } |
| 276 | 275 | |
@@ -286,7 +285,7 @@ discard block |
||
| 286 | 285 | */ |
| 287 | 286 | private function buildCollectionCacheKey(ClassMetadata $metadata, $association, $ownerIdentifier) |
| 288 | 287 | { |
| 289 | - if (! is_array($ownerIdentifier)) { |
|
| 288 | + if ( ! is_array($ownerIdentifier)) { |
|
| 290 | 289 | $ownerIdentifier = $this->toIdentifierArray($metadata, $ownerIdentifier); |
| 291 | 290 | } |
| 292 | 291 | |