@@ -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\Tools\Console\Command\ClearCache; |
6 | 6 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $em = $this->getHelper('em')->getEntityManager(); |
56 | 56 | $cacheDriver = $em->getConfiguration()->getQueryCacheImpl(); |
57 | 57 | |
58 | - if (! $cacheDriver) { |
|
58 | + if ( ! $cacheDriver) { |
|
59 | 59 | throw new \InvalidArgumentException('No Query cache driver is configured on given EntityManager.'); |
60 | 60 | } |
61 | 61 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $message = ($result) ? 'Successfully flushed cache entries.' : $message; |
77 | 77 | } |
78 | 78 | |
79 | - if (! $result) { |
|
79 | + if ( ! $result) { |
|
80 | 80 | $ui->error($message); |
81 | 81 | |
82 | 82 | return 1; |
@@ -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\Tools\Console\Command\ClearCache; |
6 | 6 | |
@@ -68,18 +68,18 @@ discard block |
||
68 | 68 | $entityId = $input->getArgument('entity-id'); |
69 | 69 | $cache = $em->getCache(); |
70 | 70 | |
71 | - if (! $cache instanceof Cache) { |
|
71 | + if ( ! $cache instanceof Cache) { |
|
72 | 72 | throw new \InvalidArgumentException('No second-level cache is configured on the given EntityManager.'); |
73 | 73 | } |
74 | 74 | |
75 | - if (! $entityClass && ! $input->getOption('all')) { |
|
75 | + if ( ! $entityClass && ! $input->getOption('all')) { |
|
76 | 76 | throw new \InvalidArgumentException('Invalid argument "--entity-class"'); |
77 | 77 | } |
78 | 78 | |
79 | 79 | if ($input->getOption('flush')) { |
80 | 80 | $entityRegion = $cache->getEntityCacheRegion($entityClass); |
81 | 81 | |
82 | - if (! $entityRegion instanceof DefaultRegion) { |
|
82 | + if ( ! $entityRegion instanceof DefaultRegion) { |
|
83 | 83 | throw new \InvalidArgumentException(sprintf( |
84 | 84 | 'The option "--flush" expects a "Doctrine\ORM\Cache\Region\DefaultRegion", but got "%s".', |
85 | 85 | is_object($entityRegion) ? get_class($entityRegion) : gettype($entityRegion) |
@@ -21,13 +21,13 @@ discard block |
||
21 | 21 | protected function configure() |
22 | 22 | { |
23 | 23 | $this->setName('orm:info') |
24 | - ->setDescription('Show basic information about all mapped entities') |
|
25 | - ->setHelp(<<<'EOT' |
|
24 | + ->setDescription('Show basic information about all mapped entities') |
|
25 | + ->setHelp(<<<'EOT' |
|
26 | 26 | The <info>%command.name%</info> shows basic information about which |
27 | 27 | entities exist and possibly if their mapping information contains errors or |
28 | 28 | not. |
29 | 29 | EOT |
30 | - ); |
|
30 | + ); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | $entityManager = $this->getHelper('em')->getEntityManager(); |
42 | 42 | |
43 | 43 | $entityClassNames = $entityManager->getConfiguration() |
44 | - ->getMetadataDriverImpl() |
|
45 | - ->getAllClassNames(); |
|
44 | + ->getMetadataDriverImpl() |
|
45 | + ->getAllClassNames(); |
|
46 | 46 | |
47 | 47 | if (! $entityClassNames) { |
48 | 48 | $ui->caution( |
@@ -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\Tools\Console\Command; |
6 | 6 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | ->getMetadataDriverImpl() |
45 | 45 | ->getAllClassNames(); |
46 | 46 | |
47 | - if (! $entityClassNames) { |
|
47 | + if ( ! $entityClassNames) { |
|
48 | 48 | $ui->caution( |
49 | 49 | [ |
50 | 50 | 'You do not have any mapped Doctrine ORM entities according to the current configuration.', |
@@ -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\Tools\Console; |
6 | 6 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $metadata = $it->current(); |
55 | 55 | |
56 | 56 | foreach ($this->filter as $filter) { |
57 | - $pregResult = preg_match('/' . $filter . '/', $metadata->getClassName()); |
|
57 | + $pregResult = preg_match('/'.$filter.'/', $metadata->getClassName()); |
|
58 | 58 | |
59 | 59 | if ($pregResult === false) { |
60 | 60 | throw new \RuntimeException( |
@@ -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\Tools; |
6 | 6 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | /** @var \Doctrine\ORM\Mapping\ClassMetadata $metadata */ |
43 | 43 | $metadata = $event->getClassMetadata(); |
44 | 44 | |
45 | - if (! isset($this->entityListeners[$metadata->getClassName()])) { |
|
45 | + if ( ! isset($this->entityListeners[$metadata->getClassName()])) { |
|
46 | 46 | return; |
47 | 47 | } |
48 | 48 |
@@ -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 | |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | |
88 | 88 | public function getNamingStrategy() : NamingStrategy |
89 | 89 | { |
90 | - if (! $this->namingStrategy) { |
|
90 | + if ( ! $this->namingStrategy) { |
|
91 | 91 | $this->namingStrategy = new DefaultNamingStrategy(); |
92 | 92 | } |
93 | 93 |
@@ -1,54 +1,54 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | -require_once __DIR__ . '/Annotation.php'; |
|
6 | -require_once __DIR__ . '/AssociationOverride.php'; |
|
7 | -require_once __DIR__ . '/AssociationOverrides.php'; |
|
8 | -require_once __DIR__ . '/AttributeOverride.php'; |
|
9 | -require_once __DIR__ . '/AttributeOverrides.php'; |
|
10 | -require_once __DIR__ . '/Cache.php'; |
|
11 | -require_once __DIR__ . '/ChangeTrackingPolicy.php'; |
|
12 | -require_once __DIR__ . '/Column.php'; |
|
13 | -require_once __DIR__ . '/ColumnResult.php'; |
|
14 | -require_once __DIR__ . '/CustomIdGenerator.php'; |
|
15 | -require_once __DIR__ . '/DiscriminatorColumn.php'; |
|
16 | -require_once __DIR__ . '/DiscriminatorMap.php'; |
|
17 | -require_once __DIR__ . '/Embeddable.php'; |
|
18 | -require_once __DIR__ . '/Embedded.php'; |
|
19 | -require_once __DIR__ . '/Entity.php'; |
|
20 | -require_once __DIR__ . '/EntityListeners.php'; |
|
21 | -require_once __DIR__ . '/EntityResult.php'; |
|
22 | -require_once __DIR__ . '/FieldResult.php'; |
|
23 | -require_once __DIR__ . '/GeneratedValue.php'; |
|
24 | -require_once __DIR__ . '/HasLifecycleCallbacks.php'; |
|
25 | -require_once __DIR__ . '/Id.php'; |
|
26 | -require_once __DIR__ . '/Index.php'; |
|
27 | -require_once __DIR__ . '/InheritanceType.php'; |
|
28 | -require_once __DIR__ . '/JoinColumn.php'; |
|
29 | -require_once __DIR__ . '/JoinColumns.php'; |
|
30 | -require_once __DIR__ . '/JoinTable.php'; |
|
31 | -require_once __DIR__ . '/ManyToMany.php'; |
|
32 | -require_once __DIR__ . '/ManyToOne.php'; |
|
33 | -require_once __DIR__ . '/MappedSuperclass.php'; |
|
34 | -require_once __DIR__ . '/NamedNativeQueries.php'; |
|
35 | -require_once __DIR__ . '/NamedNativeQuery.php'; |
|
36 | -require_once __DIR__ . '/NamedQueries.php'; |
|
37 | -require_once __DIR__ . '/NamedQuery.php'; |
|
38 | -require_once __DIR__ . '/OneToMany.php'; |
|
39 | -require_once __DIR__ . '/OneToOne.php'; |
|
40 | -require_once __DIR__ . '/OrderBy.php'; |
|
41 | -require_once __DIR__ . '/PrePersist.php'; |
|
42 | -require_once __DIR__ . '/PostLoad.php'; |
|
43 | -require_once __DIR__ . '/PostPersist.php'; |
|
44 | -require_once __DIR__ . '/PostRemove.php'; |
|
45 | -require_once __DIR__ . '/PostUpdate.php'; |
|
46 | -require_once __DIR__ . '/PreFlush.php'; |
|
47 | -require_once __DIR__ . '/PreRemove.php'; |
|
48 | -require_once __DIR__ . '/PreUpdate.php'; |
|
49 | -require_once __DIR__ . '/SequenceGenerator.php'; |
|
50 | -require_once __DIR__ . '/SqlResultSetMapping.php'; |
|
51 | -require_once __DIR__ . '/SqlResultSetMappings.php'; |
|
52 | -require_once __DIR__ . '/Table.php'; |
|
53 | -require_once __DIR__ . '/UniqueConstraint.php'; |
|
54 | -require_once __DIR__ . '/Version.php'; |
|
5 | +require_once __DIR__.'/Annotation.php'; |
|
6 | +require_once __DIR__.'/AssociationOverride.php'; |
|
7 | +require_once __DIR__.'/AssociationOverrides.php'; |
|
8 | +require_once __DIR__.'/AttributeOverride.php'; |
|
9 | +require_once __DIR__.'/AttributeOverrides.php'; |
|
10 | +require_once __DIR__.'/Cache.php'; |
|
11 | +require_once __DIR__.'/ChangeTrackingPolicy.php'; |
|
12 | +require_once __DIR__.'/Column.php'; |
|
13 | +require_once __DIR__.'/ColumnResult.php'; |
|
14 | +require_once __DIR__.'/CustomIdGenerator.php'; |
|
15 | +require_once __DIR__.'/DiscriminatorColumn.php'; |
|
16 | +require_once __DIR__.'/DiscriminatorMap.php'; |
|
17 | +require_once __DIR__.'/Embeddable.php'; |
|
18 | +require_once __DIR__.'/Embedded.php'; |
|
19 | +require_once __DIR__.'/Entity.php'; |
|
20 | +require_once __DIR__.'/EntityListeners.php'; |
|
21 | +require_once __DIR__.'/EntityResult.php'; |
|
22 | +require_once __DIR__.'/FieldResult.php'; |
|
23 | +require_once __DIR__.'/GeneratedValue.php'; |
|
24 | +require_once __DIR__.'/HasLifecycleCallbacks.php'; |
|
25 | +require_once __DIR__.'/Id.php'; |
|
26 | +require_once __DIR__.'/Index.php'; |
|
27 | +require_once __DIR__.'/InheritanceType.php'; |
|
28 | +require_once __DIR__.'/JoinColumn.php'; |
|
29 | +require_once __DIR__.'/JoinColumns.php'; |
|
30 | +require_once __DIR__.'/JoinTable.php'; |
|
31 | +require_once __DIR__.'/ManyToMany.php'; |
|
32 | +require_once __DIR__.'/ManyToOne.php'; |
|
33 | +require_once __DIR__.'/MappedSuperclass.php'; |
|
34 | +require_once __DIR__.'/NamedNativeQueries.php'; |
|
35 | +require_once __DIR__.'/NamedNativeQuery.php'; |
|
36 | +require_once __DIR__.'/NamedQueries.php'; |
|
37 | +require_once __DIR__.'/NamedQuery.php'; |
|
38 | +require_once __DIR__.'/OneToMany.php'; |
|
39 | +require_once __DIR__.'/OneToOne.php'; |
|
40 | +require_once __DIR__.'/OrderBy.php'; |
|
41 | +require_once __DIR__.'/PrePersist.php'; |
|
42 | +require_once __DIR__.'/PostLoad.php'; |
|
43 | +require_once __DIR__.'/PostPersist.php'; |
|
44 | +require_once __DIR__.'/PostRemove.php'; |
|
45 | +require_once __DIR__.'/PostUpdate.php'; |
|
46 | +require_once __DIR__.'/PreFlush.php'; |
|
47 | +require_once __DIR__.'/PreRemove.php'; |
|
48 | +require_once __DIR__.'/PreUpdate.php'; |
|
49 | +require_once __DIR__.'/SequenceGenerator.php'; |
|
50 | +require_once __DIR__.'/SqlResultSetMapping.php'; |
|
51 | +require_once __DIR__.'/SqlResultSetMappings.php'; |
|
52 | +require_once __DIR__.'/Table.php'; |
|
53 | +require_once __DIR__.'/UniqueConstraint.php'; |
|
54 | +require_once __DIR__.'/Version.php'; |
@@ -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 | |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | |
322 | 322 | $this->computeChangeSets(); |
323 | 323 | |
324 | - if (! ($this->entityInsertions || |
|
324 | + if ( ! ($this->entityInsertions || |
|
325 | 325 | $this->entityDeletions || |
326 | 326 | $this->entityUpdates || |
327 | 327 | $this->collectionUpdates || |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | // Entity deletions come last and need to be in reverse commit order |
381 | 381 | if ($this->entityDeletions) { |
382 | 382 | foreach (array_reverse($commitOrder) as $committedEntityName) { |
383 | - if (! $this->entityDeletions) { |
|
383 | + if ( ! $this->entityDeletions) { |
|
384 | 384 | break; // just a performance optimisation |
385 | 385 | } |
386 | 386 | |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | $oid = spl_object_id($entity); |
464 | 464 | $data = []; |
465 | 465 | |
466 | - if (! isset($this->entityChangeSets[$oid])) { |
|
466 | + if ( ! isset($this->entityChangeSets[$oid])) { |
|
467 | 467 | return $data; |
468 | 468 | } |
469 | 469 | |
@@ -544,12 +544,12 @@ discard block |
||
544 | 544 | || ! $class->getProperty($name) instanceof FieldMetadata |
545 | 545 | || ! $class->getProperty($name)->hasValueGenerator() |
546 | 546 | || $class->getProperty($name)->getValueGenerator()->getType() !== GeneratorType::IDENTITY |
547 | - ) && (! $class->isVersioned() || $name !== $class->versionProperty->getName())) { |
|
547 | + ) && ( ! $class->isVersioned() || $name !== $class->versionProperty->getName())) { |
|
548 | 548 | $actualData[$name] = $value; |
549 | 549 | } |
550 | 550 | } |
551 | 551 | |
552 | - if (! isset($this->originalEntityData[$oid])) { |
|
552 | + if ( ! isset($this->originalEntityData[$oid])) { |
|
553 | 553 | // Entity is either NEW or MANAGED but not yet fully persisted (only has an id). |
554 | 554 | // These result in an INSERT. |
555 | 555 | $this->originalEntityData[$oid] = $actualData; |
@@ -576,7 +576,7 @@ discard block |
||
576 | 576 | |
577 | 577 | foreach ($actualData as $propName => $actualValue) { |
578 | 578 | // skip field, its a partially omitted one! |
579 | - if (! (isset($originalData[$propName]) || array_key_exists($propName, $originalData))) { |
|
579 | + if ( ! (isset($originalData[$propName]) || array_key_exists($propName, $originalData))) { |
|
580 | 580 | continue; |
581 | 581 | } |
582 | 582 | |
@@ -598,7 +598,7 @@ discard block |
||
598 | 598 | if ($owner === null) { // cloned |
599 | 599 | $actualValue->setOwner($entity, $property); |
600 | 600 | } elseif ($owner !== $entity) { // no clone, we have to fix |
601 | - if (! $actualValue->isInitialized()) { |
|
601 | + if ( ! $actualValue->isInitialized()) { |
|
602 | 602 | $actualValue->initialize(); // we have to do this otherwise the cols share state |
603 | 603 | } |
604 | 604 | |
@@ -636,7 +636,7 @@ discard block |
||
636 | 636 | // Check if original value exists |
637 | 637 | if ($orgValue instanceof PersistentCollection) { |
638 | 638 | // A PersistentCollection was de-referenced, so delete it. |
639 | - if (! $this->isCollectionScheduledForDeletion($orgValue)) { |
|
639 | + if ( ! $this->isCollectionScheduledForDeletion($orgValue)) { |
|
640 | 640 | $this->scheduleCollectionDeletion($orgValue); |
641 | 641 | |
642 | 642 | $changeSet[$propName] = $orgValue; // Signal changeset, to-many associations will be ignored |
@@ -659,7 +659,7 @@ discard block |
||
659 | 659 | |
660 | 660 | // Look for changes in associations of the entity |
661 | 661 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
662 | - if (! $property instanceof AssociationMetadata) { |
|
662 | + if ( ! $property instanceof AssociationMetadata) { |
|
663 | 663 | continue; |
664 | 664 | } |
665 | 665 | |
@@ -726,7 +726,7 @@ discard block |
||
726 | 726 | // Only MANAGED entities that are NOT SCHEDULED FOR INSERTION OR DELETION are processed here. |
727 | 727 | $oid = spl_object_id($entity); |
728 | 728 | |
729 | - if (! isset($this->entityInsertions[$oid]) && ! isset($this->entityDeletions[$oid]) && isset($this->entityStates[$oid])) { |
|
729 | + if ( ! isset($this->entityInsertions[$oid]) && ! isset($this->entityDeletions[$oid]) && isset($this->entityStates[$oid])) { |
|
730 | 730 | $this->computeChangeSet($class, $entity); |
731 | 731 | } |
732 | 732 | } |
@@ -763,13 +763,13 @@ discard block |
||
763 | 763 | $targetClass = $this->em->getClassMetadata($targetEntity); |
764 | 764 | |
765 | 765 | foreach ($unwrappedValue as $key => $entry) { |
766 | - if (! ($entry instanceof $targetEntity)) { |
|
766 | + if ( ! ($entry instanceof $targetEntity)) { |
|
767 | 767 | throw ORMInvalidArgumentException::invalidAssociation($targetClass, $association, $entry); |
768 | 768 | } |
769 | 769 | |
770 | 770 | $state = $this->getEntityState($entry, self::STATE_NEW); |
771 | 771 | |
772 | - if (! ($entry instanceof $targetEntity)) { |
|
772 | + if ( ! ($entry instanceof $targetEntity)) { |
|
773 | 773 | throw ORMException::unexpectedAssociationValue( |
774 | 774 | $association->getSourceEntity(), |
775 | 775 | $association->getName(), |
@@ -780,7 +780,7 @@ discard block |
||
780 | 780 | |
781 | 781 | switch ($state) { |
782 | 782 | case self::STATE_NEW: |
783 | - if (! in_array('persist', $association->getCascade())) { |
|
783 | + if ( ! in_array('persist', $association->getCascade())) { |
|
784 | 784 | $this->nonCascadedNewDetectedEntities[\spl_object_id($entry)] = [$association, $entry]; |
785 | 785 | |
786 | 786 | break; |
@@ -829,7 +829,7 @@ discard block |
||
829 | 829 | $persister = $this->getEntityPersister($class->getClassName()); |
830 | 830 | $generationPlan->executeImmediate($this->em, $entity); |
831 | 831 | |
832 | - if (! $generationPlan->containsDeferred()) { |
|
832 | + if ( ! $generationPlan->containsDeferred()) { |
|
833 | 833 | $id = $this->em->getIdentifierFlattener()->flattenIdentifier($class, $persister->getIdentifier($entity)); |
834 | 834 | $this->entityIdentifiers[$oid] = $id; |
835 | 835 | } |
@@ -860,7 +860,7 @@ discard block |
||
860 | 860 | { |
861 | 861 | $oid = spl_object_id($entity); |
862 | 862 | |
863 | - if (! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) { |
|
863 | + if ( ! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) { |
|
864 | 864 | throw ORMInvalidArgumentException::entityNotManaged($entity); |
865 | 865 | } |
866 | 866 | |
@@ -882,7 +882,7 @@ discard block |
||
882 | 882 | break; |
883 | 883 | |
884 | 884 | case ($property instanceof FieldMetadata): |
885 | - if (! $property->isPrimaryKey() |
|
885 | + if ( ! $property->isPrimaryKey() |
|
886 | 886 | || ! $property->getValueGenerator() |
887 | 887 | || $property->getValueGenerator()->getType() !== GeneratorType::IDENTITY) { |
888 | 888 | $actualData[$name] = $property->getValue($entity); |
@@ -896,7 +896,7 @@ discard block |
||
896 | 896 | } |
897 | 897 | } |
898 | 898 | |
899 | - if (! isset($this->originalEntityData[$oid])) { |
|
899 | + if ( ! isset($this->originalEntityData[$oid])) { |
|
900 | 900 | throw new \RuntimeException('Cannot call recomputeSingleEntityChangeSet before computeChangeSet on an entity.'); |
901 | 901 | } |
902 | 902 | |
@@ -914,7 +914,7 @@ discard block |
||
914 | 914 | if ($changeSet) { |
915 | 915 | if (isset($this->entityChangeSets[$oid])) { |
916 | 916 | $this->entityChangeSets[$oid] = array_merge($this->entityChangeSets[$oid], $changeSet); |
917 | - } elseif (! isset($this->entityInsertions[$oid])) { |
|
917 | + } elseif ( ! isset($this->entityInsertions[$oid])) { |
|
918 | 918 | $this->entityChangeSets[$oid] = $changeSet; |
919 | 919 | $this->entityUpdates[$oid] = $entity; |
920 | 920 | } |
@@ -984,7 +984,7 @@ discard block |
||
984 | 984 | $this->recomputeSingleEntityChangeSet($class, $entity); |
985 | 985 | } |
986 | 986 | |
987 | - if (! empty($this->entityChangeSets[$oid])) { |
|
987 | + if ( ! empty($this->entityChangeSets[$oid])) { |
|
988 | 988 | // echo 'Update: '; |
989 | 989 | // \Doctrine\Common\Util\Debug::dump($this->entityChangeSets[$oid], 3); |
990 | 990 | |
@@ -1027,7 +1027,7 @@ discard block |
||
1027 | 1027 | // Entity with this $oid after deletion treated as NEW, even if the $oid |
1028 | 1028 | // is obtained by a new entity because the old one went out of scope. |
1029 | 1029 | //$this->entityStates[$oid] = self::STATE_NEW; |
1030 | - if (! $class->isIdentifierComposite()) { |
|
1030 | + if ( ! $class->isIdentifierComposite()) { |
|
1031 | 1031 | $property = $class->getProperty($class->getSingleIdentifierFieldName()); |
1032 | 1032 | |
1033 | 1033 | if ($property instanceof FieldMetadata && $property->hasValueGenerator()) { |
@@ -1074,13 +1074,13 @@ discard block |
||
1074 | 1074 | // Calculate dependencies for new nodes |
1075 | 1075 | while ($class = array_pop($newNodes)) { |
1076 | 1076 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
1077 | - if (! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) { |
|
1077 | + if ( ! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) { |
|
1078 | 1078 | continue; |
1079 | 1079 | } |
1080 | 1080 | |
1081 | 1081 | $targetClass = $this->em->getClassMetadata($property->getTargetEntity()); |
1082 | 1082 | |
1083 | - if (! $calc->hasNode($targetClass->getClassName())) { |
|
1083 | + if ( ! $calc->hasNode($targetClass->getClassName())) { |
|
1084 | 1084 | $calc->addNode($targetClass->getClassName(), $targetClass); |
1085 | 1085 | |
1086 | 1086 | $newNodes[] = $targetClass; |
@@ -1088,7 +1088,7 @@ discard block |
||
1088 | 1088 | |
1089 | 1089 | $weight = ! array_filter( |
1090 | 1090 | $property->getJoinColumns(), |
1091 | - function (JoinColumnMetadata $joinColumn) { |
|
1091 | + function(JoinColumnMetadata $joinColumn) { |
|
1092 | 1092 | return $joinColumn->isNullable(); |
1093 | 1093 | } |
1094 | 1094 | ); |
@@ -1096,14 +1096,14 @@ discard block |
||
1096 | 1096 | $calc->addDependency($targetClass->getClassName(), $class->getClassName(), $weight); |
1097 | 1097 | |
1098 | 1098 | // If the target class has mapped subclasses, these share the same dependency. |
1099 | - if (! $targetClass->getSubClasses()) { |
|
1099 | + if ( ! $targetClass->getSubClasses()) { |
|
1100 | 1100 | continue; |
1101 | 1101 | } |
1102 | 1102 | |
1103 | 1103 | foreach ($targetClass->getSubClasses() as $subClassName) { |
1104 | 1104 | $targetSubClass = $this->em->getClassMetadata($subClassName); |
1105 | 1105 | |
1106 | - if (! $calc->hasNode($subClassName)) { |
|
1106 | + if ( ! $calc->hasNode($subClassName)) { |
|
1107 | 1107 | $calc->addNode($targetSubClass->getClassName(), $targetSubClass); |
1108 | 1108 | |
1109 | 1109 | $newNodes[] = $targetSubClass; |
@@ -1179,7 +1179,7 @@ discard block |
||
1179 | 1179 | { |
1180 | 1180 | $oid = spl_object_id($entity); |
1181 | 1181 | |
1182 | - if (! isset($this->entityIdentifiers[$oid])) { |
|
1182 | + if ( ! isset($this->entityIdentifiers[$oid])) { |
|
1183 | 1183 | throw ORMInvalidArgumentException::entityHasNoIdentity($entity, 'scheduling for update'); |
1184 | 1184 | } |
1185 | 1185 | |
@@ -1187,7 +1187,7 @@ discard block |
||
1187 | 1187 | throw ORMInvalidArgumentException::entityIsRemoved($entity, 'schedule for update'); |
1188 | 1188 | } |
1189 | 1189 | |
1190 | - if (! isset($this->entityUpdates[$oid]) && ! isset($this->entityInsertions[$oid])) { |
|
1190 | + if ( ! isset($this->entityUpdates[$oid]) && ! isset($this->entityInsertions[$oid])) { |
|
1191 | 1191 | $this->entityUpdates[$oid] = $entity; |
1192 | 1192 | } |
1193 | 1193 | } |
@@ -1263,7 +1263,7 @@ discard block |
||
1263 | 1263 | return; // entity has not been persisted yet, so nothing more to do. |
1264 | 1264 | } |
1265 | 1265 | |
1266 | - if (! $this->isInIdentityMap($entity)) { |
|
1266 | + if ( ! $this->isInIdentityMap($entity)) { |
|
1267 | 1267 | return; |
1268 | 1268 | } |
1269 | 1269 | |
@@ -1271,7 +1271,7 @@ discard block |
||
1271 | 1271 | |
1272 | 1272 | unset($this->entityUpdates[$oid]); |
1273 | 1273 | |
1274 | - if (! isset($this->entityDeletions[$oid])) { |
|
1274 | + if ( ! isset($this->entityDeletions[$oid])) { |
|
1275 | 1275 | $this->entityDeletions[$oid] = $entity; |
1276 | 1276 | $this->entityStates[$oid] = self::STATE_REMOVED; |
1277 | 1277 | } |
@@ -1373,7 +1373,7 @@ discard block |
||
1373 | 1373 | $persister = $this->getEntityPersister($class->getClassName()); |
1374 | 1374 | $id = $persister->getIdentifier($entity); |
1375 | 1375 | |
1376 | - if (! $id) { |
|
1376 | + if ( ! $id) { |
|
1377 | 1377 | return self::STATE_NEW; |
1378 | 1378 | } |
1379 | 1379 | |
@@ -1733,7 +1733,7 @@ discard block |
||
1733 | 1733 | $class = $this->em->getClassMetadata(get_class($entity)); |
1734 | 1734 | |
1735 | 1735 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
1736 | - if (! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade()))) { |
|
1736 | + if ( ! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade()))) { |
|
1737 | 1737 | continue; |
1738 | 1738 | } |
1739 | 1739 | |
@@ -1780,7 +1780,7 @@ discard block |
||
1780 | 1780 | } |
1781 | 1781 | |
1782 | 1782 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
1783 | - if (! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade()))) { |
|
1783 | + if ( ! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade()))) { |
|
1784 | 1784 | continue; |
1785 | 1785 | } |
1786 | 1786 | |
@@ -1796,7 +1796,7 @@ discard block |
||
1796 | 1796 | |
1797 | 1797 | case ($relatedEntities instanceof Collection): |
1798 | 1798 | case (is_array($relatedEntities)): |
1799 | - if (! ($association instanceof ToManyAssociationMetadata)) { |
|
1799 | + if ( ! ($association instanceof ToManyAssociationMetadata)) { |
|
1800 | 1800 | throw ORMInvalidArgumentException::invalidAssociation( |
1801 | 1801 | $this->em->getClassMetadata($targetEntity), |
1802 | 1802 | $association, |
@@ -1811,7 +1811,7 @@ discard block |
||
1811 | 1811 | break; |
1812 | 1812 | |
1813 | 1813 | case ($relatedEntities !== null): |
1814 | - if (! $relatedEntities instanceof $targetEntity) { |
|
1814 | + if ( ! $relatedEntities instanceof $targetEntity) { |
|
1815 | 1815 | throw ORMInvalidArgumentException::invalidAssociation( |
1816 | 1816 | $this->em->getClassMetadata($targetEntity), |
1817 | 1817 | $association, |
@@ -1840,7 +1840,7 @@ discard block |
||
1840 | 1840 | $class = $this->em->getClassMetadata(get_class($entity)); |
1841 | 1841 | |
1842 | 1842 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
1843 | - if (! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade()))) { |
|
1843 | + if ( ! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade()))) { |
|
1844 | 1844 | continue; |
1845 | 1845 | } |
1846 | 1846 | |
@@ -1899,7 +1899,7 @@ discard block |
||
1899 | 1899 | |
1900 | 1900 | switch (true) { |
1901 | 1901 | case $lockMode === LockMode::OPTIMISTIC: |
1902 | - if (! $class->isVersioned()) { |
|
1902 | + if ( ! $class->isVersioned()) { |
|
1903 | 1903 | throw OptimisticLockException::notVersioned($class->getClassName()); |
1904 | 1904 | } |
1905 | 1905 | |
@@ -1922,7 +1922,7 @@ discard block |
||
1922 | 1922 | case $lockMode === LockMode::NONE: |
1923 | 1923 | case $lockMode === LockMode::PESSIMISTIC_READ: |
1924 | 1924 | case $lockMode === LockMode::PESSIMISTIC_WRITE: |
1925 | - if (! $this->em->getConnection()->isTransactionActive()) { |
|
1925 | + if ( ! $this->em->getConnection()->isTransactionActive()) { |
|
1926 | 1926 | throw TransactionRequiredException::transactionRequired(); |
1927 | 1927 | } |
1928 | 1928 | |
@@ -2081,7 +2081,7 @@ discard block |
||
2081 | 2081 | $entity->addPropertyChangedListener($this); |
2082 | 2082 | } |
2083 | 2083 | } else { |
2084 | - if (! isset($hints[Query::HINT_REFRESH]) |
|
2084 | + if ( ! isset($hints[Query::HINT_REFRESH]) |
|
2085 | 2085 | || (isset($hints[Query::HINT_REFRESH_ENTITY]) && $hints[Query::HINT_REFRESH_ENTITY] !== $entity)) { |
2086 | 2086 | return $entity; |
2087 | 2087 | } |
@@ -2129,7 +2129,7 @@ discard block |
||
2129 | 2129 | } |
2130 | 2130 | |
2131 | 2131 | foreach ($class->getDeclaredPropertiesIterator() as $field => $association) { |
2132 | - if (! ($association instanceof AssociationMetadata)) { |
|
2132 | + if ( ! ($association instanceof AssociationMetadata)) { |
|
2133 | 2133 | continue; |
2134 | 2134 | } |
2135 | 2135 | |
@@ -2178,7 +2178,7 @@ discard block |
||
2178 | 2178 | continue; |
2179 | 2179 | } |
2180 | 2180 | |
2181 | - if (! $association->isOwningSide()) { |
|
2181 | + if ( ! $association->isOwningSide()) { |
|
2182 | 2182 | // use the given entity association |
2183 | 2183 | if (isset($data[$field]) && is_object($data[$field]) && |
2184 | 2184 | isset($this->entityStates[spl_object_id($data[$field])])) { |
@@ -2228,7 +2228,7 @@ discard block |
||
2228 | 2228 | $associatedId[$targetField] = $joinColumnValue; |
2229 | 2229 | } |
2230 | 2230 | |
2231 | - if (! $associatedId) { |
|
2231 | + if ( ! $associatedId) { |
|
2232 | 2232 | // Foreign key is NULL |
2233 | 2233 | $association->setValue($entity, null); |
2234 | 2234 | $this->originalEntityData[$oid][$field] = null; |
@@ -2237,7 +2237,7 @@ discard block |
||
2237 | 2237 | } |
2238 | 2238 | |
2239 | 2239 | // @todo guilhermeblanco Can we remove the need of this somehow? |
2240 | - if (! isset($hints['fetchMode'][$class->getClassName()][$field])) { |
|
2240 | + if ( ! isset($hints['fetchMode'][$class->getClassName()][$field])) { |
|
2241 | 2241 | $hints['fetchMode'][$class->getClassName()][$field] = $association->getFetchMode(); |
2242 | 2242 | } |
2243 | 2243 | |
@@ -2254,7 +2254,7 @@ discard block |
||
2254 | 2254 | // If this is an uninitialized proxy, we are deferring eager loads, |
2255 | 2255 | // this association is marked as eager fetch, and its an uninitialized proxy (wtf!) |
2256 | 2256 | // then we can append this entity for eager loading! |
2257 | - if (! $targetClass->isIdentifierComposite() && |
|
2257 | + if ( ! $targetClass->isIdentifierComposite() && |
|
2258 | 2258 | $newValue instanceof GhostObjectInterface && |
2259 | 2259 | isset($hints[self::HINT_DEFEREAGERLOAD]) && |
2260 | 2260 | $hints['fetchMode'][$class->getClassName()][$field] === FetchMode::EAGER && |
@@ -2337,7 +2337,7 @@ discard block |
||
2337 | 2337 | |
2338 | 2338 | public function triggerEagerLoads() |
2339 | 2339 | { |
2340 | - if (! $this->eagerLoadingEntities) { |
|
2340 | + if ( ! $this->eagerLoadingEntities) { |
|
2341 | 2341 | return; |
2342 | 2342 | } |
2343 | 2343 | |
@@ -2346,7 +2346,7 @@ discard block |
||
2346 | 2346 | $this->eagerLoadingEntities = []; |
2347 | 2347 | |
2348 | 2348 | foreach ($eagerLoadingEntities as $entityName => $ids) { |
2349 | - if (! $ids) { |
|
2349 | + if ( ! $ids) { |
|
2350 | 2350 | continue; |
2351 | 2351 | } |
2352 | 2352 | |
@@ -2644,7 +2644,7 @@ discard block |
||
2644 | 2644 | { |
2645 | 2645 | $class = $this->em->getClassMetadata(get_class($entity)); |
2646 | 2646 | |
2647 | - if (! $class->getProperty($propertyName)) { |
|
2647 | + if ( ! $class->getProperty($propertyName)) { |
|
2648 | 2648 | return; // ignore non-persistent fields |
2649 | 2649 | } |
2650 | 2650 | |
@@ -2653,7 +2653,7 @@ discard block |
||
2653 | 2653 | // Update changeset and mark entity for synchronization |
2654 | 2654 | $this->entityChangeSets[$oid][$propertyName] = [$oldValue, $newValue]; |
2655 | 2655 | |
2656 | - if (! isset($this->scheduledForSynchronization[$class->getRootClassName()][$oid])) { |
|
2656 | + if ( ! isset($this->scheduledForSynchronization[$class->getRootClassName()][$oid])) { |
|
2657 | 2657 | $this->scheduleForSynchronization($entity); |
2658 | 2658 | } |
2659 | 2659 | } |
@@ -2735,7 +2735,7 @@ discard block |
||
2735 | 2735 | */ |
2736 | 2736 | private static function objToStr($obj) |
2737 | 2737 | { |
2738 | - return method_exists($obj, '__toString') ? (string) $obj : get_class($obj) . '@' . spl_object_id($obj); |
|
2738 | + return method_exists($obj, '__toString') ? (string) $obj : get_class($obj).'@'.spl_object_id($obj); |
|
2739 | 2739 | } |
2740 | 2740 | |
2741 | 2741 | /** |
@@ -2750,7 +2750,7 @@ discard block |
||
2750 | 2750 | */ |
2751 | 2751 | public function markReadOnly($object) |
2752 | 2752 | { |
2753 | - if (! is_object($object) || ! $this->isInIdentityMap($object)) { |
|
2753 | + if ( ! is_object($object) || ! $this->isInIdentityMap($object)) { |
|
2754 | 2754 | throw ORMInvalidArgumentException::readOnlyRequiresManagedEntity($object); |
2755 | 2755 | } |
2756 | 2756 | |
@@ -2768,7 +2768,7 @@ discard block |
||
2768 | 2768 | */ |
2769 | 2769 | public function isReadOnly($object) |
2770 | 2770 | { |
2771 | - if (! is_object($object)) { |
|
2771 | + if ( ! is_object($object)) { |
|
2772 | 2772 | throw ORMInvalidArgumentException::readOnlyRequiresManagedEntity($object); |
2773 | 2773 | } |
2774 | 2774 | |
@@ -2780,7 +2780,7 @@ discard block |
||
2780 | 2780 | */ |
2781 | 2781 | private function afterTransactionComplete() |
2782 | 2782 | { |
2783 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
2783 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
2784 | 2784 | $persister->afterTransactionComplete(); |
2785 | 2785 | }); |
2786 | 2786 | } |
@@ -2790,7 +2790,7 @@ discard block |
||
2790 | 2790 | */ |
2791 | 2791 | private function afterTransactionRolledBack() |
2792 | 2792 | { |
2793 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
2793 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
2794 | 2794 | $persister->afterTransactionRolledBack(); |
2795 | 2795 | }); |
2796 | 2796 | } |
@@ -2800,7 +2800,7 @@ discard block |
||
2800 | 2800 | */ |
2801 | 2801 | private function performCallbackOnCachedPersister(callable $callback) |
2802 | 2802 | { |
2803 | - if (! $this->hasCache) { |
|
2803 | + if ( ! $this->hasCache) { |
|
2804 | 2804 | return; |
2805 | 2805 | } |
2806 | 2806 |
@@ -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 | |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | { |
79 | 79 | if ($entityManager !== self::$entityManager) { |
80 | 80 | throw new \RuntimeException( |
81 | - 'Trying to use PersistentObject with different EntityManager instances. ' . |
|
81 | + 'Trying to use PersistentObject with different EntityManager instances. '. |
|
82 | 82 | 'Was PersistentObject::setEntityManager() called?' |
83 | 83 | ); |
84 | 84 | } |
@@ -103,8 +103,8 @@ discard block |
||
103 | 103 | |
104 | 104 | $property = $this->cm->getProperty($field); |
105 | 105 | |
106 | - if (! $property) { |
|
107 | - throw new \BadMethodCallException("no field with name '" . $field . "' exists on '" . $this->cm->getClassName() . "'"); |
|
106 | + if ( ! $property) { |
|
107 | + throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getClassName()."'"); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | switch (true) { |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $targetClassName = $property->getTargetEntity(); |
117 | 117 | |
118 | 118 | if ($args[0] !== null && ! ($args[0] instanceof $targetClassName)) { |
119 | - throw new \InvalidArgumentException("Expected persistent object of type '" . $targetClassName . "'"); |
|
119 | + throw new \InvalidArgumentException("Expected persistent object of type '".$targetClassName."'"); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | $this->{$field} = $args[0]; |
@@ -142,8 +142,8 @@ discard block |
||
142 | 142 | |
143 | 143 | $property = $this->cm->getProperty($field); |
144 | 144 | |
145 | - if (! $property) { |
|
146 | - throw new \BadMethodCallException("no field with name '" . $field . "' exists on '" . $this->cm->getClassName() . "'"); |
|
145 | + if ( ! $property) { |
|
146 | + throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getClassName()."'"); |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | return $this->{$field}; |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $mappedByField = $property->getMappedBy(); |
166 | 166 | $targetMetadata = self::$entityManager->getClassMetadata($property->getTargetEntity()); |
167 | 167 | $targetProperty = $targetMetadata->getProperty($mappedByField); |
168 | - $setterMethodName = ($targetProperty instanceof ToManyAssociationMetadata ? 'add' : 'set') . $mappedByField; |
|
168 | + $setterMethodName = ($targetProperty instanceof ToManyAssociationMetadata ? 'add' : 'set').$mappedByField; |
|
169 | 169 | |
170 | 170 | $targetObject->{$setterMethodName}($this); |
171 | 171 | } |
@@ -187,21 +187,21 @@ discard block |
||
187 | 187 | |
188 | 188 | $property = $this->cm->getProperty($field); |
189 | 189 | |
190 | - if (! $property) { |
|
191 | - throw new \BadMethodCallException("no field with name '" . $field . "' exists on '" . $this->cm->getClassName() . "'"); |
|
190 | + if ( ! $property) { |
|
191 | + throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getClassName()."'"); |
|
192 | 192 | } |
193 | 193 | |
194 | - if (! ($property instanceof ToManyAssociationMetadata)) { |
|
195 | - throw new \BadMethodCallException('There is no method add' . $field . '() on ' . $this->cm->getClassName()); |
|
194 | + if ( ! ($property instanceof ToManyAssociationMetadata)) { |
|
195 | + throw new \BadMethodCallException('There is no method add'.$field.'() on '.$this->cm->getClassName()); |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | $targetClassName = $property->getTargetEntity(); |
199 | 199 | |
200 | - if (! ($args[0] instanceof $targetClassName)) { |
|
201 | - throw new \InvalidArgumentException("Expected persistent object of type '" . $targetClassName . "'"); |
|
200 | + if ( ! ($args[0] instanceof $targetClassName)) { |
|
201 | + throw new \InvalidArgumentException("Expected persistent object of type '".$targetClassName."'"); |
|
202 | 202 | } |
203 | 203 | |
204 | - if (! ($this->{$field} instanceof Collection)) { |
|
204 | + if ( ! ($this->{$field} instanceof Collection)) { |
|
205 | 205 | $this->{$field} = new ArrayCollection($this->{$field} ?: []); |
206 | 206 | } |
207 | 207 | |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | return; |
224 | 224 | } |
225 | 225 | |
226 | - if (! self::$entityManager) { |
|
226 | + if ( ! self::$entityManager) { |
|
227 | 227 | throw new \RuntimeException('No runtime entity manager set. Call PersistentObject#setEntityManager().'); |
228 | 228 | } |
229 | 229 | |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | return $this->add($field, $args); |
257 | 257 | |
258 | 258 | default: |
259 | - throw new \BadMethodCallException('There is no method ' . $method . ' on ' . $this->cm->getClassName()); |
|
259 | + throw new \BadMethodCallException('There is no method '.$method.' on '.$this->cm->getClassName()); |
|
260 | 260 | } |
261 | 261 | } |
262 | 262 | } |