@@ -25,12 +25,12 @@ |
||
25 | 25 | |
26 | 26 | if ($this->maxRunningTime != 0 && $time > $this->maxRunningTime) { |
27 | 27 | $this->fail( |
28 | - sprintf( |
|
28 | + sprintf( |
|
29 | 29 | 'expected running time: <= %s but was: %s', |
30 | 30 | |
31 | 31 | $this->maxRunningTime, |
32 | 32 | $time |
33 | - ) |
|
33 | + ) |
|
34 | 34 | ); |
35 | 35 | } |
36 | 36 | } |
@@ -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\Tests; |
6 | 6 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function setMaxRunningTime($maxRunningTime) |
50 | 50 | { |
51 | - if (! (is_int($maxRunningTime) && $maxRunningTime >= 0)) { |
|
51 | + if ( ! (is_int($maxRunningTime) && $maxRunningTime >= 0)) { |
|
52 | 52 | throw new \InvalidArgumentException; |
53 | 53 | } |
54 | 54 |
@@ -23,7 +23,6 @@ |
||
23 | 23 | namespace Doctrine\ORM\Cache; |
24 | 24 | |
25 | 25 | use Doctrine\Common\Util\ClassUtils; |
26 | - |
|
27 | 26 | use Doctrine\ORM\Mapping\FetchMode; |
28 | 27 | use Doctrine\ORM\Mapping\FieldMetadata; |
29 | 28 | use Doctrine\ORM\Mapping\OneToOneAssociationMetadata; |
@@ -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\Cache; |
7 | 7 | |
@@ -59,11 +59,11 @@ discard block |
||
59 | 59 | $data = array_merge($data, $persister->getIdentifier($entity)); // why update has no identifier values ? |
60 | 60 | |
61 | 61 | foreach ($metadata->getProperties() as $name => $association) { |
62 | - if (! isset($data[$name]) || $association instanceof FieldMetadata) { |
|
62 | + if ( ! isset($data[$name]) || $association instanceof FieldMetadata) { |
|
63 | 63 | continue; |
64 | 64 | } |
65 | 65 | |
66 | - if (! $association instanceof ToOneAssociationMetadata) { |
|
66 | + if ( ! $association instanceof ToOneAssociationMetadata) { |
|
67 | 67 | unset($data[$name]); |
68 | 68 | |
69 | 69 | continue; |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $targetClassMetadata = $this->em->getClassMetadata($targetEntity); |
74 | 74 | $targetPersister = $this->uow->getEntityPersister($targetEntity); |
75 | 75 | |
76 | - if (! $association->getCache()) { |
|
76 | + if ( ! $association->getCache()) { |
|
77 | 77 | $owningAssociation = ! $association->isOwningSide() |
78 | 78 | ? $targetClassMetadata->getProperty($association->getMappedBy()) |
79 | 79 | : $association; |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | continue; |
122 | 122 | } |
123 | 123 | |
124 | - if (! $association->isPrimaryKey()) { |
|
124 | + if ( ! $association->isPrimaryKey()) { |
|
125 | 125 | $targetClass = ClassUtils::getClass($data[$name]); |
126 | 126 | $targetId = $this->uow->getEntityIdentifier($data[$name]); |
127 | 127 | $data[$name] = new AssociationCacheEntry($targetClass, $targetId); |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | ($association instanceof OneToOneAssociationMetadata && ! $association->isOwningSide()) |
172 | 172 | ); |
173 | 173 | |
174 | - if (! $isEagerLoad) { |
|
174 | + if ( ! $isEagerLoad) { |
|
175 | 175 | $data[$name] = $this->em->getReference($assocClass, $assocId); |
176 | 176 | |
177 | 177 | continue; |
@@ -45,6 +45,7 @@ |
||
45 | 45 | * {@inheritDoc} |
46 | 46 | * |
47 | 47 | * @param MultiGetCache $cache |
48 | + * @param string $name |
|
48 | 49 | */ |
49 | 50 | public function __construct($name, MultiGetCache $cache, $lifetime = 0) |
50 | 51 | { |
@@ -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\Cache\Region; |
7 | 7 |
@@ -23,7 +23,6 @@ |
||
23 | 23 | |
24 | 24 | use Doctrine\ORM\Mapping\ToOneAssociationMetadata; |
25 | 25 | use PDO; |
26 | -use Doctrine\ORM\Mapping\ClassMetadata; |
|
27 | 26 | |
28 | 27 | /** |
29 | 28 | * The ArrayHydrator produces a nested array "graph" that is often (not always) |
@@ -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 | |
@@ -94,10 +94,10 @@ discard block |
||
94 | 94 | // It's a joined result |
95 | 95 | |
96 | 96 | $parent = $this->rsm->parentAliasMap[$dqlAlias]; |
97 | - $path = $parent . '.' . $dqlAlias; |
|
97 | + $path = $parent.'.'.$dqlAlias; |
|
98 | 98 | |
99 | 99 | // missing parent data, skipping as RIGHT JOIN hydration is not supported. |
100 | - if ( ! isset($nonemptyComponents[$parent]) ) { |
|
100 | + if ( ! isset($nonemptyComponents[$parent])) { |
|
101 | 101 | continue; |
102 | 102 | } |
103 | 103 | |
@@ -106,9 +106,9 @@ discard block |
||
106 | 106 | if ($this->rsm->isMixed && isset($this->rootAliases[$parent])) { |
107 | 107 | $first = reset($this->resultPointers); |
108 | 108 | // TODO: Exception if $key === null ? |
109 | - $baseElement =& $this->resultPointers[$parent][key($first)]; |
|
109 | + $baseElement = & $this->resultPointers[$parent][key($first)]; |
|
110 | 110 | } else if (isset($this->resultPointers[$parent])) { |
111 | - $baseElement =& $this->resultPointers[$parent]; |
|
111 | + $baseElement = & $this->resultPointers[$parent]; |
|
112 | 112 | } else { |
113 | 113 | unset($this->resultPointers[$dqlAlias]); // Ticket #1228 |
114 | 114 | |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $relation = $parentClass->getProperty($relationAlias); |
121 | 121 | |
122 | 122 | // Check the type of the relation (many or single-valued) |
123 | - if (! $relation instanceof ToOneAssociationMetadata) { |
|
123 | + if ( ! $relation instanceof ToOneAssociationMetadata) { |
|
124 | 124 | $oneToOne = false; |
125 | 125 | |
126 | 126 | if ( ! isset($baseElement[$relationAlias])) { |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | } |
160 | 160 | } |
161 | 161 | |
162 | - $coll =& $baseElement[$relationAlias]; |
|
162 | + $coll = & $baseElement[$relationAlias]; |
|
163 | 163 | |
164 | 164 | if (is_array($coll)) { |
165 | 165 | $this->updateResultPointer($coll, $index, $dqlAlias, $oneToOne); |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | $entityKey = $this->rsm->entityMappings[$dqlAlias] ?: 0; |
172 | 172 | |
173 | 173 | // if this row has a NULL value for the root result id then make it a null result. |
174 | - if ( ! isset($nonemptyComponents[$dqlAlias]) ) { |
|
174 | + if ( ! isset($nonemptyComponents[$dqlAlias])) { |
|
175 | 175 | $result[] = $this->rsm->isMixed |
176 | 176 | ? [$entityKey => null] |
177 | 177 | : null; |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | $resultKey = $this->resultCounter - 1; |
233 | 233 | } |
234 | 234 | |
235 | - $scalarCount = (isset($rowData['scalars'])? count($rowData['scalars']): 0); |
|
235 | + $scalarCount = (isset($rowData['scalars']) ? count($rowData['scalars']) : 0); |
|
236 | 236 | |
237 | 237 | foreach ($rowData['newObjects'] as $objIndex => $newObject) { |
238 | 238 | $class = $newObject['class']; |
@@ -270,13 +270,13 @@ discard block |
||
270 | 270 | } |
271 | 271 | |
272 | 272 | if ($oneToOne) { |
273 | - $this->resultPointers[$dqlAlias] =& $coll; |
|
273 | + $this->resultPointers[$dqlAlias] = & $coll; |
|
274 | 274 | |
275 | 275 | return; |
276 | 276 | } |
277 | 277 | |
278 | 278 | if ($index !== false) { |
279 | - $this->resultPointers[$dqlAlias] =& $coll[$index]; |
|
279 | + $this->resultPointers[$dqlAlias] = & $coll[$index]; |
|
280 | 280 | |
281 | 281 | return; |
282 | 282 | } |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | } |
287 | 287 | |
288 | 288 | end($coll); |
289 | - $this->resultPointers[$dqlAlias] =& $coll[key($coll)]; |
|
289 | + $this->resultPointers[$dqlAlias] = & $coll[key($coll)]; |
|
290 | 290 | |
291 | 291 | return; |
292 | 292 | } |
@@ -25,8 +25,6 @@ |
||
25 | 25 | use Doctrine\ORM\Mapping\ToManyAssociationMetadata; |
26 | 26 | use Doctrine\ORM\Mapping\ToOneAssociationMetadata; |
27 | 27 | use PDO; |
28 | -use Doctrine\Common\Collections\ArrayCollection; |
|
29 | -use Doctrine\ORM\Event\PostLoadEventDispatcher; |
|
30 | 28 | use Doctrine\ORM\Mapping\ClassMetadata; |
31 | 29 | use Doctrine\ORM\PersistentCollection; |
32 | 30 | use Doctrine\ORM\Proxy\Proxy; |
@@ -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; |
@@ -156,7 +156,7 @@ |
||
156 | 156 | } |
157 | 157 | |
158 | 158 | /** |
159 | - * @return array |
|
159 | + * @return string[] |
|
160 | 160 | */ |
161 | 161 | public function getCascade() |
162 | 162 | { |
@@ -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\Mapping; |
7 | 7 |
@@ -1278,7 +1278,7 @@ |
||
1278 | 1278 | * |
1279 | 1279 | * @todo guilhermeblanco Only used for ClassMetadataTest. Remove if possible! |
1280 | 1280 | * |
1281 | - * @param array $subclasses The names of all mapped subclasses. |
|
1281 | + * @param string[] $subclasses The names of all mapped subclasses. |
|
1282 | 1282 | * |
1283 | 1283 | * @return void |
1284 | 1284 | */ |
@@ -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\Mapping; |
7 | 7 | |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | * |
314 | 314 | * @return void |
315 | 315 | */ |
316 | - public function setCache(?CacheMetadata $cache = null) |
|
316 | + public function setCache(? CacheMetadata $cache = null) |
|
317 | 317 | { |
318 | 318 | $this->cache = $cache; |
319 | 319 | } |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | /** |
322 | 322 | * @return CacheMetadata|null |
323 | 323 | */ |
324 | - public function getCache(): ?CacheMetadata |
|
324 | + public function getCache(): ? CacheMetadata |
|
325 | 325 | { |
326 | 326 | return $this->cache; |
327 | 327 | } |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | /** |
330 | 330 | * @return \ReflectionClass|null |
331 | 331 | */ |
332 | - public function getReflectionClass() : ?\ReflectionClass |
|
332 | + public function getReflectionClass() : ? \ReflectionClass |
|
333 | 333 | { |
334 | 334 | return $this->reflectionClass; |
335 | 335 | } |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | */ |
358 | 358 | public function __toString() |
359 | 359 | { |
360 | - return __CLASS__ . '@' . spl_object_hash($this); |
|
360 | + return __CLASS__.'@'.spl_object_hash($this); |
|
361 | 361 | } |
362 | 362 | |
363 | 363 | /** |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | // Restore ReflectionClass and properties |
462 | 462 | $this->reflectionClass = $reflService->getClass($this->name); |
463 | 463 | |
464 | - if (! $this->reflectionClass) { |
|
464 | + if ( ! $this->reflectionClass) { |
|
465 | 465 | return; |
466 | 466 | } |
467 | 467 | |
@@ -536,11 +536,11 @@ discard block |
||
536 | 536 | } |
537 | 537 | |
538 | 538 | // Verify & complete identifier mapping |
539 | - if (! $this->identifier) { |
|
539 | + if ( ! $this->identifier) { |
|
540 | 540 | throw MappingException::identifierRequired($this->name); |
541 | 541 | } |
542 | 542 | |
543 | - $explicitlyGeneratedProperties = array_filter($this->properties, function (Property $property) : bool { |
|
543 | + $explicitlyGeneratedProperties = array_filter($this->properties, function(Property $property) : bool { |
|
544 | 544 | return $property instanceof FieldMetadata |
545 | 545 | && $property->isPrimaryKey() |
546 | 546 | && $property->hasValueGenerator(); |
@@ -561,8 +561,8 @@ discard block |
||
561 | 561 | public function validateAssociations() |
562 | 562 | { |
563 | 563 | array_map( |
564 | - function (Property $property) { |
|
565 | - if (! ($property instanceof AssociationMetadata)) { |
|
564 | + function(Property $property) { |
|
565 | + if ( ! ($property instanceof AssociationMetadata)) { |
|
566 | 566 | return; |
567 | 567 | } |
568 | 568 | |
@@ -618,11 +618,11 @@ discard block |
||
618 | 618 | */ |
619 | 619 | public function isIdentifier($fieldName) |
620 | 620 | { |
621 | - if (! $this->identifier) { |
|
621 | + if ( ! $this->identifier) { |
|
622 | 622 | return false; |
623 | 623 | } |
624 | 624 | |
625 | - if (! $this->isIdentifierComposite()) { |
|
625 | + if ( ! $this->isIdentifierComposite()) { |
|
626 | 626 | return $fieldName === $this->identifier[0]; |
627 | 627 | } |
628 | 628 | |
@@ -650,7 +650,7 @@ discard block |
||
650 | 650 | */ |
651 | 651 | public function getNamedQuery($queryName) |
652 | 652 | { |
653 | - if (! isset($this->namedQueries[$queryName])) { |
|
653 | + if ( ! isset($this->namedQueries[$queryName])) { |
|
654 | 654 | throw MappingException::queryNotFound($this->name, $queryName); |
655 | 655 | } |
656 | 656 | |
@@ -710,7 +710,7 @@ discard block |
||
710 | 710 | */ |
711 | 711 | public function getSqlResultSetMapping($name) |
712 | 712 | { |
713 | - if (! isset($this->sqlResultSetMappings[$name])) { |
|
713 | + if ( ! isset($this->sqlResultSetMappings[$name])) { |
|
714 | 714 | throw MappingException::resultMappingNotFound($this->name, $name); |
715 | 715 | } |
716 | 716 | |
@@ -745,7 +745,7 @@ discard block |
||
745 | 745 | $property->setColumnName($columnName); |
746 | 746 | } |
747 | 747 | |
748 | - if (! $this->isMappedSuperclass) { |
|
748 | + if ( ! $this->isMappedSuperclass) { |
|
749 | 749 | $property->setTableName($this->getTableName()); |
750 | 750 | } |
751 | 751 | |
@@ -765,7 +765,7 @@ discard block |
||
765 | 765 | throw MappingException::sqlConversionNotAllowedForPrimaryKeyProperties($property); |
766 | 766 | }; |
767 | 767 | |
768 | - if (! in_array($fieldName, $this->identifier)) { |
|
768 | + if ( ! in_array($fieldName, $this->identifier)) { |
|
769 | 769 | $this->identifier[] = $fieldName; |
770 | 770 | } |
771 | 771 | } |
@@ -819,7 +819,7 @@ discard block |
||
819 | 819 | $fieldName = $property->getName(); |
820 | 820 | $targetEntity = $property->getTargetEntity(); |
821 | 821 | |
822 | - if (! $targetEntity) { |
|
822 | + if ( ! $targetEntity) { |
|
823 | 823 | throw MappingException::missingTargetEntity($fieldName); |
824 | 824 | } |
825 | 825 | |
@@ -850,7 +850,7 @@ discard block |
||
850 | 850 | $this->identifier[] = $property->getName(); |
851 | 851 | } |
852 | 852 | |
853 | - if ($this->cache && !$property->getCache()) { |
|
853 | + if ($this->cache && ! $property->getCache()) { |
|
854 | 854 | throw CacheException::nonCacheableEntityAssociation($this->name, $fieldName); |
855 | 855 | } |
856 | 856 | |
@@ -903,7 +903,7 @@ discard block |
||
903 | 903 | foreach ($property->getJoinColumns() as $joinColumn) { |
904 | 904 | if ($property instanceof OneToOneAssociationMetadata && $this->inheritanceType !== InheritanceType::SINGLE_TABLE) { |
905 | 905 | if (1 === count($property->getJoinColumns())) { |
906 | - if (! $property->isPrimaryKey()) { |
|
906 | + if ( ! $property->isPrimaryKey()) { |
|
907 | 907 | $joinColumn->setUnique(true); |
908 | 908 | } |
909 | 909 | } else { |
@@ -911,13 +911,13 @@ discard block |
||
911 | 911 | } |
912 | 912 | } |
913 | 913 | |
914 | - $joinColumn->setTableName(! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
914 | + $joinColumn->setTableName( ! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
915 | 915 | |
916 | - if (! $joinColumn->getColumnName()) { |
|
916 | + if ( ! $joinColumn->getColumnName()) { |
|
917 | 917 | $joinColumn->setColumnName($this->namingStrategy->joinColumnName($fieldName, $this->name)); |
918 | 918 | } |
919 | 919 | |
920 | - if (! $joinColumn->getReferencedColumnName()) { |
|
920 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
921 | 921 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
922 | 922 | } |
923 | 923 | |
@@ -945,7 +945,7 @@ discard block |
||
945 | 945 | if ($property->isOrphanRemoval()) { |
946 | 946 | $cascades = $property->getCascade(); |
947 | 947 | |
948 | - if (! in_array('remove', $cascades)) { |
|
948 | + if ( ! in_array('remove', $cascades)) { |
|
949 | 949 | $cascades[] = 'remove'; |
950 | 950 | |
951 | 951 | $property->setCascade($cascades); |
@@ -1013,14 +1013,14 @@ discard block |
||
1013 | 1013 | $property->setOwningSide(false); |
1014 | 1014 | |
1015 | 1015 | // OneToMany MUST have mappedBy |
1016 | - if (! $property->getMappedBy()) { |
|
1016 | + if ( ! $property->getMappedBy()) { |
|
1017 | 1017 | throw MappingException::oneToManyRequiresMappedBy($property->getName()); |
1018 | 1018 | } |
1019 | 1019 | |
1020 | 1020 | if ($property->isOrphanRemoval()) { |
1021 | 1021 | $cascades = $property->getCascade(); |
1022 | 1022 | |
1023 | - if (! in_array('remove', $cascades)) { |
|
1023 | + if ( ! in_array('remove', $cascades)) { |
|
1024 | 1024 | $cascades[] = 'remove'; |
1025 | 1025 | |
1026 | 1026 | $property->setCascade($cascades); |
@@ -1043,7 +1043,7 @@ discard block |
||
1043 | 1043 | |
1044 | 1044 | $property->setJoinTable($joinTable); |
1045 | 1045 | |
1046 | - if (! $joinTable->getName()) { |
|
1046 | + if ( ! $joinTable->getName()) { |
|
1047 | 1047 | $joinTableName = $this->namingStrategy->joinTableName( |
1048 | 1048 | $property->getSourceEntity(), |
1049 | 1049 | $property->getTargetEntity(), |
@@ -1055,7 +1055,7 @@ discard block |
||
1055 | 1055 | |
1056 | 1056 | $selfReferencingEntityWithoutJoinColumns = $property->getSourceEntity() == $property->getTargetEntity() && ! $joinTable->hasColumns(); |
1057 | 1057 | |
1058 | - if (! $joinTable->getJoinColumns()) { |
|
1058 | + if ( ! $joinTable->getJoinColumns()) { |
|
1059 | 1059 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
1060 | 1060 | $sourceReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'source' : $referencedColumnName; |
1061 | 1061 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getSourceEntity(), $sourceReferenceName); |
@@ -1068,7 +1068,7 @@ discard block |
||
1068 | 1068 | $joinTable->addJoinColumn($joinColumn); |
1069 | 1069 | } |
1070 | 1070 | |
1071 | - if (! $joinTable->getInverseJoinColumns()) { |
|
1071 | + if ( ! $joinTable->getInverseJoinColumns()) { |
|
1072 | 1072 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
1073 | 1073 | $targetReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'target' : $referencedColumnName; |
1074 | 1074 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getTargetEntity(), $targetReferenceName); |
@@ -1082,13 +1082,13 @@ discard block |
||
1082 | 1082 | } |
1083 | 1083 | |
1084 | 1084 | foreach ($joinTable->getJoinColumns() as $joinColumn) { |
1085 | - if (! $joinColumn->getReferencedColumnName()) { |
|
1085 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
1086 | 1086 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
1087 | 1087 | } |
1088 | 1088 | |
1089 | 1089 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
1090 | 1090 | |
1091 | - if (! $joinColumn->getColumnName()) { |
|
1091 | + if ( ! $joinColumn->getColumnName()) { |
|
1092 | 1092 | $columnName = $this->namingStrategy->joinKeyColumnName( |
1093 | 1093 | $property->getSourceEntity(), |
1094 | 1094 | $referencedColumnName |
@@ -1099,13 +1099,13 @@ discard block |
||
1099 | 1099 | } |
1100 | 1100 | |
1101 | 1101 | foreach ($joinTable->getInverseJoinColumns() as $inverseJoinColumn) { |
1102 | - if (! $inverseJoinColumn->getReferencedColumnName()) { |
|
1102 | + if ( ! $inverseJoinColumn->getReferencedColumnName()) { |
|
1103 | 1103 | $inverseJoinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
1104 | 1104 | } |
1105 | 1105 | |
1106 | 1106 | $referencedColumnName = $inverseJoinColumn->getReferencedColumnName(); |
1107 | 1107 | |
1108 | - if (! $inverseJoinColumn->getColumnName()) { |
|
1108 | + if ( ! $inverseJoinColumn->getColumnName()) { |
|
1109 | 1109 | $columnName = $this->namingStrategy->joinKeyColumnName( |
1110 | 1110 | $property->getTargetEntity(), |
1111 | 1111 | $referencedColumnName |
@@ -1198,7 +1198,7 @@ discard block |
||
1198 | 1198 | // Association defined as Id field |
1199 | 1199 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
1200 | 1200 | |
1201 | - if (! $property->isOwningSide()) { |
|
1201 | + if ( ! $property->isOwningSide()) { |
|
1202 | 1202 | $property = $targetClass->getProperty($property->getMappedBy()); |
1203 | 1203 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
1204 | 1204 | } |
@@ -1249,11 +1249,11 @@ discard block |
||
1249 | 1249 | { |
1250 | 1250 | $schema = empty($this->getSchemaName()) |
1251 | 1251 | ? '' |
1252 | - : $this->getSchemaName() . '_' |
|
1252 | + : $this->getSchemaName().'_' |
|
1253 | 1253 | ; |
1254 | 1254 | |
1255 | 1255 | // replace dots with underscores because PostgreSQL creates temporary tables in a special schema |
1256 | - return $schema . $this->getTableName() . '_id_tmp'; |
|
1256 | + return $schema.$this->getTableName().'_id_tmp'; |
|
1257 | 1257 | } |
1258 | 1258 | |
1259 | 1259 | /** |
@@ -1339,7 +1339,7 @@ discard block |
||
1339 | 1339 | { |
1340 | 1340 | $fieldName = $property->getName(); |
1341 | 1341 | |
1342 | - if (! isset($this->properties[$fieldName])) { |
|
1342 | + if ( ! isset($this->properties[$fieldName])) { |
|
1343 | 1343 | throw MappingException::invalidOverrideFieldName($this->name, $fieldName); |
1344 | 1344 | } |
1345 | 1345 | |
@@ -1459,7 +1459,7 @@ discard block |
||
1459 | 1459 | * |
1460 | 1460 | * @return LocalColumnMetadata|null |
1461 | 1461 | */ |
1462 | - public function getColumn(string $columnName): ?LocalColumnMetadata |
|
1462 | + public function getColumn(string $columnName): ? LocalColumnMetadata |
|
1463 | 1463 | { |
1464 | 1464 | foreach ($this->properties as $property) { |
1465 | 1465 | if ($property instanceof LocalColumnMetadata && $property->getColumnName() === $columnName) { |
@@ -1566,7 +1566,7 @@ discard block |
||
1566 | 1566 | $declaringClass = $property->getDeclaringClass(); |
1567 | 1567 | |
1568 | 1568 | if ($inheritedProperty instanceof FieldMetadata) { |
1569 | - if (! $declaringClass->isMappedSuperclass) { |
|
1569 | + if ( ! $declaringClass->isMappedSuperclass) { |
|
1570 | 1570 | $inheritedProperty->setTableName($property->getTableName()); |
1571 | 1571 | } |
1572 | 1572 | |
@@ -1624,7 +1624,7 @@ discard block |
||
1624 | 1624 | throw MappingException::duplicateQueryMapping($this->name, $name); |
1625 | 1625 | } |
1626 | 1626 | |
1627 | - if (! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) { |
|
1627 | + if ( ! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) { |
|
1628 | 1628 | throw MappingException::missingQueryMapping($this->name, $name); |
1629 | 1629 | } |
1630 | 1630 | |
@@ -1647,7 +1647,7 @@ discard block |
||
1647 | 1647 | */ |
1648 | 1648 | public function addSqlResultSetMapping(array $resultMapping) |
1649 | 1649 | { |
1650 | - if (!isset($resultMapping['name'])) { |
|
1650 | + if ( ! isset($resultMapping['name'])) { |
|
1651 | 1651 | throw MappingException::nameIsMandatoryForSqlResultSetMapping($this->name); |
1652 | 1652 | } |
1653 | 1653 | |
@@ -1657,7 +1657,7 @@ discard block |
||
1657 | 1657 | |
1658 | 1658 | if (isset($resultMapping['entities'])) { |
1659 | 1659 | foreach ($resultMapping['entities'] as $key => $entityResult) { |
1660 | - if (! isset($entityResult['entityClass'])) { |
|
1660 | + if ( ! isset($entityResult['entityClass'])) { |
|
1661 | 1661 | throw MappingException::missingResultSetMappingEntity($this->name, $resultMapping['name']); |
1662 | 1662 | } |
1663 | 1663 | |
@@ -1670,11 +1670,11 @@ discard block |
||
1670 | 1670 | |
1671 | 1671 | if (isset($entityResult['fields'])) { |
1672 | 1672 | foreach ($entityResult['fields'] as $k => $field) { |
1673 | - if (! isset($field['name'])) { |
|
1673 | + if ( ! isset($field['name'])) { |
|
1674 | 1674 | throw MappingException::missingResultSetMappingFieldName($this->name, $resultMapping['name']); |
1675 | 1675 | } |
1676 | 1676 | |
1677 | - if (! isset($field['column'])) { |
|
1677 | + if ( ! isset($field['column'])) { |
|
1678 | 1678 | $fieldName = $field['name']; |
1679 | 1679 | |
1680 | 1680 | if (strpos($fieldName, '.')) { |
@@ -1698,7 +1698,7 @@ discard block |
||
1698 | 1698 | * |
1699 | 1699 | * @return void |
1700 | 1700 | */ |
1701 | - public function setCustomRepositoryClassName(?string $repositoryClassName) |
|
1701 | + public function setCustomRepositoryClassName(? string $repositoryClassName) |
|
1702 | 1702 | { |
1703 | 1703 | $this->customRepositoryClassName = $repositoryClassName; |
1704 | 1704 | } |
@@ -1706,7 +1706,7 @@ discard block |
||
1706 | 1706 | /** |
1707 | 1707 | * @return string|null |
1708 | 1708 | */ |
1709 | - public function getCustomRepositoryClassName() : ?string |
|
1709 | + public function getCustomRepositoryClassName() : ? string |
|
1710 | 1710 | { |
1711 | 1711 | return $this->customRepositoryClassName; |
1712 | 1712 | } |
@@ -1781,11 +1781,11 @@ discard block |
||
1781 | 1781 | 'method' => $method, |
1782 | 1782 | ]; |
1783 | 1783 | |
1784 | - if (! class_exists($class)) { |
|
1784 | + if ( ! class_exists($class)) { |
|
1785 | 1785 | throw MappingException::entityListenerClassNotFound($class, $this->name); |
1786 | 1786 | } |
1787 | 1787 | |
1788 | - if (! method_exists($class, $method)) { |
|
1788 | + if ( ! method_exists($class, $method)) { |
|
1789 | 1789 | throw MappingException::entityListenerMethodNotFound($class, $method, $this->name); |
1790 | 1790 | } |
1791 | 1791 | |
@@ -1859,7 +1859,7 @@ discard block |
||
1859 | 1859 | return; |
1860 | 1860 | } |
1861 | 1861 | |
1862 | - if (! (class_exists($className) || interface_exists($className))) { |
|
1862 | + if ( ! (class_exists($className) || interface_exists($className))) { |
|
1863 | 1863 | throw MappingException::invalidClassInDiscriminatorMap($className, $this->name); |
1864 | 1864 | } |
1865 | 1865 | |
@@ -1956,7 +1956,7 @@ discard block |
||
1956 | 1956 | $namespace = $this->reflectionClass->getNamespaceName(); |
1957 | 1957 | |
1958 | 1958 | if ($className !== null && strpos($className, '\\') === false && $namespace) { |
1959 | - return ltrim($namespace . '\\' . $className, '\\'); |
|
1959 | + return ltrim($namespace.'\\'.$className, '\\'); |
|
1960 | 1960 | } |
1961 | 1961 | |
1962 | 1962 | return ltrim($className, '\\'); |
@@ -55,7 +55,7 @@ |
||
55 | 55 | /** |
56 | 56 | * Constructor. |
57 | 57 | * |
58 | - * @param array|string $paths |
|
58 | + * @param string $paths |
|
59 | 59 | */ |
60 | 60 | public function __construct($paths) |
61 | 61 | { |
@@ -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\Mapping\Driver; |
6 | 6 | |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | return $this->classNames; |
76 | 76 | } |
77 | 77 | |
78 | - if (!$this->paths) { |
|
78 | + if ( ! $this->paths) { |
|
79 | 79 | throw MappingException::pathRequired(); |
80 | 80 | } |
81 | 81 | |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $includedFiles = []; |
84 | 84 | |
85 | 85 | foreach ($this->paths as $path) { |
86 | - if (!is_dir($path)) { |
|
86 | + if ( ! is_dir($path)) { |
|
87 | 87 | throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); |
88 | 88 | } |
89 | 89 | |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | foreach ($declared as $className) { |
109 | 109 | $rc = new \ReflectionClass($className); |
110 | 110 | $sourceFile = $rc->getFileName(); |
111 | - if (in_array($sourceFile, $includedFiles) && !$this->isTransient($className)) { |
|
111 | + if (in_array($sourceFile, $includedFiles) && ! $this->isTransient($className)) { |
|
112 | 112 | $classes[] = $className; |
113 | 113 | } |
114 | 114 | } |
@@ -24,7 +24,6 @@ |
||
24 | 24 | |
25 | 25 | use Doctrine\DBAL\Types\Type; |
26 | 26 | use Doctrine\ORM\Reflection\ReflectionService; |
27 | -use Doctrine\ORM\Sequencing\Generator; |
|
28 | 27 | |
29 | 28 | class FieldMetadata extends LocalColumnMetadata implements Property |
30 | 29 | { |
@@ -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\Mapping; |
7 | 7 |