@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Internal\Hydration; |
6 | 6 |
@@ -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\Internal\Hydration; |
6 | 6 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | */ |
69 | 69 | protected function prepare() |
70 | 70 | { |
71 | - if (! isset($this->hints[UnitOfWork::HINT_DEFEREAGERLOAD])) { |
|
71 | + if ( ! isset($this->hints[UnitOfWork::HINT_DEFEREAGERLOAD])) { |
|
72 | 72 | $this->hints[UnitOfWork::HINT_DEFEREAGERLOAD] = true; |
73 | 73 | } |
74 | 74 | |
@@ -78,13 +78,13 @@ discard block |
||
78 | 78 | |
79 | 79 | // Remember which associations are "fetch joined", so that we know where to inject |
80 | 80 | // collection stubs or proxies and where not. |
81 | - if (! isset($this->rsm->relationMap[$dqlAlias])) { |
|
81 | + if ( ! isset($this->rsm->relationMap[$dqlAlias])) { |
|
82 | 82 | continue; |
83 | 83 | } |
84 | 84 | |
85 | 85 | $parent = $this->rsm->parentAliasMap[$dqlAlias]; |
86 | 86 | |
87 | - if (! isset($this->rsm->aliasMap[$parent])) { |
|
87 | + if ( ! isset($this->rsm->aliasMap[$parent])) { |
|
88 | 88 | throw HydrationException::parentObjectOfRelationNotFound($dqlAlias, $parent); |
89 | 89 | } |
90 | 90 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | $class = $this->getClassMetadata($className); |
111 | 111 | $inverseAssoc = $class->getProperty($association->getInversedBy()); |
112 | 112 | |
113 | - if (! ($inverseAssoc instanceof ToOneAssociationMetadata)) { |
|
113 | + if ( ! ($inverseAssoc instanceof ToOneAssociationMetadata)) { |
|
114 | 114 | continue; |
115 | 115 | } |
116 | 116 | |
@@ -176,14 +176,14 @@ discard block |
||
176 | 176 | $value = $association->getValue($entity); |
177 | 177 | $oid = spl_object_hash($entity); |
178 | 178 | |
179 | - if (! $value instanceof PersistentCollection) { |
|
179 | + if ( ! $value instanceof PersistentCollection) { |
|
180 | 180 | $value = $association->wrap($entity, $value, $this->em); |
181 | 181 | |
182 | 182 | $association->setValue($entity, $value); |
183 | 183 | |
184 | 184 | $this->uow->setOriginalEntityProperty($oid, $fieldName, $value); |
185 | 185 | |
186 | - $this->initializedCollections[$oid . $fieldName] = $value; |
|
186 | + $this->initializedCollections[$oid.$fieldName] = $value; |
|
187 | 187 | } else if ( |
188 | 188 | isset($this->hints[Query::HINT_REFRESH]) || |
189 | 189 | (isset($this->hints['fetched'][$parentDqlAlias][$fieldName]) && ! $value->isInitialized()) |
@@ -193,10 +193,10 @@ discard block |
||
193 | 193 | $value->setInitialized(true); |
194 | 194 | $value->unwrap()->clear(); |
195 | 195 | |
196 | - $this->initializedCollections[$oid . $fieldName] = $value; |
|
196 | + $this->initializedCollections[$oid.$fieldName] = $value; |
|
197 | 197 | } else { |
198 | 198 | // Is already PersistentCollection, and DON'T REFRESH or FETCH-JOIN! |
199 | - $this->existingCollections[$oid . $fieldName] = $value; |
|
199 | + $this->existingCollections[$oid.$fieldName] = $value; |
|
200 | 200 | } |
201 | 201 | |
202 | 202 | return $value; |
@@ -314,10 +314,10 @@ discard block |
||
314 | 314 | $parentAlias = $this->rsm->parentAliasMap[$dqlAlias]; |
315 | 315 | // we need the $path to save into the identifier map which entities were already |
316 | 316 | // seen for this parent-child relationship |
317 | - $path = $parentAlias . '.' . $dqlAlias; |
|
317 | + $path = $parentAlias.'.'.$dqlAlias; |
|
318 | 318 | |
319 | 319 | // We have a RIGHT JOIN result here. Doctrine cannot hydrate RIGHT JOIN Object-Graphs |
320 | - if (! isset($nonemptyComponents[$parentAlias])) { |
|
320 | + if ( ! isset($nonemptyComponents[$parentAlias])) { |
|
321 | 321 | // TODO: Add special case code where we hydrate the right join objects into identity map at least |
322 | 322 | continue; |
323 | 323 | } |
@@ -348,15 +348,15 @@ discard block |
||
348 | 348 | $oid = spl_object_hash($parentObject); |
349 | 349 | |
350 | 350 | // Check the type of the relation (many or single-valued) |
351 | - if (! ($association instanceof ToOneAssociationMetadata)) { |
|
351 | + if ( ! ($association instanceof ToOneAssociationMetadata)) { |
|
352 | 352 | // PATH A: Collection-valued association |
353 | 353 | $reflFieldValue = $association->getValue($parentObject); |
354 | 354 | |
355 | 355 | if (isset($nonemptyComponents[$dqlAlias])) { |
356 | - $collKey = $oid . $relationField; |
|
356 | + $collKey = $oid.$relationField; |
|
357 | 357 | if (isset($this->initializedCollections[$collKey])) { |
358 | 358 | $reflFieldValue = $this->initializedCollections[$collKey]; |
359 | - } else if (! isset($this->existingCollections[$collKey])) { |
|
359 | + } else if ( ! isset($this->existingCollections[$collKey])) { |
|
360 | 360 | $reflFieldValue = $this->initRelatedCollection($parentObject, $parentClass, $relationField, $parentAlias); |
361 | 361 | } |
362 | 362 | |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | $index = $indexExists ? $this->identifierMap[$path][$id[$parentAlias]][$id[$dqlAlias]] : false; |
365 | 365 | $indexIsValid = $index !== false ? isset($reflFieldValue[$index]) : false; |
366 | 366 | |
367 | - if (! $indexExists || ! $indexIsValid) { |
|
367 | + if ( ! $indexExists || ! $indexIsValid) { |
|
368 | 368 | if (isset($this->existingCollections[$collKey])) { |
369 | 369 | // Collection exists, only look for the element in the identity map. |
370 | 370 | if ($element = $this->getEntityFromIdentityMap($entityName, $data)) { |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | // PATH B: Single-valued association |
401 | 401 | $reflFieldValue = $association->getValue($parentObject); |
402 | 402 | |
403 | - if (! $reflFieldValue || isset($this->hints[Query::HINT_REFRESH]) || |
|
403 | + if ( ! $reflFieldValue || isset($this->hints[Query::HINT_REFRESH]) || |
|
404 | 404 | ($reflFieldValue instanceof Proxy && ! $reflFieldValue->__isInitialized())) { |
405 | 405 | // we only need to take action if this value is null, |
406 | 406 | // we refresh the entity or its an uninitialized proxy. |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | $entityKey = $this->rsm->entityMappings[$dqlAlias] ?: 0; |
462 | 462 | |
463 | 463 | // if this row has a NULL value for the root result id then make it a null result. |
464 | - if ( ! isset($nonemptyComponents[$dqlAlias]) ) { |
|
464 | + if ( ! isset($nonemptyComponents[$dqlAlias])) { |
|
465 | 465 | if ($this->rsm->isMixed) { |
466 | 466 | $result[] = [$entityKey => null]; |
467 | 467 | } else { |
@@ -517,13 +517,13 @@ discard block |
||
517 | 517 | } |
518 | 518 | } |
519 | 519 | |
520 | - if ( ! isset($resultKey) ) { |
|
520 | + if ( ! isset($resultKey)) { |
|
521 | 521 | $this->resultCounter++; |
522 | 522 | } |
523 | 523 | |
524 | 524 | // Append scalar values to mixed result sets |
525 | 525 | if (isset($rowData['scalars'])) { |
526 | - if ( ! isset($resultKey) ) { |
|
526 | + if ( ! isset($resultKey)) { |
|
527 | 527 | $resultKey = (isset($this->rsm->indexByMap['scalars'])) |
528 | 528 | ? $row[$this->rsm->indexByMap['scalars']] |
529 | 529 | : $this->resultCounter - 1; |
@@ -536,19 +536,19 @@ discard block |
||
536 | 536 | |
537 | 537 | // Append new object to mixed result sets |
538 | 538 | if (isset($rowData['newObjects'])) { |
539 | - if ( ! isset($resultKey) ) { |
|
539 | + if ( ! isset($resultKey)) { |
|
540 | 540 | $resultKey = $this->resultCounter - 1; |
541 | 541 | } |
542 | 542 | |
543 | 543 | |
544 | - $scalarCount = (isset($rowData['scalars'])? count($rowData['scalars']): 0); |
|
544 | + $scalarCount = (isset($rowData['scalars']) ? count($rowData['scalars']) : 0); |
|
545 | 545 | |
546 | 546 | foreach ($rowData['newObjects'] as $objIndex => $newObject) { |
547 | 547 | $class = $newObject['class']; |
548 | 548 | $args = $newObject['args']; |
549 | 549 | $obj = $class->newInstanceArgs($args); |
550 | 550 | |
551 | - if ($scalarCount == 0 && count($rowData['newObjects']) == 1 ) { |
|
551 | + if ($scalarCount == 0 && count($rowData['newObjects']) == 1) { |
|
552 | 552 | $result[$resultKey] = $obj; |
553 | 553 | |
554 | 554 | continue; |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Internal\Hydration; |
6 | 6 |
@@ -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\Internal\Hydration; |
6 | 6 | |
@@ -33,9 +33,9 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public static function emptyDiscriminatorValue($dqlAlias) |
35 | 35 | { |
36 | - return new self("The DQL alias '" . $dqlAlias . "' contains an entity ". |
|
37 | - "of an inheritance hierarchy with an empty discriminator value. This means " . |
|
38 | - "that the database contains inconsistent data with an empty " . |
|
36 | + return new self("The DQL alias '".$dqlAlias."' contains an entity ". |
|
37 | + "of an inheritance hierarchy with an empty discriminator value. This means ". |
|
38 | + "that the database contains inconsistent data with an empty ". |
|
39 | 39 | "discriminator value in a table row." |
40 | 40 | ); |
41 | 41 | } |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -declare(strict_types=1); |
|
4 | +declare(strict_types = 1); |
|
5 | 5 | |
6 | 6 | namespace Doctrine\ORM\Internal; |
7 | 7 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM; |
6 | 6 |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -declare(strict_types=1); |
|
4 | +declare(strict_types = 1); |
|
5 | 5 | |
6 | 6 | namespace Doctrine\ORM\Reflection; |
7 | 7 | |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | */ |
20 | 20 | public function getParentClasses(string $className) : array |
21 | 21 | { |
22 | - if (! class_exists($className)) { |
|
22 | + if ( ! class_exists($className)) { |
|
23 | 23 | throw MappingException::nonExistingClass($className); |
24 | 24 | } |
25 | 25 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | /** |
50 | 50 | * {@inheritdoc} |
51 | 51 | */ |
52 | - public function getClass(string $className) : ?\ReflectionClass |
|
52 | + public function getClass(string $className) : ? \ReflectionClass |
|
53 | 53 | { |
54 | 54 | return new \ReflectionClass($className); |
55 | 55 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | /** |
58 | 58 | * {@inheritdoc} |
59 | 59 | */ |
60 | - public function getAccessibleProperty(string $className, string $propertyName) : ?\ReflectionProperty |
|
60 | + public function getAccessibleProperty(string $className, string $propertyName) : ? \ReflectionProperty |
|
61 | 61 | { |
62 | 62 | $reflectionProperty = new \ReflectionProperty($className, $propertyName); |
63 | 63 |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -declare(strict_types=1); |
|
4 | +declare(strict_types = 1); |
|
5 | 5 | |
6 | 6 | namespace Doctrine\ORM\Reflection; |
7 | 7 | |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | public function getClassShortName(string $className) : string |
27 | 27 | { |
28 | 28 | if (strpos($className, '\\') !== false) { |
29 | - $className = substr($className, strrpos($className, "\\")+1); |
|
29 | + $className = substr($className, strrpos($className, "\\") + 1); |
|
30 | 30 | } |
31 | 31 | return $className; |
32 | 32 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | $namespace = ''; |
40 | 40 | |
41 | 41 | if (strpos($className, '\\') !== false) { |
42 | - $namespace = strrev(substr( strrev($className), strpos(strrev($className), '\\')+1 )); |
|
42 | + $namespace = strrev(substr(strrev($className), strpos(strrev($className), '\\') + 1)); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | return $namespace; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | /** |
49 | 49 | * {@inheritDoc} |
50 | 50 | */ |
51 | - public function getClass(string $className) : ?\ReflectionClass |
|
51 | + public function getClass(string $className) : ? \ReflectionClass |
|
52 | 52 | { |
53 | 53 | return null; |
54 | 54 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | /** |
57 | 57 | * {@inheritDoc} |
58 | 58 | */ |
59 | - public function getAccessibleProperty(string $className, string $propertyName) : ?\ReflectionProperty |
|
59 | + public function getAccessibleProperty(string $className, string $propertyName) : ? \ReflectionProperty |
|
60 | 60 | { |
61 | 61 | return null; |
62 | 62 | } |
@@ -1,6 +1,6 @@ |
||
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 |