@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Reflection; |
6 | 6 | |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | public function getClassShortName(string $className) : string |
24 | 24 | { |
25 | 25 | if (strpos($className, '\\') !== false) { |
26 | - $className = substr($className, strrpos($className, '\\')+1); |
|
26 | + $className = substr($className, strrpos($className, '\\') + 1); |
|
27 | 27 | } |
28 | 28 | return $className; |
29 | 29 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $namespace = ''; |
37 | 37 | |
38 | 38 | if (strpos($className, '\\') !== false) { |
39 | - $namespace = strrev(substr(strrev($className), strpos(strrev($className), '\\')+1)); |
|
39 | + $namespace = strrev(substr(strrev($className), strpos(strrev($className), '\\') + 1)); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | return $namespace; |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Cache; |
6 | 6 | |
@@ -42,6 +42,6 @@ discard block |
||
42 | 42 | $this->ownerIdentifier = $ownerIdentifier; |
43 | 43 | $this->entityClass = (string) $entityClass; |
44 | 44 | $this->association = (string) $association; |
45 | - $this->hash = str_replace('\\', '.', strtolower($entityClass)) . '_' . implode(' ', $ownerIdentifier) . '__' . $association; |
|
45 | + $this->hash = str_replace('\\', '.', strtolower($entityClass)).'_'.implode(' ', $ownerIdentifier).'__'.$association; |
|
46 | 46 | } |
47 | 47 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Cache; |
6 | 6 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $metadata = $this->em->getClassMetadata($className); |
63 | 63 | $persister = $this->uow->getEntityPersister($metadata->getRootClassName()); |
64 | 64 | |
65 | - if (! ($persister instanceof CachedPersister)) { |
|
65 | + if ( ! ($persister instanceof CachedPersister)) { |
|
66 | 66 | return null; |
67 | 67 | } |
68 | 68 | |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $metadata = $this->em->getClassMetadata($className); |
78 | 78 | $persister = $this->uow->getCollectionPersister($metadata->getProperty($association)); |
79 | 79 | |
80 | - if (! ($persister instanceof CachedPersister)) { |
|
80 | + if ( ! ($persister instanceof CachedPersister)) { |
|
81 | 81 | return null; |
82 | 82 | } |
83 | 83 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | $metadata = $this->em->getClassMetadata($className); |
93 | 93 | $persister = $this->uow->getEntityPersister($metadata->getRootClassName()); |
94 | 94 | |
95 | - if (! ($persister instanceof CachedPersister)) { |
|
95 | + if ( ! ($persister instanceof CachedPersister)) { |
|
96 | 96 | return false; |
97 | 97 | } |
98 | 98 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | $metadata = $this->em->getClassMetadata($className); |
108 | 108 | $persister = $this->uow->getEntityPersister($metadata->getRootClassName()); |
109 | 109 | |
110 | - if (! ($persister instanceof CachedPersister)) { |
|
110 | + if ( ! ($persister instanceof CachedPersister)) { |
|
111 | 111 | return; |
112 | 112 | } |
113 | 113 | |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $metadata = $this->em->getClassMetadata($className); |
123 | 123 | $persister = $this->uow->getEntityPersister($metadata->getRootClassName()); |
124 | 124 | |
125 | - if (! ($persister instanceof CachedPersister)) { |
|
125 | + if ( ! ($persister instanceof CachedPersister)) { |
|
126 | 126 | return; |
127 | 127 | } |
128 | 128 | |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | foreach ($metadatas as $metadata) { |
140 | 140 | $persister = $this->uow->getEntityPersister($metadata->getRootClassName()); |
141 | 141 | |
142 | - if (! ($persister instanceof CachedPersister)) { |
|
142 | + if ( ! ($persister instanceof CachedPersister)) { |
|
143 | 143 | continue; |
144 | 144 | } |
145 | 145 | |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $metadata = $this->em->getClassMetadata($className); |
156 | 156 | $persister = $this->uow->getCollectionPersister($metadata->getProperty($association)); |
157 | 157 | |
158 | - if (! ($persister instanceof CachedPersister)) { |
|
158 | + if ( ! ($persister instanceof CachedPersister)) { |
|
159 | 159 | return false; |
160 | 160 | } |
161 | 161 | |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | $metadata = $this->em->getClassMetadata($className); |
171 | 171 | $persister = $this->uow->getCollectionPersister($metadata->getProperty($association)); |
172 | 172 | |
173 | - if (! ($persister instanceof CachedPersister)) { |
|
173 | + if ( ! ($persister instanceof CachedPersister)) { |
|
174 | 174 | return; |
175 | 175 | } |
176 | 176 | |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | $metadata = $this->em->getClassMetadata($className); |
186 | 186 | $persister = $this->uow->getCollectionPersister($metadata->getProperty($association)); |
187 | 187 | |
188 | - if (! ($persister instanceof CachedPersister)) { |
|
188 | + if ( ! ($persister instanceof CachedPersister)) { |
|
189 | 189 | return; |
190 | 190 | } |
191 | 191 | |
@@ -201,13 +201,13 @@ discard block |
||
201 | 201 | |
202 | 202 | foreach ($metadatas as $metadata) { |
203 | 203 | foreach ($metadata->getDeclaredPropertiesIterator() as $association) { |
204 | - if (! $association instanceof ToManyAssociationMetadata) { |
|
204 | + if ( ! $association instanceof ToManyAssociationMetadata) { |
|
205 | 205 | continue; |
206 | 206 | } |
207 | 207 | |
208 | 208 | $persister = $this->uow->getCollectionPersister($association); |
209 | 209 | |
210 | - if (! ($persister instanceof CachedPersister)) { |
|
210 | + if ( ! ($persister instanceof CachedPersister)) { |
|
211 | 211 | continue; |
212 | 212 | } |
213 | 213 | |
@@ -258,11 +258,10 @@ discard block |
||
258 | 258 | public function getQueryCache($regionName = null) |
259 | 259 | { |
260 | 260 | if ($regionName === null) { |
261 | - return $this->defaultQueryCache ?: |
|
262 | - $this->defaultQueryCache = $this->cacheFactory->buildQueryCache($this->em); |
|
261 | + return $this->defaultQueryCache ?: $this->defaultQueryCache = $this->cacheFactory->buildQueryCache($this->em); |
|
263 | 262 | } |
264 | 263 | |
265 | - if (! isset($this->queryCaches[$regionName])) { |
|
264 | + if ( ! isset($this->queryCaches[$regionName])) { |
|
266 | 265 | $this->queryCaches[$regionName] = $this->cacheFactory->buildQueryCache($this->em, $regionName); |
267 | 266 | } |
268 | 267 | |
@@ -277,7 +276,7 @@ discard block |
||
277 | 276 | */ |
278 | 277 | private function buildEntityCacheKey(ClassMetadata $metadata, $identifier) |
279 | 278 | { |
280 | - if (! is_array($identifier)) { |
|
279 | + if ( ! is_array($identifier)) { |
|
281 | 280 | $identifier = $this->toIdentifierArray($metadata, $identifier); |
282 | 281 | } |
283 | 282 | |
@@ -293,7 +292,7 @@ discard block |
||
293 | 292 | */ |
294 | 293 | private function buildCollectionCacheKey(ClassMetadata $metadata, $association, $ownerIdentifier) |
295 | 294 | { |
296 | - if (! is_array($ownerIdentifier)) { |
|
295 | + if ( ! is_array($ownerIdentifier)) { |
|
297 | 296 | $ownerIdentifier = $this->toIdentifierArray($metadata, $ownerIdentifier); |
298 | 297 | } |
299 | 298 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Cache; |
6 | 6 | |
@@ -54,11 +54,11 @@ discard block |
||
54 | 54 | $data = array_merge($data, $persister->getIdentifier($entity)); // why update has no identifier values ? |
55 | 55 | |
56 | 56 | foreach ($metadata->getDeclaredPropertiesIterator() as $name => $association) { |
57 | - if (! isset($data[$name]) || $association instanceof FieldMetadata) { |
|
57 | + if ( ! isset($data[$name]) || $association instanceof FieldMetadata) { |
|
58 | 58 | continue; |
59 | 59 | } |
60 | 60 | |
61 | - if (! $association instanceof ToOneAssociationMetadata) { |
|
61 | + if ( ! $association instanceof ToOneAssociationMetadata) { |
|
62 | 62 | unset($data[$name]); |
63 | 63 | |
64 | 64 | continue; |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $targetClassMetadata = $this->em->getClassMetadata($targetEntity); |
69 | 69 | $targetPersister = $this->uow->getEntityPersister($targetEntity); |
70 | 70 | |
71 | - if (! $association->getCache()) { |
|
71 | + if ( ! $association->getCache()) { |
|
72 | 72 | $owningAssociation = ! $association->isOwningSide() |
73 | 73 | ? $targetClassMetadata->getProperty($association->getMappedBy()) |
74 | 74 | : $association; |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | continue; |
117 | 117 | } |
118 | 118 | |
119 | - if (! $association->isPrimaryKey()) { |
|
119 | + if ( ! $association->isPrimaryKey()) { |
|
120 | 120 | $targetClass = StaticClassNameConverter::getClass($data[$name]); |
121 | 121 | $targetId = $this->uow->getEntityIdentifier($data[$name]); |
122 | 122 | $data[$name] = new AssociationCacheEntry($targetClass, $targetId); |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | ($association instanceof OneToOneAssociationMetadata && ! $association->isOwningSide()) |
166 | 166 | ); |
167 | 167 | |
168 | - if (! $isEagerLoad) { |
|
168 | + if ( ! $isEagerLoad) { |
|
169 | 169 | $data[$name] = $this->em->getReference($assocClass, $assocId); |
170 | 170 | |
171 | 171 | continue; |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Cache; |
6 | 6 | |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public function resolveAssociationEntries(EntityManagerInterface $em) |
58 | 58 | { |
59 | - return array_map(function ($value) use ($em) { |
|
60 | - if (! ($value instanceof AssociationCacheEntry)) { |
|
59 | + return array_map(function($value) use ($em) { |
|
60 | + if ( ! ($value instanceof AssociationCacheEntry)) { |
|
61 | 61 | return $value; |
62 | 62 | } |
63 | 63 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Cache\Persister\Entity; |
6 | 6 | |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | ? $this->persister->expandCriteriaParameters($criteria) |
278 | 278 | : $this->persister->expandParameters($criteria); |
279 | 279 | |
280 | - return sha1($query . serialize($params) . serialize($orderBy) . $limit . $offset); |
|
280 | + return sha1($query.serialize($params).serialize($orderBy).$limit.$offset); |
|
281 | 281 | } |
282 | 282 | |
283 | 283 | /** |
@@ -575,7 +575,7 @@ discard block |
||
575 | 575 | $hasCache = ($persister instanceof CachedPersister); |
576 | 576 | $key = null; |
577 | 577 | |
578 | - if (! $hasCache) { |
|
578 | + if ( ! $hasCache) { |
|
579 | 579 | return $this->persister->loadManyToManyCollection($association, $sourceEntity, $collection); |
580 | 580 | } |
581 | 581 | |
@@ -614,7 +614,7 @@ discard block |
||
614 | 614 | $persister = $uow->getCollectionPersister($association); |
615 | 615 | $hasCache = ($persister instanceof CachedPersister); |
616 | 616 | |
617 | - if (! $hasCache) { |
|
617 | + if ( ! $hasCache) { |
|
618 | 618 | return $this->persister->loadOneToManyCollection($association, $sourceEntity, $collection); |
619 | 619 | } |
620 | 620 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Cache\Persister\Collection; |
6 | 6 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $isInitialized = $collection->isInitialized(); |
61 | 61 | $isDirty = $collection->isDirty(); |
62 | 62 | |
63 | - if (! $isInitialized && ! $isDirty) { |
|
63 | + if ( ! $isInitialized && ! $isDirty) { |
|
64 | 64 | return; |
65 | 65 | } |
66 | 66 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Cache\Persister\Collection; |
6 | 6 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $isInitialized = $collection->isInitialized(); |
98 | 98 | $isDirty = $collection->isDirty(); |
99 | 99 | |
100 | - if (! $isInitialized && ! $isDirty) { |
|
100 | + if ( ! $isInitialized && ! $isDirty) { |
|
101 | 101 | return; |
102 | 102 | } |
103 | 103 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Cache; |
6 | 6 | |
@@ -189,14 +189,14 @@ discard block |
||
189 | 189 | ; |
190 | 190 | |
191 | 191 | if ($cache->getUsage() === CacheUsage::READ_WRITE) { |
192 | - if (! $this->fileLockRegionDirectory) { |
|
192 | + if ( ! $this->fileLockRegionDirectory) { |
|
193 | 193 | throw new \LogicException( |
194 | - 'If you want to use a "READ_WRITE" cache an implementation of "Doctrine\ORM\Cache\ConcurrentRegion" is required, ' . |
|
194 | + 'If you want to use a "READ_WRITE" cache an implementation of "Doctrine\ORM\Cache\ConcurrentRegion" is required, '. |
|
195 | 195 | '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(). ' |
196 | 196 | ); |
197 | 197 | } |
198 | 198 | |
199 | - $directory = $this->fileLockRegionDirectory . DIRECTORY_SEPARATOR . $regionName; |
|
199 | + $directory = $this->fileLockRegionDirectory.DIRECTORY_SEPARATOR.$regionName; |
|
200 | 200 | $region = new FileLockRegion($region, $directory, $this->regionsConfig->getLockLifetime($regionName)); |
201 | 201 | } |
202 | 202 | |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | { |
213 | 213 | $cacheAdapter = clone $this->cache; |
214 | 214 | |
215 | - if (! $cacheAdapter instanceof CacheProvider) { |
|
215 | + if ( ! $cacheAdapter instanceof CacheProvider) { |
|
216 | 216 | return $cacheAdapter; |
217 | 217 | } |
218 | 218 | |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | $namespace .= ':'; |
223 | 223 | } |
224 | 224 | |
225 | - $cacheAdapter->setNamespace($namespace . $name); |
|
225 | + $cacheAdapter->setNamespace($namespace.$name); |
|
226 | 226 | |
227 | 227 | return $cacheAdapter; |
228 | 228 | } |