@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | |
255 | 255 | // Check query cache. |
256 | 256 | $queryCache = $this->getQueryCacheDriver(); |
257 | - if (! ($this->useQueryCache && $queryCache)) { |
|
257 | + if ( ! ($this->useQueryCache && $queryCache)) { |
|
258 | 258 | $parser = new Parser($this); |
259 | 259 | |
260 | 260 | $this->parserResult = $parser->parse(); |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | $value = $parameter->getValue(); |
392 | 392 | $rsm = $this->getResultSetMapping(); |
393 | 393 | |
394 | - if (! isset($paramMappings[$key])) { |
|
394 | + if ( ! isset($paramMappings[$key])) { |
|
395 | 395 | throw QueryException::unknownParameter($key); |
396 | 396 | } |
397 | 397 | |
@@ -699,7 +699,7 @@ discard block |
||
699 | 699 | public function setLockMode($lockMode) |
700 | 700 | { |
701 | 701 | if (in_array($lockMode, [LockMode::NONE, LockMode::PESSIMISTIC_READ, LockMode::PESSIMISTIC_WRITE], true)) { |
702 | - if (! $this->em->getConnection()->isTransactionActive()) { |
|
702 | + if ( ! $this->em->getConnection()->isTransactionActive()) { |
|
703 | 703 | throw TransactionRequiredException::transactionRequired(); |
704 | 704 | } |
705 | 705 | } |
@@ -740,11 +740,11 @@ discard block |
||
740 | 740 | ->getName(); |
741 | 741 | |
742 | 742 | return md5( |
743 | - $this->getDQL() . serialize($this->hints) . |
|
744 | - '&platform=' . $platform . |
|
745 | - ($this->em->hasFilters() ? $this->em->getFilters()->getHash() : '') . |
|
746 | - '&firstResult=' . $this->firstResult . '&maxResult=' . $this->maxResults . |
|
747 | - '&hydrationMode=' . $this->hydrationMode . '&types=' . serialize($this->parsedTypes) . 'DOCTRINE_QUERY_CACHE_SALT' |
|
743 | + $this->getDQL().serialize($this->hints). |
|
744 | + '&platform='.$platform. |
|
745 | + ($this->em->hasFilters() ? $this->em->getFilters()->getHash() : ''). |
|
746 | + '&firstResult='.$this->firstResult.'&maxResult='.$this->maxResults. |
|
747 | + '&hydrationMode='.$this->hydrationMode.'&types='.serialize($this->parsedTypes).'DOCTRINE_QUERY_CACHE_SALT' |
|
748 | 748 | ); |
749 | 749 | } |
750 | 750 | |
@@ -753,7 +753,7 @@ discard block |
||
753 | 753 | */ |
754 | 754 | protected function getHash() |
755 | 755 | { |
756 | - return sha1(parent::getHash() . '-' . $this->firstResult . '-' . $this->maxResults); |
|
756 | + return sha1(parent::getHash().'-'.$this->firstResult.'-'.$this->maxResults); |
|
757 | 757 | } |
758 | 758 | |
759 | 759 | /** |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | public function getParameter($key) |
301 | 301 | { |
302 | 302 | $filteredParameters = $this->parameters->filter( |
303 | - function (Query\Parameter $parameter) use ($key) : bool { |
|
303 | + function(Query\Parameter $parameter) use ($key) : bool { |
|
304 | 304 | $parameterName = $parameter->getName(); |
305 | 305 | |
306 | 306 | return $key === $parameterName || (string) $key === (string) $parameterName; |
@@ -716,7 +716,7 @@ discard block |
||
716 | 716 | return null; |
717 | 717 | } |
718 | 718 | |
719 | - if (! is_array($result)) { |
|
719 | + if ( ! is_array($result)) { |
|
720 | 720 | return $result; |
721 | 721 | } |
722 | 722 | |
@@ -750,7 +750,7 @@ discard block |
||
750 | 750 | throw new NoResultException(); |
751 | 751 | } |
752 | 752 | |
753 | - if (! is_array($result)) { |
|
753 | + if ( ! is_array($result)) { |
|
754 | 754 | return $result; |
755 | 755 | } |
756 | 756 | |
@@ -840,7 +840,7 @@ discard block |
||
840 | 840 | $this->setHydrationMode($hydrationMode); |
841 | 841 | } |
842 | 842 | |
843 | - if (! empty($parameters)) { |
|
843 | + if ( ! empty($parameters)) { |
|
844 | 844 | $this->setParameters($parameters); |
845 | 845 | } |
846 | 846 | |
@@ -879,11 +879,11 @@ discard block |
||
879 | 879 | $this->setHydrationMode($hydrationMode); |
880 | 880 | } |
881 | 881 | |
882 | - if (! empty($parameters)) { |
|
882 | + if ( ! empty($parameters)) { |
|
883 | 883 | $this->setParameters($parameters); |
884 | 884 | } |
885 | 885 | |
886 | - $setCacheEntry = function () { |
|
886 | + $setCacheEntry = function() { |
|
887 | 887 | }; |
888 | 888 | |
889 | 889 | if ($this->hydrationCacheProfile !== null) { |
@@ -897,11 +897,11 @@ discard block |
||
897 | 897 | return $result[$realCacheKey]; |
898 | 898 | } |
899 | 899 | |
900 | - if (! $result) { |
|
900 | + if ( ! $result) { |
|
901 | 901 | $result = []; |
902 | 902 | } |
903 | 903 | |
904 | - $setCacheEntry = function ($data) use ($cache, $result, $cacheKey, $realCacheKey, $queryCacheProfile) { |
|
904 | + $setCacheEntry = function($data) use ($cache, $result, $cacheKey, $realCacheKey, $queryCacheProfile) { |
|
905 | 905 | $result[$realCacheKey] = $data; |
906 | 906 | |
907 | 907 | $cache->save($cacheKey, $result, $queryCacheProfile->getLifetime()); |
@@ -1063,7 +1063,7 @@ discard block |
||
1063 | 1063 | { |
1064 | 1064 | $query = $this->getSQL(); |
1065 | 1065 | $hints = $this->getHints(); |
1066 | - $params = array_map(function (Parameter $parameter) { |
|
1066 | + $params = array_map(function(Parameter $parameter) { |
|
1067 | 1067 | $value = $parameter->getValue(); |
1068 | 1068 | |
1069 | 1069 | // Small optimization |
@@ -1077,6 +1077,6 @@ discard block |
||
1077 | 1077 | |
1078 | 1078 | ksort($hints); |
1079 | 1079 | |
1080 | - return sha1($query . '-' . serialize($params) . '-' . serialize($hints)); |
|
1080 | + return sha1($query.'-'.serialize($params).'-'.serialize($hints)); |
|
1081 | 1081 | } |
1082 | 1082 | } |
@@ -2,44 +2,44 @@ |
||
2 | 2 | |
3 | 3 | declare(strict_types=1); |
4 | 4 | |
5 | -require_once __DIR__ . '/Annotation.php'; |
|
6 | -require_once __DIR__ . '/AssociationOverride.php'; |
|
7 | -require_once __DIR__ . '/AssociationOverrides.php'; |
|
8 | -require_once __DIR__ . '/AttributeOverride.php'; |
|
9 | -require_once __DIR__ . '/AttributeOverrides.php'; |
|
10 | -require_once __DIR__ . '/Cache.php'; |
|
11 | -require_once __DIR__ . '/ChangeTrackingPolicy.php'; |
|
12 | -require_once __DIR__ . '/Column.php'; |
|
13 | -require_once __DIR__ . '/CustomIdGenerator.php'; |
|
14 | -require_once __DIR__ . '/DiscriminatorColumn.php'; |
|
15 | -require_once __DIR__ . '/DiscriminatorMap.php'; |
|
16 | -require_once __DIR__ . '/Embeddable.php'; |
|
17 | -require_once __DIR__ . '/Embedded.php'; |
|
18 | -require_once __DIR__ . '/Entity.php'; |
|
19 | -require_once __DIR__ . '/EntityListeners.php'; |
|
20 | -require_once __DIR__ . '/GeneratedValue.php'; |
|
21 | -require_once __DIR__ . '/HasLifecycleCallbacks.php'; |
|
22 | -require_once __DIR__ . '/Id.php'; |
|
23 | -require_once __DIR__ . '/Index.php'; |
|
24 | -require_once __DIR__ . '/InheritanceType.php'; |
|
25 | -require_once __DIR__ . '/JoinColumn.php'; |
|
26 | -require_once __DIR__ . '/JoinColumns.php'; |
|
27 | -require_once __DIR__ . '/JoinTable.php'; |
|
28 | -require_once __DIR__ . '/ManyToMany.php'; |
|
29 | -require_once __DIR__ . '/ManyToOne.php'; |
|
30 | -require_once __DIR__ . '/MappedSuperclass.php'; |
|
31 | -require_once __DIR__ . '/OneToMany.php'; |
|
32 | -require_once __DIR__ . '/OneToOne.php'; |
|
33 | -require_once __DIR__ . '/OrderBy.php'; |
|
34 | -require_once __DIR__ . '/PrePersist.php'; |
|
35 | -require_once __DIR__ . '/PostLoad.php'; |
|
36 | -require_once __DIR__ . '/PostPersist.php'; |
|
37 | -require_once __DIR__ . '/PostRemove.php'; |
|
38 | -require_once __DIR__ . '/PostUpdate.php'; |
|
39 | -require_once __DIR__ . '/PreFlush.php'; |
|
40 | -require_once __DIR__ . '/PreRemove.php'; |
|
41 | -require_once __DIR__ . '/PreUpdate.php'; |
|
42 | -require_once __DIR__ . '/SequenceGenerator.php'; |
|
43 | -require_once __DIR__ . '/Table.php'; |
|
44 | -require_once __DIR__ . '/UniqueConstraint.php'; |
|
45 | -require_once __DIR__ . '/Version.php'; |
|
5 | +require_once __DIR__.'/Annotation.php'; |
|
6 | +require_once __DIR__.'/AssociationOverride.php'; |
|
7 | +require_once __DIR__.'/AssociationOverrides.php'; |
|
8 | +require_once __DIR__.'/AttributeOverride.php'; |
|
9 | +require_once __DIR__.'/AttributeOverrides.php'; |
|
10 | +require_once __DIR__.'/Cache.php'; |
|
11 | +require_once __DIR__.'/ChangeTrackingPolicy.php'; |
|
12 | +require_once __DIR__.'/Column.php'; |
|
13 | +require_once __DIR__.'/CustomIdGenerator.php'; |
|
14 | +require_once __DIR__.'/DiscriminatorColumn.php'; |
|
15 | +require_once __DIR__.'/DiscriminatorMap.php'; |
|
16 | +require_once __DIR__.'/Embeddable.php'; |
|
17 | +require_once __DIR__.'/Embedded.php'; |
|
18 | +require_once __DIR__.'/Entity.php'; |
|
19 | +require_once __DIR__.'/EntityListeners.php'; |
|
20 | +require_once __DIR__.'/GeneratedValue.php'; |
|
21 | +require_once __DIR__.'/HasLifecycleCallbacks.php'; |
|
22 | +require_once __DIR__.'/Id.php'; |
|
23 | +require_once __DIR__.'/Index.php'; |
|
24 | +require_once __DIR__.'/InheritanceType.php'; |
|
25 | +require_once __DIR__.'/JoinColumn.php'; |
|
26 | +require_once __DIR__.'/JoinColumns.php'; |
|
27 | +require_once __DIR__.'/JoinTable.php'; |
|
28 | +require_once __DIR__.'/ManyToMany.php'; |
|
29 | +require_once __DIR__.'/ManyToOne.php'; |
|
30 | +require_once __DIR__.'/MappedSuperclass.php'; |
|
31 | +require_once __DIR__.'/OneToMany.php'; |
|
32 | +require_once __DIR__.'/OneToOne.php'; |
|
33 | +require_once __DIR__.'/OrderBy.php'; |
|
34 | +require_once __DIR__.'/PrePersist.php'; |
|
35 | +require_once __DIR__.'/PostLoad.php'; |
|
36 | +require_once __DIR__.'/PostPersist.php'; |
|
37 | +require_once __DIR__.'/PostRemove.php'; |
|
38 | +require_once __DIR__.'/PostUpdate.php'; |
|
39 | +require_once __DIR__.'/PreFlush.php'; |
|
40 | +require_once __DIR__.'/PreRemove.php'; |
|
41 | +require_once __DIR__.'/PreUpdate.php'; |
|
42 | +require_once __DIR__.'/SequenceGenerator.php'; |
|
43 | +require_once __DIR__.'/Table.php'; |
|
44 | +require_once __DIR__.'/UniqueConstraint.php'; |
|
45 | +require_once __DIR__.'/Version.php'; |
@@ -77,6 +77,6 @@ |
||
77 | 77 | */ |
78 | 78 | public function valid() |
79 | 79 | { |
80 | - return $this->current!==false; |
|
80 | + return $this->current !== false; |
|
81 | 81 | } |
82 | 82 | } |
@@ -40,9 +40,9 @@ |
||
40 | 40 | */ |
41 | 41 | public static function emptyDiscriminatorValue($dqlAlias) |
42 | 42 | { |
43 | - return new self("The DQL alias '" . $dqlAlias . "' contains an entity " . |
|
44 | - 'of an inheritance hierarchy with an empty discriminator value. This means ' . |
|
45 | - 'that the database contains inconsistent data with an empty ' . |
|
43 | + return new self("The DQL alias '".$dqlAlias."' contains an entity ". |
|
44 | + 'of an inheritance hierarchy with an empty discriminator value. This means '. |
|
45 | + 'that the database contains inconsistent data with an empty '. |
|
46 | 46 | 'discriminator value in a table row.'); |
47 | 47 | } |
48 | 48 |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $discrColumnName = $metaMappingDiscrColumnName; |
84 | 84 | } |
85 | 85 | |
86 | - if (! isset($sqlResult[$discrColumnName])) { |
|
86 | + if ( ! isset($sqlResult[$discrColumnName])) { |
|
87 | 87 | throw HydrationException::missingDiscriminatorColumn($entityName, $discrColumnName, key($this->rsm->aliasMap)); |
88 | 88 | } |
89 | 89 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | |
94 | 94 | $discrMap = $this->class->discriminatorMap; |
95 | 95 | |
96 | - if (! isset($discrMap[$sqlResult[$discrColumnName]])) { |
|
96 | + if ( ! isset($discrMap[$sqlResult[$discrColumnName]])) { |
|
97 | 97 | throw HydrationException::invalidDiscriminatorValue($sqlResult[$discrColumnName], array_keys($discrMap)); |
98 | 98 | } |
99 | 99 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | $cacheKeyInfo = $this->hydrateColumnInfo($column); |
112 | 112 | |
113 | - if (! $cacheKeyInfo) { |
|
113 | + if ( ! $cacheKeyInfo) { |
|
114 | 114 | continue; |
115 | 115 | } |
116 | 116 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | $fieldName = $cacheKeyInfo['fieldName']; |
127 | 127 | |
128 | 128 | // Prevent overwrite in case of inherit classes using same property name (See AbstractHydrator) |
129 | - if (! isset($data[$fieldName]) || ! $valueIsNull) { |
|
129 | + if ( ! isset($data[$fieldName]) || ! $valueIsNull) { |
|
130 | 130 | $data[$fieldName] = $value; |
131 | 131 | } |
132 | 132 | } |
@@ -78,7 +78,7 @@ |
||
78 | 78 | |
79 | 79 | public function getNamingStrategy() : NamingStrategy |
80 | 80 | { |
81 | - if (! $this->namingStrategy) { |
|
81 | + if ( ! $this->namingStrategy) { |
|
82 | 82 | $this->namingStrategy = new DefaultNamingStrategy(); |
83 | 83 | } |
84 | 84 |
@@ -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::create(); |
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::create(); |
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 |
@@ -11,7 +11,7 @@ |
||
11 | 11 | public static function fromClassName(string $className) : self |
12 | 12 | { |
13 | 13 | return new self( |
14 | - "Invalid repository class '" . $className . "'. It must be a " . ObjectRepository::class . '.' |
|
14 | + "Invalid repository class '".$className."'. It must be a ".ObjectRepository::class.'.' |
|
15 | 15 | ); |
16 | 16 | } |
17 | 17 | } |