@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | |
| 256 | 256 | // Check query cache. |
| 257 | 257 | $queryCache = $this->getQueryCacheDriver(); |
| 258 | - if (! ($this->useQueryCache && $queryCache)) { |
|
| 258 | + if ( ! ($this->useQueryCache && $queryCache)) { |
|
| 259 | 259 | $parser = new Parser($this); |
| 260 | 260 | |
| 261 | 261 | $this->parserResult = $parser->parse(); |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | $value = $parameter->getValue(); |
| 393 | 393 | $rsm = $this->getResultSetMapping(); |
| 394 | 394 | |
| 395 | - if (! isset($paramMappings[$key])) { |
|
| 395 | + if ( ! isset($paramMappings[$key])) { |
|
| 396 | 396 | throw QueryException::unknownParameter($key); |
| 397 | 397 | } |
| 398 | 398 | |
@@ -700,7 +700,7 @@ discard block |
||
| 700 | 700 | public function setLockMode($lockMode) |
| 701 | 701 | { |
| 702 | 702 | if (in_array($lockMode, [LockMode::NONE, LockMode::PESSIMISTIC_READ, LockMode::PESSIMISTIC_WRITE], true)) { |
| 703 | - if (! $this->em->getConnection()->isTransactionActive()) { |
|
| 703 | + if ( ! $this->em->getConnection()->isTransactionActive()) { |
|
| 704 | 704 | throw TransactionRequired::new(); |
| 705 | 705 | } |
| 706 | 706 | } |
@@ -741,11 +741,11 @@ discard block |
||
| 741 | 741 | ->getName(); |
| 742 | 742 | |
| 743 | 743 | return md5( |
| 744 | - $this->getDQL() . serialize($this->hints) . |
|
| 745 | - '&platform=' . $platform . |
|
| 746 | - ($this->em->hasFilters() ? $this->em->getFilters()->getHash() : '') . |
|
| 747 | - '&firstResult=' . $this->firstResult . '&maxResult=' . $this->maxResults . |
|
| 748 | - '&hydrationMode=' . $this->hydrationMode . '&types=' . serialize($this->parsedTypes) . 'DOCTRINE_QUERY_CACHE_SALT' |
|
| 744 | + $this->getDQL().serialize($this->hints). |
|
| 745 | + '&platform='.$platform. |
|
| 746 | + ($this->em->hasFilters() ? $this->em->getFilters()->getHash() : ''). |
|
| 747 | + '&firstResult='.$this->firstResult.'&maxResult='.$this->maxResults. |
|
| 748 | + '&hydrationMode='.$this->hydrationMode.'&types='.serialize($this->parsedTypes).'DOCTRINE_QUERY_CACHE_SALT' |
|
| 749 | 749 | ); |
| 750 | 750 | } |
| 751 | 751 | |
@@ -754,7 +754,7 @@ discard block |
||
| 754 | 754 | */ |
| 755 | 755 | protected function getHash() |
| 756 | 756 | { |
| 757 | - return sha1(parent::getHash() . '-' . $this->firstResult . '-' . $this->maxResults); |
|
| 757 | + return sha1(parent::getHash().'-'.$this->firstResult.'-'.$this->maxResults); |
|
| 758 | 758 | } |
| 759 | 759 | |
| 760 | 760 | /** |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | */ |
| 55 | 55 | public function generateProxyClasses(array $classes) : int |
| 56 | 56 | { |
| 57 | - $concreteClasses = array_filter($classes, function (ClassMetadata $metadata) : bool { |
|
| 57 | + $concreteClasses = array_filter($classes, function(ClassMetadata $metadata) : bool { |
|
| 58 | 58 | return ! ($metadata->isMappedSuperclass || $metadata->getReflectionClass()->isAbstract()); |
| 59 | 59 | }); |
| 60 | 60 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | ->proxyFactory |
| 64 | 64 | ->createProxy( |
| 65 | 65 | $metadata->getClassName(), |
| 66 | - function () { |
|
| 66 | + function() { |
|
| 67 | 67 | // empty closure, serves its purpose, for now |
| 68 | 68 | }, |
| 69 | 69 | $this->skippedFieldsFqns($metadata) |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | ->getUnitOfWork() |
| 88 | 88 | ->getEntityPersister($metadata->getClassName()); |
| 89 | 89 | |
| 90 | - $proxyInstance = $this |
|
| 90 | + $proxyInstance = $this |
|
| 91 | 91 | ->proxyFactory |
| 92 | 92 | ->createProxy( |
| 93 | 93 | $metadata->getClassName(), |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | private function makeInitializer(ClassMetadata $metadata, EntityPersister $persister) : \Closure |
| 108 | 108 | { |
| 109 | - return function ( |
|
| 109 | + return function( |
|
| 110 | 110 | GhostObjectInterface $ghostObject, |
| 111 | 111 | string $method, |
| 112 | 112 | // we don't care |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | $identifier = $persister->getIdentifier($ghostObject); |
| 125 | 125 | |
| 126 | 126 | // @TODO how do we use `$properties` in the persister? That would be a massive optimisation |
| 127 | - if (! $persister->loadById($identifier, $ghostObject)) { |
|
| 127 | + if ( ! $persister->loadById($identifier, $ghostObject)) { |
|
| 128 | 128 | $initializer = $originalInitializer; |
| 129 | 129 | |
| 130 | 130 | throw EntityNotFound::fromClassNameAndIdentifier( |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | $transientFieldsFqns = []; |
| 157 | 157 | |
| 158 | 158 | foreach ($metadata->getDeclaredPropertiesIterator() as $name => $property) { |
| 159 | - if (! $property instanceof TransientMetadata) { |
|
| 159 | + if ( ! $property instanceof TransientMetadata) { |
|
| 160 | 160 | continue; |
| 161 | 161 | } |
| 162 | 162 | |
@@ -194,11 +194,11 @@ discard block |
||
| 194 | 194 | private function propertyFqcn(\ReflectionProperty $property) : string |
| 195 | 195 | { |
| 196 | 196 | if ($property->isPrivate()) { |
| 197 | - return "\0" . $property->getDeclaringClass()->getName() . "\0" . $property->getName(); |
|
| 197 | + return "\0".$property->getDeclaringClass()->getName()."\0".$property->getName(); |
|
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | if ($property->isProtected()) { |
| 201 | - return "\0*\0" . $property->getName(); |
|
| 201 | + return "\0*\0".$property->getName(); |
|
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | return $property->getName(); |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | */ |
| 161 | 161 | public function newDefaultAnnotationDriver(array $paths = []) : AnnotationDriver |
| 162 | 162 | { |
| 163 | - AnnotationRegistry::registerFile(__DIR__ . '/Annotation/DoctrineAnnotations.php'); |
|
| 163 | + AnnotationRegistry::registerFile(__DIR__.'/Annotation/DoctrineAnnotations.php'); |
|
| 164 | 164 | |
| 165 | 165 | $reader = new CachedReader(new AnnotationReader(), new ArrayCache()); |
| 166 | 166 | |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | { |
| 235 | 235 | $queryCacheImpl = $this->getQueryCacheImpl(); |
| 236 | 236 | |
| 237 | - if (! $queryCacheImpl) { |
|
| 237 | + if ( ! $queryCacheImpl) { |
|
| 238 | 238 | throw QueryCacheNotConfigured::new(); |
| 239 | 239 | } |
| 240 | 240 | |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | |
| 245 | 245 | $metadataCacheImpl = $this->getMetadataCacheImpl(); |
| 246 | 246 | |
| 247 | - if (! $metadataCacheImpl) { |
|
| 247 | + if ( ! $metadataCacheImpl) { |
|
| 248 | 248 | throw MetadataCacheNotConfigured::new(); |
| 249 | 249 | } |
| 250 | 250 | |
@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | { |
| 453 | 453 | $reflectionClass = new \ReflectionClass($repositoryClassName); |
| 454 | 454 | |
| 455 | - if (! $reflectionClass->implementsInterface(ObjectRepository::class)) { |
|
| 455 | + if ( ! $reflectionClass->implementsInterface(ObjectRepository::class)) { |
|
| 456 | 456 | throw InvalidEntityRepository::fromClassName($repositoryClassName); |
| 457 | 457 | } |
| 458 | 458 | |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | public function getParameter($key) |
| 304 | 304 | { |
| 305 | 305 | $filteredParameters = $this->parameters->filter( |
| 306 | - function (Query\Parameter $parameter) use ($key) : bool { |
|
| 306 | + function(Query\Parameter $parameter) use ($key) : bool { |
|
| 307 | 307 | $parameterName = $parameter->getName(); |
| 308 | 308 | |
| 309 | 309 | return $key === $parameterName || (string) $key === (string) $parameterName; |
@@ -719,7 +719,7 @@ discard block |
||
| 719 | 719 | return null; |
| 720 | 720 | } |
| 721 | 721 | |
| 722 | - if (! is_array($result)) { |
|
| 722 | + if ( ! is_array($result)) { |
|
| 723 | 723 | return $result; |
| 724 | 724 | } |
| 725 | 725 | |
@@ -753,7 +753,7 @@ discard block |
||
| 753 | 753 | throw new NoResult(); |
| 754 | 754 | } |
| 755 | 755 | |
| 756 | - if (! is_array($result)) { |
|
| 756 | + if ( ! is_array($result)) { |
|
| 757 | 757 | return $result; |
| 758 | 758 | } |
| 759 | 759 | |
@@ -843,7 +843,7 @@ discard block |
||
| 843 | 843 | $this->setHydrationMode($hydrationMode); |
| 844 | 844 | } |
| 845 | 845 | |
| 846 | - if (! empty($parameters)) { |
|
| 846 | + if ( ! empty($parameters)) { |
|
| 847 | 847 | $this->setParameters($parameters); |
| 848 | 848 | } |
| 849 | 849 | |
@@ -882,11 +882,11 @@ discard block |
||
| 882 | 882 | $this->setHydrationMode($hydrationMode); |
| 883 | 883 | } |
| 884 | 884 | |
| 885 | - if (! empty($parameters)) { |
|
| 885 | + if ( ! empty($parameters)) { |
|
| 886 | 886 | $this->setParameters($parameters); |
| 887 | 887 | } |
| 888 | 888 | |
| 889 | - $setCacheEntry = function () { |
|
| 889 | + $setCacheEntry = function() { |
|
| 890 | 890 | }; |
| 891 | 891 | |
| 892 | 892 | if ($this->hydrationCacheProfile !== null) { |
@@ -900,11 +900,11 @@ discard block |
||
| 900 | 900 | return $result[$realCacheKey]; |
| 901 | 901 | } |
| 902 | 902 | |
| 903 | - if (! $result) { |
|
| 903 | + if ( ! $result) { |
|
| 904 | 904 | $result = []; |
| 905 | 905 | } |
| 906 | 906 | |
| 907 | - $setCacheEntry = function ($data) use ($cache, $result, $cacheKey, $realCacheKey, $queryCacheProfile) { |
|
| 907 | + $setCacheEntry = function($data) use ($cache, $result, $cacheKey, $realCacheKey, $queryCacheProfile) { |
|
| 908 | 908 | $result[$realCacheKey] = $data; |
| 909 | 909 | |
| 910 | 910 | $cache->save($cacheKey, $result, $queryCacheProfile->getLifetime()); |
@@ -1066,7 +1066,7 @@ discard block |
||
| 1066 | 1066 | { |
| 1067 | 1067 | $query = $this->getSQL(); |
| 1068 | 1068 | $hints = $this->getHints(); |
| 1069 | - $params = array_map(function (Parameter $parameter) { |
|
| 1069 | + $params = array_map(function(Parameter $parameter) { |
|
| 1070 | 1070 | $value = $parameter->getValue(); |
| 1071 | 1071 | |
| 1072 | 1072 | // Small optimization |
@@ -1080,6 +1080,6 @@ discard block |
||
| 1080 | 1080 | |
| 1081 | 1081 | ksort($hints); |
| 1082 | 1082 | |
| 1083 | - return sha1($query . '-' . serialize($params) . '-' . serialize($hints)); |
|
| 1083 | + return sha1($query.'-'.serialize($params).'-'.serialize($hints)); |
|
| 1084 | 1084 | } |
| 1085 | 1085 | } |