@@ -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; |
6 | 6 | |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | string $className, |
81 | 81 | ClassMetadataBuildingContext $metadataBuildingContext |
82 | 82 | ) : ?ClassMetadata { |
83 | - if (! $this->evm->hasListeners(Events::onClassMetadataNotFound)) { |
|
83 | + if ( ! $this->evm->hasListeners(Events::onClassMetadataNotFound)) { |
|
84 | 84 | return null; |
85 | 85 | } |
86 | 86 | |
@@ -139,20 +139,20 @@ discard block |
||
139 | 139 | $classMetadata->setCache(clone $parent->getCache()); |
140 | 140 | } |
141 | 141 | |
142 | - if (! empty($parent->namedNativeQueries)) { |
|
142 | + if ( ! empty($parent->namedNativeQueries)) { |
|
143 | 143 | $this->addInheritedNamedNativeQueries($classMetadata, $parent); |
144 | 144 | } |
145 | 145 | |
146 | - if (! empty($parent->sqlResultSetMappings)) { |
|
146 | + if ( ! empty($parent->sqlResultSetMappings)) { |
|
147 | 147 | $this->addInheritedSqlResultSetMappings($classMetadata, $parent); |
148 | 148 | } |
149 | 149 | |
150 | - if (! empty($parent->entityListeners) && empty($classMetadata->entityListeners)) { |
|
150 | + if ( ! empty($parent->entityListeners) && empty($classMetadata->entityListeners)) { |
|
151 | 151 | $classMetadata->entityListeners = $parent->entityListeners; |
152 | 152 | } |
153 | 153 | } |
154 | 154 | |
155 | - if (! $classMetadata->discriminatorMap && $classMetadata->inheritanceType !== InheritanceType::NONE && $classMetadata->isRootEntity()) { |
|
155 | + if ( ! $classMetadata->discriminatorMap && $classMetadata->inheritanceType !== InheritanceType::NONE && $classMetadata->isRootEntity()) { |
|
156 | 156 | $this->addDefaultDiscriminatorMap($classMetadata); |
157 | 157 | } |
158 | 158 | |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | |
173 | 173 | protected function completeRuntimeMetadata(ClassMetadata $class, ?ClassMetadata $parent = null) : void |
174 | 174 | { |
175 | - if (! $parent || ! $parent->isMappedSuperclass) { |
|
175 | + if ( ! $parent || ! $parent->isMappedSuperclass) { |
|
176 | 176 | return; |
177 | 177 | } |
178 | 178 | |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | continue; |
191 | 191 | } |
192 | 192 | |
193 | - if (! ($property instanceof ToOneAssociationMetadata)) { |
|
193 | + if ( ! ($property instanceof ToOneAssociationMetadata)) { |
|
194 | 194 | continue; |
195 | 195 | } |
196 | 196 | |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | */ |
210 | 210 | protected function validateRuntimeMetadata(ClassMetadata $class, ?ClassMetadata $parent = null) : void |
211 | 211 | { |
212 | - if (! $class->getReflectionClass()) { |
|
212 | + if ( ! $class->getReflectionClass()) { |
|
213 | 213 | // only validate if there is a reflection class instance |
214 | 214 | return; |
215 | 215 | } |
@@ -219,13 +219,13 @@ discard block |
||
219 | 219 | $class->validateLifecycleCallbacks($this->getReflectionService()); |
220 | 220 | |
221 | 221 | // verify inheritance |
222 | - if (! $class->isMappedSuperclass && $class->inheritanceType !== InheritanceType::NONE) { |
|
223 | - if (! $parent) { |
|
224 | - if (! $class->discriminatorMap) { |
|
222 | + if ( ! $class->isMappedSuperclass && $class->inheritanceType !== InheritanceType::NONE) { |
|
223 | + if ( ! $parent) { |
|
224 | + if ( ! $class->discriminatorMap) { |
|
225 | 225 | throw MappingException::missingDiscriminatorMap($class->getClassName()); |
226 | 226 | } |
227 | 227 | |
228 | - if (! $class->discriminatorColumn) { |
|
228 | + if ( ! $class->discriminatorColumn) { |
|
229 | 229 | throw MappingException::missingDiscriminatorColumn($class->getClassName()); |
230 | 230 | } |
231 | 231 | } |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | private function completeIdentifierGeneratorMappings(ClassMetadata $class) : void |
420 | 420 | { |
421 | 421 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
422 | - if (! $property instanceof FieldMetadata /*&& ! $property instanceof AssocationMetadata*/) { |
|
422 | + if ( ! $property instanceof FieldMetadata /*&& ! $property instanceof AssocationMetadata*/) { |
|
423 | 423 | continue; |
424 | 424 | } |
425 | 425 | |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | |
430 | 430 | private function completeFieldIdentifierGeneratorMapping(FieldMetadata $field) |
431 | 431 | { |
432 | - if (! $field->hasValueGenerator()) { |
|
432 | + if ( ! $field->hasValueGenerator()) { |
|
433 | 433 | return; |
434 | 434 | } |
435 | 435 | |
@@ -481,10 +481,10 @@ discard block |
||
481 | 481 | |
482 | 482 | case GeneratorType::CUSTOM: |
483 | 483 | $definition = $generator->getDefinition(); |
484 | - if (! isset($definition['class'])) { |
|
484 | + if ( ! isset($definition['class'])) { |
|
485 | 485 | throw InvalidCustomGenerator::onClassNotConfigured(); |
486 | 486 | } |
487 | - if (! class_exists($definition['class'])) { |
|
487 | + if ( ! class_exists($definition['class'])) { |
|
488 | 488 | throw InvalidCustomGenerator::onMissingClass($definition); |
489 | 489 | } |
490 | 490 | |
@@ -518,7 +518,7 @@ discard block |
||
518 | 518 | |
519 | 519 | private function getTargetPlatform() : Platforms\AbstractPlatform |
520 | 520 | { |
521 | - if (! $this->targetPlatform) { |
|
521 | + if ( ! $this->targetPlatform) { |
|
522 | 522 | $this->targetPlatform = $this->em->getConnection()->getDatabasePlatform(); |
523 | 523 | } |
524 | 524 | |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | $generatedProperties = []; |
532 | 532 | |
533 | 533 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
534 | - if (! ($property instanceof LocalColumnMetadata && $property->hasValueGenerator())) { |
|
534 | + if ( ! ($property instanceof LocalColumnMetadata && $property->hasValueGenerator())) { |
|
535 | 535 | continue; |
536 | 536 | } |
537 | 537 |
@@ -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\Tools\Pagination; |
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\EntityManager; |
6 | 6 | |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | public static function create() : self |
12 | 12 | { |
13 | 13 | return new self( |
14 | - "It's a requirement to specify a Metadata Driver and pass it " . |
|
14 | + "It's a requirement to specify a Metadata Driver and pass it ". |
|
15 | 15 | 'to Doctrine\\ORM\\Configuration::setMetadataDriverImpl().' |
16 | 16 | ); |
17 | 17 | } |
@@ -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\Persisters; |
6 | 6 | |
@@ -10,6 +10,6 @@ discard block |
||
10 | 10 | { |
11 | 11 | public static function fromClassNameAndField(string $className, string $field) : self |
12 | 12 | { |
13 | - return new self('Invalid order by orientation specified for ' . $className . '#' . $field); |
|
13 | + return new self('Invalid order by orientation specified for '.$className.'#'.$field); |
|
14 | 14 | } |
15 | 15 | } |
@@ -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\Configuration; |
6 | 6 | |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | public static function fromClassName(string $className) : self |
13 | 13 | { |
14 | 14 | return new self( |
15 | - "Invalid repository class '" . $className . "'. It must be a " . ObjectRepository::class . '.' |
|
15 | + "Invalid repository class '".$className."'. It must be a ".ObjectRepository::class.'.' |
|
16 | 16 | ); |
17 | 17 | } |
18 | 18 | } |
@@ -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,17 +62,17 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function get(QueryCacheKey $key, ResultSetMapping $rsm, array $hints = []) |
64 | 64 | { |
65 | - if (! ($key->cacheMode & Cache::MODE_GET)) { |
|
65 | + if ( ! ($key->cacheMode & Cache::MODE_GET)) { |
|
66 | 66 | return null; |
67 | 67 | } |
68 | 68 | |
69 | 69 | $cacheEntry = $this->region->get($key); |
70 | 70 | |
71 | - if (! $cacheEntry instanceof QueryCacheEntry) { |
|
71 | + if ( ! $cacheEntry instanceof QueryCacheEntry) { |
|
72 | 72 | return null; |
73 | 73 | } |
74 | 74 | |
75 | - if (! $this->validator->isValid($key, $cacheEntry)) { |
|
75 | + if ( ! $this->validator->isValid($key, $cacheEntry)) { |
|
76 | 76 | $this->region->evict($key); |
77 | 77 | |
78 | 78 | return null; |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | |
89 | 89 | $cm = $this->em->getClassMetadata($entityName); |
90 | 90 | |
91 | - $generateKeys = function (array $entry) use ($cm) : EntityCacheKey { |
|
91 | + $generateKeys = function(array $entry) use ($cm) : EntityCacheKey { |
|
92 | 92 | return new EntityCacheKey($cm->getRootClassName(), $entry['identifier']); |
93 | 93 | }; |
94 | 94 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | $this->cacheLogger->entityCacheHit($regionName, $cacheKeys->identifiers[$index]); |
112 | 112 | } |
113 | 113 | |
114 | - if (! $hasRelation) { |
|
114 | + if ( ! $hasRelation) { |
|
115 | 115 | $result[$index] = $unitOfWork->createEntity( |
116 | 116 | $entityEntry->class, |
117 | 117 | $entityEntry->resolveAssociationEntries($this->em), |
@@ -156,11 +156,11 @@ discard block |
||
156 | 156 | continue; |
157 | 157 | } |
158 | 158 | |
159 | - if (! isset($assoc['list']) || empty($assoc['list'])) { |
|
159 | + if ( ! isset($assoc['list']) || empty($assoc['list'])) { |
|
160 | 160 | continue; |
161 | 161 | } |
162 | 162 | |
163 | - $generateKeys = function ($id) use ($assocMetadata) : EntityCacheKey { |
|
163 | + $generateKeys = function($id) use ($assocMetadata) : EntityCacheKey { |
|
164 | 164 | return new EntityCacheKey($assocMetadata->getRootClassName(), $id); |
165 | 165 | }; |
166 | 166 | |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | throw FeatureNotImplemented::multipleRootEntities(); |
239 | 239 | } |
240 | 240 | |
241 | - if (! $rsm->isSelect) { |
|
241 | + if ( ! $rsm->isSelect) { |
|
242 | 242 | throw FeatureNotImplemented::nonSelectStatements(); |
243 | 243 | } |
244 | 244 | |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | throw FeatureNotImplemented::partialEntities(); |
247 | 247 | } |
248 | 248 | |
249 | - if (! ($key->cacheMode & Cache::MODE_PUT)) { |
|
249 | + if ( ! ($key->cacheMode & Cache::MODE_PUT)) { |
|
250 | 250 | return false; |
251 | 251 | } |
252 | 252 | |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | $unitOfWork = $this->em->getUnitOfWork(); |
257 | 257 | $persister = $unitOfWork->getEntityPersister($entityName); |
258 | 258 | |
259 | - if (! ($persister instanceof CachedPersister)) { |
|
259 | + if ( ! ($persister instanceof CachedPersister)) { |
|
260 | 260 | throw NonCacheableEntity::fromEntity($entityName); |
261 | 261 | } |
262 | 262 | |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | |
269 | 269 | if (($key->cacheMode & Cache::MODE_REFRESH) || ! $region->contains($entityKey)) { |
270 | 270 | // Cancel put result if entity put fail |
271 | - if (! $persister->storeEntityCache($entity, $entityKey)) { |
|
271 | + if ( ! $persister->storeEntityCache($entity, $entityKey)) { |
|
272 | 272 | return false; |
273 | 273 | } |
274 | 274 | } |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | } |
303 | 303 | |
304 | 304 | // store single nested association |
305 | - if (! is_array($assocValue)) { |
|
305 | + if ( ! is_array($assocValue)) { |
|
306 | 306 | // Cancel put result if association put fail |
307 | 307 | if ($this->storeAssociationCache($key, $association, $assocValue) === null) { |
308 | 308 | return false; |
@@ -342,9 +342,9 @@ discard block |
||
342 | 342 | $assocIdentifier = $unitOfWork->getEntityIdentifier($assocValue); |
343 | 343 | $entityKey = new EntityCacheKey($assocMetadata->getRootClassName(), $assocIdentifier); |
344 | 344 | |
345 | - if ((! $assocValue instanceof GhostObjectInterface && ($key->cacheMode & Cache::MODE_REFRESH)) || ! $assocRegion->contains($entityKey)) { |
|
345 | + if (( ! $assocValue instanceof GhostObjectInterface && ($key->cacheMode & Cache::MODE_REFRESH)) || ! $assocRegion->contains($entityKey)) { |
|
346 | 346 | // Entity put fail |
347 | - if (! $assocPersister->storeEntityCache($assocValue, $entityKey)) { |
|
347 | + if ( ! $assocPersister->storeEntityCache($assocValue, $entityKey)) { |
|
348 | 348 | return null; |
349 | 349 | } |
350 | 350 | } |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | |
365 | 365 | if (($key->cacheMode & Cache::MODE_REFRESH) || ! $assocRegion->contains($entityKey)) { |
366 | 366 | // Entity put fail |
367 | - if (! $assocPersister->storeEntityCache($assocItem, $entityKey)) { |
|
367 | + if ( ! $assocPersister->storeEntityCache($assocItem, $entityKey)) { |
|
368 | 368 | return null; |
369 | 369 | } |
370 | 370 | } |
@@ -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\Repository; |
6 | 6 | |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | string $associationFieldName |
14 | 14 | ) : self { |
15 | 15 | return new self( |
16 | - "You cannot search for the association field '" . $entityName . '#' . $associationFieldName . "', " . |
|
16 | + "You cannot search for the association field '".$entityName.'#'.$associationFieldName."', ". |
|
17 | 17 | 'because it is the inverse side of an association. Find methods only work on owning side associations.' |
18 | 18 | ); |
19 | 19 | } |
@@ -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\Repository; |
6 | 6 | |
@@ -14,13 +14,13 @@ discard block |
||
14 | 14 | string $method |
15 | 15 | ) : self { |
16 | 16 | return new self( |
17 | - "Entity '" . $entityName . "' has no field '" . $fieldName . "'. " . |
|
18 | - "You can therefore not call '" . $method . "' on the entities' repository." |
|
17 | + "Entity '".$entityName."' has no field '".$fieldName."'. ". |
|
18 | + "You can therefore not call '".$method."' on the entities' repository." |
|
19 | 19 | ); |
20 | 20 | } |
21 | 21 | |
22 | 22 | public static function onMissingParameter(string $methodName) : self |
23 | 23 | { |
24 | - return new self("You need to pass a parameter to '" . $methodName . "'"); |
|
24 | + return new self("You need to pass a parameter to '".$methodName."'"); |
|
25 | 25 | } |
26 | 26 | } |
@@ -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; |
6 | 6 | |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | |
342 | 342 | $this->computeChangeSets(); |
343 | 343 | |
344 | - if (! ($this->entityInsertions || |
|
344 | + if ( ! ($this->entityInsertions || |
|
345 | 345 | $this->entityDeletions || |
346 | 346 | $this->entityUpdates || |
347 | 347 | $this->collectionUpdates || |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | // Entity deletions come last and need to be in reverse commit order |
401 | 401 | if ($this->entityDeletions) { |
402 | 402 | foreach (array_reverse($commitOrder) as $committedEntityName) { |
403 | - if (! $this->entityDeletions) { |
|
403 | + if ( ! $this->entityDeletions) { |
|
404 | 404 | break; // just a performance optimisation |
405 | 405 | } |
406 | 406 | |
@@ -483,7 +483,7 @@ discard block |
||
483 | 483 | $oid = spl_object_id($entity); |
484 | 484 | $data = []; |
485 | 485 | |
486 | - if (! isset($this->entityChangeSets[$oid])) { |
|
486 | + if ( ! isset($this->entityChangeSets[$oid])) { |
|
487 | 487 | return $data; |
488 | 488 | } |
489 | 489 | |
@@ -564,12 +564,12 @@ discard block |
||
564 | 564 | || ! $class->getProperty($name) instanceof FieldMetadata |
565 | 565 | || ! $class->getProperty($name)->hasValueGenerator() |
566 | 566 | || $class->getProperty($name)->getValueGenerator()->getType() !== GeneratorType::IDENTITY |
567 | - ) && (! $class->isVersioned() || $name !== $class->versionProperty->getName())) { |
|
567 | + ) && ( ! $class->isVersioned() || $name !== $class->versionProperty->getName())) { |
|
568 | 568 | $actualData[$name] = $value; |
569 | 569 | } |
570 | 570 | } |
571 | 571 | |
572 | - if (! isset($this->originalEntityData[$oid])) { |
|
572 | + if ( ! isset($this->originalEntityData[$oid])) { |
|
573 | 573 | // Entity is either NEW or MANAGED but not yet fully persisted (only has an id). |
574 | 574 | // These result in an INSERT. |
575 | 575 | $this->originalEntityData[$oid] = $actualData; |
@@ -596,7 +596,7 @@ discard block |
||
596 | 596 | |
597 | 597 | foreach ($actualData as $propName => $actualValue) { |
598 | 598 | // skip field, its a partially omitted one! |
599 | - if (! (isset($originalData[$propName]) || array_key_exists($propName, $originalData))) { |
|
599 | + if ( ! (isset($originalData[$propName]) || array_key_exists($propName, $originalData))) { |
|
600 | 600 | continue; |
601 | 601 | } |
602 | 602 | |
@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | if ($owner === null) { // cloned |
619 | 619 | $actualValue->setOwner($entity, $property); |
620 | 620 | } elseif ($owner !== $entity) { // no clone, we have to fix |
621 | - if (! $actualValue->isInitialized()) { |
|
621 | + if ( ! $actualValue->isInitialized()) { |
|
622 | 622 | $actualValue->initialize(); // we have to do this otherwise the cols share state |
623 | 623 | } |
624 | 624 | |
@@ -656,7 +656,7 @@ discard block |
||
656 | 656 | // Check if original value exists |
657 | 657 | if ($orgValue instanceof PersistentCollection) { |
658 | 658 | // A PersistentCollection was de-referenced, so delete it. |
659 | - if (! $this->isCollectionScheduledForDeletion($orgValue)) { |
|
659 | + if ( ! $this->isCollectionScheduledForDeletion($orgValue)) { |
|
660 | 660 | $this->scheduleCollectionDeletion($orgValue); |
661 | 661 | |
662 | 662 | $changeSet[$propName] = $orgValue; // Signal changeset, to-many associations will be ignored |
@@ -679,7 +679,7 @@ discard block |
||
679 | 679 | |
680 | 680 | // Look for changes in associations of the entity |
681 | 681 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
682 | - if (! $property instanceof AssociationMetadata) { |
|
682 | + if ( ! $property instanceof AssociationMetadata) { |
|
683 | 683 | continue; |
684 | 684 | } |
685 | 685 | |
@@ -746,7 +746,7 @@ discard block |
||
746 | 746 | // Only MANAGED entities that are NOT SCHEDULED FOR INSERTION OR DELETION are processed here. |
747 | 747 | $oid = spl_object_id($entity); |
748 | 748 | |
749 | - if (! isset($this->entityInsertions[$oid]) && ! isset($this->entityDeletions[$oid]) && isset($this->entityStates[$oid])) { |
|
749 | + if ( ! isset($this->entityInsertions[$oid]) && ! isset($this->entityDeletions[$oid]) && isset($this->entityStates[$oid])) { |
|
750 | 750 | $this->computeChangeSet($class, $entity); |
751 | 751 | } |
752 | 752 | } |
@@ -783,13 +783,13 @@ discard block |
||
783 | 783 | $targetClass = $this->em->getClassMetadata($targetEntity); |
784 | 784 | |
785 | 785 | foreach ($unwrappedValue as $key => $entry) { |
786 | - if (! ($entry instanceof $targetEntity)) { |
|
786 | + if ( ! ($entry instanceof $targetEntity)) { |
|
787 | 787 | throw ORMInvalidArgumentException::invalidAssociation($targetClass, $association, $entry); |
788 | 788 | } |
789 | 789 | |
790 | 790 | $state = $this->getEntityState($entry, self::STATE_NEW); |
791 | 791 | |
792 | - if (! ($entry instanceof $targetEntity)) { |
|
792 | + if ( ! ($entry instanceof $targetEntity)) { |
|
793 | 793 | throw UnexpectedAssociationValue::create( |
794 | 794 | $association->getSourceEntity(), |
795 | 795 | $association->getName(), |
@@ -800,7 +800,7 @@ discard block |
||
800 | 800 | |
801 | 801 | switch ($state) { |
802 | 802 | case self::STATE_NEW: |
803 | - if (! in_array('persist', $association->getCascade(), true)) { |
|
803 | + if ( ! in_array('persist', $association->getCascade(), true)) { |
|
804 | 804 | $this->nonCascadedNewDetectedEntities[spl_object_id($entry)] = [$association, $entry]; |
805 | 805 | |
806 | 806 | break; |
@@ -849,7 +849,7 @@ discard block |
||
849 | 849 | $persister = $this->getEntityPersister($class->getClassName()); |
850 | 850 | $generationPlan->executeImmediate($this->em, $entity); |
851 | 851 | |
852 | - if (! $generationPlan->containsDeferred()) { |
|
852 | + if ( ! $generationPlan->containsDeferred()) { |
|
853 | 853 | $id = $this->em->getIdentifierFlattener()->flattenIdentifier($class, $persister->getIdentifier($entity)); |
854 | 854 | $this->entityIdentifiers[$oid] = $id; |
855 | 855 | } |
@@ -880,7 +880,7 @@ discard block |
||
880 | 880 | { |
881 | 881 | $oid = spl_object_id($entity); |
882 | 882 | |
883 | - if (! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) { |
|
883 | + if ( ! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) { |
|
884 | 884 | throw ORMInvalidArgumentException::entityNotManaged($entity); |
885 | 885 | } |
886 | 886 | |
@@ -902,7 +902,7 @@ discard block |
||
902 | 902 | break; |
903 | 903 | |
904 | 904 | case ($property instanceof FieldMetadata): |
905 | - if (! $property->isPrimaryKey() |
|
905 | + if ( ! $property->isPrimaryKey() |
|
906 | 906 | || ! $property->getValueGenerator() |
907 | 907 | || $property->getValueGenerator()->getType() !== GeneratorType::IDENTITY) { |
908 | 908 | $actualData[$name] = $property->getValue($entity); |
@@ -916,7 +916,7 @@ discard block |
||
916 | 916 | } |
917 | 917 | } |
918 | 918 | |
919 | - if (! isset($this->originalEntityData[$oid])) { |
|
919 | + if ( ! isset($this->originalEntityData[$oid])) { |
|
920 | 920 | throw new \RuntimeException('Cannot call recomputeSingleEntityChangeSet before computeChangeSet on an entity.'); |
921 | 921 | } |
922 | 922 | |
@@ -934,7 +934,7 @@ discard block |
||
934 | 934 | if ($changeSet) { |
935 | 935 | if (isset($this->entityChangeSets[$oid])) { |
936 | 936 | $this->entityChangeSets[$oid] = array_merge($this->entityChangeSets[$oid], $changeSet); |
937 | - } elseif (! isset($this->entityInsertions[$oid])) { |
|
937 | + } elseif ( ! isset($this->entityInsertions[$oid])) { |
|
938 | 938 | $this->entityChangeSets[$oid] = $changeSet; |
939 | 939 | $this->entityUpdates[$oid] = $entity; |
940 | 940 | } |
@@ -1004,7 +1004,7 @@ discard block |
||
1004 | 1004 | $this->recomputeSingleEntityChangeSet($class, $entity); |
1005 | 1005 | } |
1006 | 1006 | |
1007 | - if (! empty($this->entityChangeSets[$oid])) { |
|
1007 | + if ( ! empty($this->entityChangeSets[$oid])) { |
|
1008 | 1008 | // echo 'Update: '; |
1009 | 1009 | // \Doctrine\Common\Util\Debug::dump($this->entityChangeSets[$oid], 3); |
1010 | 1010 | |
@@ -1047,7 +1047,7 @@ discard block |
||
1047 | 1047 | // Entity with this $oid after deletion treated as NEW, even if the $oid |
1048 | 1048 | // is obtained by a new entity because the old one went out of scope. |
1049 | 1049 | //$this->entityStates[$oid] = self::STATE_NEW; |
1050 | - if (! $class->isIdentifierComposite()) { |
|
1050 | + if ( ! $class->isIdentifierComposite()) { |
|
1051 | 1051 | $property = $class->getProperty($class->getSingleIdentifierFieldName()); |
1052 | 1052 | |
1053 | 1053 | if ($property instanceof FieldMetadata && $property->hasValueGenerator()) { |
@@ -1094,13 +1094,13 @@ discard block |
||
1094 | 1094 | // Calculate dependencies for new nodes |
1095 | 1095 | while ($class = array_pop($newNodes)) { |
1096 | 1096 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
1097 | - if (! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) { |
|
1097 | + if ( ! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) { |
|
1098 | 1098 | continue; |
1099 | 1099 | } |
1100 | 1100 | |
1101 | 1101 | $targetClass = $this->em->getClassMetadata($property->getTargetEntity()); |
1102 | 1102 | |
1103 | - if (! $calc->hasNode($targetClass->getClassName())) { |
|
1103 | + if ( ! $calc->hasNode($targetClass->getClassName())) { |
|
1104 | 1104 | $calc->addNode($targetClass->getClassName(), $targetClass); |
1105 | 1105 | |
1106 | 1106 | $newNodes[] = $targetClass; |
@@ -1108,7 +1108,7 @@ discard block |
||
1108 | 1108 | |
1109 | 1109 | $weight = ! array_filter( |
1110 | 1110 | $property->getJoinColumns(), |
1111 | - function (JoinColumnMetadata $joinColumn) { |
|
1111 | + function(JoinColumnMetadata $joinColumn) { |
|
1112 | 1112 | return $joinColumn->isNullable(); |
1113 | 1113 | } |
1114 | 1114 | ); |
@@ -1116,14 +1116,14 @@ discard block |
||
1116 | 1116 | $calc->addDependency($targetClass->getClassName(), $class->getClassName(), $weight); |
1117 | 1117 | |
1118 | 1118 | // If the target class has mapped subclasses, these share the same dependency. |
1119 | - if (! $targetClass->getSubClasses()) { |
|
1119 | + if ( ! $targetClass->getSubClasses()) { |
|
1120 | 1120 | continue; |
1121 | 1121 | } |
1122 | 1122 | |
1123 | 1123 | foreach ($targetClass->getSubClasses() as $subClassName) { |
1124 | 1124 | $targetSubClass = $this->em->getClassMetadata($subClassName); |
1125 | 1125 | |
1126 | - if (! $calc->hasNode($subClassName)) { |
|
1126 | + if ( ! $calc->hasNode($subClassName)) { |
|
1127 | 1127 | $calc->addNode($targetSubClass->getClassName(), $targetSubClass); |
1128 | 1128 | |
1129 | 1129 | $newNodes[] = $targetSubClass; |
@@ -1199,7 +1199,7 @@ discard block |
||
1199 | 1199 | { |
1200 | 1200 | $oid = spl_object_id($entity); |
1201 | 1201 | |
1202 | - if (! isset($this->entityIdentifiers[$oid])) { |
|
1202 | + if ( ! isset($this->entityIdentifiers[$oid])) { |
|
1203 | 1203 | throw ORMInvalidArgumentException::entityHasNoIdentity($entity, 'scheduling for update'); |
1204 | 1204 | } |
1205 | 1205 | |
@@ -1207,7 +1207,7 @@ discard block |
||
1207 | 1207 | throw ORMInvalidArgumentException::entityIsRemoved($entity, 'schedule for update'); |
1208 | 1208 | } |
1209 | 1209 | |
1210 | - if (! isset($this->entityUpdates[$oid]) && ! isset($this->entityInsertions[$oid])) { |
|
1210 | + if ( ! isset($this->entityUpdates[$oid]) && ! isset($this->entityInsertions[$oid])) { |
|
1211 | 1211 | $this->entityUpdates[$oid] = $entity; |
1212 | 1212 | } |
1213 | 1213 | } |
@@ -1283,7 +1283,7 @@ discard block |
||
1283 | 1283 | return; // entity has not been persisted yet, so nothing more to do. |
1284 | 1284 | } |
1285 | 1285 | |
1286 | - if (! $this->isInIdentityMap($entity)) { |
|
1286 | + if ( ! $this->isInIdentityMap($entity)) { |
|
1287 | 1287 | return; |
1288 | 1288 | } |
1289 | 1289 | |
@@ -1291,7 +1291,7 @@ discard block |
||
1291 | 1291 | |
1292 | 1292 | unset($this->entityUpdates[$oid]); |
1293 | 1293 | |
1294 | - if (! isset($this->entityDeletions[$oid])) { |
|
1294 | + if ( ! isset($this->entityDeletions[$oid])) { |
|
1295 | 1295 | $this->entityDeletions[$oid] = $entity; |
1296 | 1296 | $this->entityStates[$oid] = self::STATE_REMOVED; |
1297 | 1297 | } |
@@ -1393,7 +1393,7 @@ discard block |
||
1393 | 1393 | $persister = $this->getEntityPersister($class->getClassName()); |
1394 | 1394 | $id = $persister->getIdentifier($entity); |
1395 | 1395 | |
1396 | - if (! $id) { |
|
1396 | + if ( ! $id) { |
|
1397 | 1397 | return self::STATE_NEW; |
1398 | 1398 | } |
1399 | 1399 | |
@@ -1753,7 +1753,7 @@ discard block |
||
1753 | 1753 | $class = $this->em->getClassMetadata(get_class($entity)); |
1754 | 1754 | |
1755 | 1755 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
1756 | - if (! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade(), true))) { |
|
1756 | + if ( ! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade(), true))) { |
|
1757 | 1757 | continue; |
1758 | 1758 | } |
1759 | 1759 | |
@@ -1800,7 +1800,7 @@ discard block |
||
1800 | 1800 | } |
1801 | 1801 | |
1802 | 1802 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
1803 | - if (! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade(), true))) { |
|
1803 | + if ( ! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade(), true))) { |
|
1804 | 1804 | continue; |
1805 | 1805 | } |
1806 | 1806 | |
@@ -1816,7 +1816,7 @@ discard block |
||
1816 | 1816 | |
1817 | 1817 | case ($relatedEntities instanceof Collection): |
1818 | 1818 | case (is_array($relatedEntities)): |
1819 | - if (! ($association instanceof ToManyAssociationMetadata)) { |
|
1819 | + if ( ! ($association instanceof ToManyAssociationMetadata)) { |
|
1820 | 1820 | throw ORMInvalidArgumentException::invalidAssociation( |
1821 | 1821 | $this->em->getClassMetadata($targetEntity), |
1822 | 1822 | $association, |
@@ -1831,7 +1831,7 @@ discard block |
||
1831 | 1831 | break; |
1832 | 1832 | |
1833 | 1833 | case ($relatedEntities !== null): |
1834 | - if (! $relatedEntities instanceof $targetEntity) { |
|
1834 | + if ( ! $relatedEntities instanceof $targetEntity) { |
|
1835 | 1835 | throw ORMInvalidArgumentException::invalidAssociation( |
1836 | 1836 | $this->em->getClassMetadata($targetEntity), |
1837 | 1837 | $association, |
@@ -1860,7 +1860,7 @@ discard block |
||
1860 | 1860 | $class = $this->em->getClassMetadata(get_class($entity)); |
1861 | 1861 | |
1862 | 1862 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
1863 | - if (! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade(), true))) { |
|
1863 | + if ( ! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade(), true))) { |
|
1864 | 1864 | continue; |
1865 | 1865 | } |
1866 | 1866 | |
@@ -1919,7 +1919,7 @@ discard block |
||
1919 | 1919 | |
1920 | 1920 | switch (true) { |
1921 | 1921 | case $lockMode === LockMode::OPTIMISTIC: |
1922 | - if (! $class->isVersioned()) { |
|
1922 | + if ( ! $class->isVersioned()) { |
|
1923 | 1923 | throw OptimisticLockException::notVersioned($class->getClassName()); |
1924 | 1924 | } |
1925 | 1925 | |
@@ -1942,7 +1942,7 @@ discard block |
||
1942 | 1942 | case $lockMode === LockMode::NONE: |
1943 | 1943 | case $lockMode === LockMode::PESSIMISTIC_READ: |
1944 | 1944 | case $lockMode === LockMode::PESSIMISTIC_WRITE: |
1945 | - if (! $this->em->getConnection()->isTransactionActive()) { |
|
1945 | + if ( ! $this->em->getConnection()->isTransactionActive()) { |
|
1946 | 1946 | throw TransactionRequiredException::transactionRequired(); |
1947 | 1947 | } |
1948 | 1948 | |
@@ -2101,7 +2101,7 @@ discard block |
||
2101 | 2101 | $entity->addPropertyChangedListener($this); |
2102 | 2102 | } |
2103 | 2103 | } else { |
2104 | - if (! isset($hints[Query::HINT_REFRESH]) |
|
2104 | + if ( ! isset($hints[Query::HINT_REFRESH]) |
|
2105 | 2105 | || (isset($hints[Query::HINT_REFRESH_ENTITY]) && $hints[Query::HINT_REFRESH_ENTITY] !== $entity)) { |
2106 | 2106 | return $entity; |
2107 | 2107 | } |
@@ -2149,7 +2149,7 @@ discard block |
||
2149 | 2149 | } |
2150 | 2150 | |
2151 | 2151 | foreach ($class->getDeclaredPropertiesIterator() as $field => $association) { |
2152 | - if (! ($association instanceof AssociationMetadata)) { |
|
2152 | + if ( ! ($association instanceof AssociationMetadata)) { |
|
2153 | 2153 | continue; |
2154 | 2154 | } |
2155 | 2155 | |
@@ -2198,7 +2198,7 @@ discard block |
||
2198 | 2198 | continue; |
2199 | 2199 | } |
2200 | 2200 | |
2201 | - if (! $association->isOwningSide()) { |
|
2201 | + if ( ! $association->isOwningSide()) { |
|
2202 | 2202 | // use the given entity association |
2203 | 2203 | if (isset($data[$field]) && is_object($data[$field]) && |
2204 | 2204 | isset($this->entityStates[spl_object_id($data[$field])])) { |
@@ -2248,7 +2248,7 @@ discard block |
||
2248 | 2248 | $associatedId[$targetField] = $joinColumnValue; |
2249 | 2249 | } |
2250 | 2250 | |
2251 | - if (! $associatedId) { |
|
2251 | + if ( ! $associatedId) { |
|
2252 | 2252 | // Foreign key is NULL |
2253 | 2253 | $association->setValue($entity, null); |
2254 | 2254 | $this->originalEntityData[$oid][$field] = null; |
@@ -2257,7 +2257,7 @@ discard block |
||
2257 | 2257 | } |
2258 | 2258 | |
2259 | 2259 | // @todo guilhermeblanco Can we remove the need of this somehow? |
2260 | - if (! isset($hints['fetchMode'][$class->getClassName()][$field])) { |
|
2260 | + if ( ! isset($hints['fetchMode'][$class->getClassName()][$field])) { |
|
2261 | 2261 | $hints['fetchMode'][$class->getClassName()][$field] = $association->getFetchMode(); |
2262 | 2262 | } |
2263 | 2263 | |
@@ -2274,7 +2274,7 @@ discard block |
||
2274 | 2274 | // If this is an uninitialized proxy, we are deferring eager loads, |
2275 | 2275 | // this association is marked as eager fetch, and its an uninitialized proxy (wtf!) |
2276 | 2276 | // then we can append this entity for eager loading! |
2277 | - if (! $targetClass->isIdentifierComposite() && |
|
2277 | + if ( ! $targetClass->isIdentifierComposite() && |
|
2278 | 2278 | $newValue instanceof GhostObjectInterface && |
2279 | 2279 | isset($hints[self::HINT_DEFEREAGERLOAD]) && |
2280 | 2280 | $hints['fetchMode'][$class->getClassName()][$field] === FetchMode::EAGER && |
@@ -2357,7 +2357,7 @@ discard block |
||
2357 | 2357 | |
2358 | 2358 | public function triggerEagerLoads() |
2359 | 2359 | { |
2360 | - if (! $this->eagerLoadingEntities) { |
|
2360 | + if ( ! $this->eagerLoadingEntities) { |
|
2361 | 2361 | return; |
2362 | 2362 | } |
2363 | 2363 | |
@@ -2366,7 +2366,7 @@ discard block |
||
2366 | 2366 | $this->eagerLoadingEntities = []; |
2367 | 2367 | |
2368 | 2368 | foreach ($eagerLoadingEntities as $entityName => $ids) { |
2369 | - if (! $ids) { |
|
2369 | + if ( ! $ids) { |
|
2370 | 2370 | continue; |
2371 | 2371 | } |
2372 | 2372 | |
@@ -2664,7 +2664,7 @@ discard block |
||
2664 | 2664 | { |
2665 | 2665 | $class = $this->em->getClassMetadata(get_class($entity)); |
2666 | 2666 | |
2667 | - if (! $class->getProperty($propertyName)) { |
|
2667 | + if ( ! $class->getProperty($propertyName)) { |
|
2668 | 2668 | return; // ignore non-persistent fields |
2669 | 2669 | } |
2670 | 2670 | |
@@ -2673,7 +2673,7 @@ discard block |
||
2673 | 2673 | // Update changeset and mark entity for synchronization |
2674 | 2674 | $this->entityChangeSets[$oid][$propertyName] = [$oldValue, $newValue]; |
2675 | 2675 | |
2676 | - if (! isset($this->scheduledForSynchronization[$class->getRootClassName()][$oid])) { |
|
2676 | + if ( ! isset($this->scheduledForSynchronization[$class->getRootClassName()][$oid])) { |
|
2677 | 2677 | $this->scheduleForSynchronization($entity); |
2678 | 2678 | } |
2679 | 2679 | } |
@@ -2755,7 +2755,7 @@ discard block |
||
2755 | 2755 | */ |
2756 | 2756 | private static function objToStr($obj) |
2757 | 2757 | { |
2758 | - return method_exists($obj, '__toString') ? (string) $obj : get_class($obj) . '@' . spl_object_id($obj); |
|
2758 | + return method_exists($obj, '__toString') ? (string) $obj : get_class($obj).'@'.spl_object_id($obj); |
|
2759 | 2759 | } |
2760 | 2760 | |
2761 | 2761 | /** |
@@ -2770,7 +2770,7 @@ discard block |
||
2770 | 2770 | */ |
2771 | 2771 | public function markReadOnly($object) |
2772 | 2772 | { |
2773 | - if (! is_object($object) || ! $this->isInIdentityMap($object)) { |
|
2773 | + if ( ! is_object($object) || ! $this->isInIdentityMap($object)) { |
|
2774 | 2774 | throw ORMInvalidArgumentException::readOnlyRequiresManagedEntity($object); |
2775 | 2775 | } |
2776 | 2776 | |
@@ -2788,7 +2788,7 @@ discard block |
||
2788 | 2788 | */ |
2789 | 2789 | public function isReadOnly($object) |
2790 | 2790 | { |
2791 | - if (! is_object($object)) { |
|
2791 | + if ( ! is_object($object)) { |
|
2792 | 2792 | throw ORMInvalidArgumentException::readOnlyRequiresManagedEntity($object); |
2793 | 2793 | } |
2794 | 2794 | |
@@ -2800,7 +2800,7 @@ discard block |
||
2800 | 2800 | */ |
2801 | 2801 | private function afterTransactionComplete() |
2802 | 2802 | { |
2803 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
2803 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
2804 | 2804 | $persister->afterTransactionComplete(); |
2805 | 2805 | }); |
2806 | 2806 | } |
@@ -2810,7 +2810,7 @@ discard block |
||
2810 | 2810 | */ |
2811 | 2811 | private function afterTransactionRolledBack() |
2812 | 2812 | { |
2813 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
2813 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
2814 | 2814 | $persister->afterTransactionRolledBack(); |
2815 | 2815 | }); |
2816 | 2816 | } |
@@ -2820,7 +2820,7 @@ discard block |
||
2820 | 2820 | */ |
2821 | 2821 | private function performCallbackOnCachedPersister(callable $callback) |
2822 | 2822 | { |
2823 | - if (! $this->hasCache) { |
|
2823 | + if ( ! $this->hasCache) { |
|
2824 | 2824 | return; |
2825 | 2825 | } |
2826 | 2826 |