@@ -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; |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | public function getParameter($key) |
324 | 324 | { |
325 | 325 | $filteredParameters = $this->parameters->filter( |
326 | - function (Query\Parameter $parameter) use ($key) : bool { |
|
326 | + function(Query\Parameter $parameter) use ($key) : bool { |
|
327 | 327 | $parameterName = $parameter->getName(); |
328 | 328 | |
329 | 329 | return $key === $parameterName || (string) $key === (string) $parameterName; |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | return $value->name; |
417 | 417 | } |
418 | 418 | |
419 | - if (! is_object($value)) { |
|
419 | + if ( ! is_object($value)) { |
|
420 | 420 | return $value; |
421 | 421 | } |
422 | 422 | |
@@ -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 | |
@@ -999,7 +999,7 @@ discard block |
||
999 | 999 | $this->getTimestampKey() |
1000 | 1000 | ); |
1001 | 1001 | |
1002 | - $result = $queryCache->get($queryKey, $rsm, $this->_hints); |
|
1002 | + $result = $queryCache->get($queryKey, $rsm, $this->_hints); |
|
1003 | 1003 | |
1004 | 1004 | if ($result !== null) { |
1005 | 1005 | if ($this->cacheLogger) { |
@@ -1135,6 +1135,6 @@ discard block |
||
1135 | 1135 | |
1136 | 1136 | ksort($hints); |
1137 | 1137 | |
1138 | - return sha1($query . '-' . serialize($params) . '-' . serialize($hints)); |
|
1138 | + return sha1($query.'-'.serialize($params).'-'.serialize($hints)); |
|
1139 | 1139 | } |
1140 | 1140 | } |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | */ |
404 | 404 | public function containsKey($key) |
405 | 405 | { |
406 | - if (! $this->initialized && $this->association['fetch'] === ClassMetadata::FETCH_EXTRA_LAZY |
|
406 | + if ( ! $this->initialized && $this->association['fetch'] === ClassMetadata::FETCH_EXTRA_LAZY |
|
407 | 407 | && isset($this->association['indexBy'])) { |
408 | 408 | $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association); |
409 | 409 | |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | && $this->association['fetch'] === ClassMetadata::FETCH_EXTRA_LAZY |
437 | 437 | && isset($this->association['indexBy']) |
438 | 438 | ) { |
439 | - if (!$this->typeClass->isIdentifierComposite && $this->typeClass->isIdentifier($this->association['indexBy'])) { |
|
439 | + if ( ! $this->typeClass->isIdentifierComposite && $this->typeClass->isIdentifier($this->association['indexBy'])) { |
|
440 | 440 | return $this->em->find($this->typeClass->name, $key); |
441 | 441 | } |
442 | 442 |
@@ -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])) { |
@@ -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) { |
@@ -38,9 +38,9 @@ |
||
38 | 38 | */ |
39 | 39 | class DefaultQueryCache implements QueryCache |
40 | 40 | { |
41 | - /** |
|
42 | - * @var \Doctrine\ORM\EntityManagerInterface |
|
43 | - */ |
|
41 | + /** |
|
42 | + * @var \Doctrine\ORM\EntityManagerInterface |
|
43 | + */ |
|
44 | 44 | private $em; |
45 | 45 | |
46 | 46 | /** |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | |
114 | 114 | $cm = $this->em->getClassMetadata($entityName); |
115 | 115 | |
116 | - $generateKeys = function (array $entry) use ($cm): EntityCacheKey { |
|
116 | + $generateKeys = function(array $entry) use ($cm): EntityCacheKey { |
|
117 | 117 | return new EntityCacheKey($cm->rootEntityName, $entry['identifier']); |
118 | 118 | }; |
119 | 119 | |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | } |
139 | 139 | |
140 | 140 | if ( ! $hasRelation) { |
141 | - $result[$index] = $this->uow->createEntity($entityEntry->class, $entityEntry->resolveAssociationEntries($this->em), self::$hints); |
|
141 | + $result[$index] = $this->uow->createEntity($entityEntry->class, $entityEntry->resolveAssociationEntries($this->em), self::$hints); |
|
142 | 142 | |
143 | 143 | continue; |
144 | 144 | } |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | continue; |
177 | 177 | } |
178 | 178 | |
179 | - $generateKeys = function ($id) use ($assocMetadata): EntityCacheKey { |
|
179 | + $generateKeys = function($id) use ($assocMetadata): EntityCacheKey { |
|
180 | 180 | return new EntityCacheKey($assocMetadata->rootEntityName, $id); |
181 | 181 | }; |
182 | 182 | |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | // root entity association |
289 | 289 | if ($rootAlias === $parentAlias) { |
290 | 290 | // Cancel put result if association put fail |
291 | - if ( ($assocInfo = $this->storeAssociationCache($key, $assoc, $assocValue)) === null) { |
|
291 | + if (($assocInfo = $this->storeAssociationCache($key, $assoc, $assocValue)) === null) { |
|
292 | 292 | return false; |
293 | 293 | } |
294 | 294 |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | |
110 | 110 | $targetAssoc = $targetClassMetadata->associationMappings[$fieldName]; |
111 | 111 | |
112 | - foreach($assoc['targetToSourceKeyColumns'] as $referencedColumn => $localColumn) { |
|
112 | + foreach ($assoc['targetToSourceKeyColumns'] as $referencedColumn => $localColumn) { |
|
113 | 113 | if (isset($targetAssoc['sourceToTargetKeyColumns'][$referencedColumn])) { |
114 | 114 | $data[$localColumn] = $fieldValue; |
115 | 115 | } |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | } |
162 | 162 | |
163 | 163 | foreach ($metadata->associationMappings as $name => $assoc) { |
164 | - if ( ! isset($assoc['cache']) || ! isset($data[$name])) { |
|
164 | + if ( ! isset($assoc['cache']) || ! isset($data[$name])) { |
|
165 | 165 | continue; |
166 | 166 | } |
167 | 167 |
@@ -56,12 +56,12 @@ |
||
56 | 56 | */ |
57 | 57 | public function entityCacheMiss($regionName, EntityCacheKey $key); |
58 | 58 | |
59 | - /** |
|
60 | - * Log an entity put into second level cache. |
|
61 | - * |
|
62 | - * @param string $regionName The name of the cache region. |
|
63 | - * @param \Doctrine\ORM\Cache\CollectionCacheKey $key The cache key of the collection. |
|
64 | - */ |
|
59 | + /** |
|
60 | + * Log an entity put into second level cache. |
|
61 | + * |
|
62 | + * @param string $regionName The name of the cache region. |
|
63 | + * @param \Doctrine\ORM\Cache\CollectionCacheKey $key The cache key of the collection. |
|
64 | + */ |
|
65 | 65 | public function collectionCachePut($regionName, CollectionCacheKey $key); |
66 | 66 | |
67 | 67 | /** |