@@ -8,7 +8,6 @@ |
||
| 8 | 8 | use Doctrine\ORM\EntityManagerInterface; |
| 9 | 9 | use Doctrine\ORM\EntityNotFoundException; |
| 10 | 10 | use Doctrine\ORM\Mapping\ClassMetadata; |
| 11 | -use Doctrine\ORM\Mapping\Property; |
|
| 12 | 11 | use Doctrine\ORM\Mapping\ToManyAssociationMetadata; |
| 13 | 12 | use Doctrine\ORM\Mapping\TransientMetadata; |
| 14 | 13 | use Doctrine\ORM\Persisters\Entity\EntityPersister; |
@@ -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\Proxy\Factory; |
| 7 | 7 | |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | public function generateProxyClasses(array $classes) : int |
| 78 | 78 | { |
| 79 | - $concreteClasses = \array_filter($classes, function (ClassMetadata $metadata) : bool { |
|
| 79 | + $concreteClasses = \array_filter($classes, function(ClassMetadata $metadata) : bool { |
|
| 80 | 80 | return ! ($metadata->isMappedSuperclass || $metadata->getReflectionClass()->isAbstract()); |
| 81 | 81 | }); |
| 82 | 82 | |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | ->proxyFactory |
| 86 | 86 | ->createProxy( |
| 87 | 87 | $metadata->getClassName(), |
| 88 | - function () { |
|
| 88 | + function() { |
|
| 89 | 89 | // empty closure, serves its purpose, for now |
| 90 | 90 | }, |
| 91 | 91 | $this->skippedFieldsFqns($metadata) |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | |
| 142 | 142 | private function makeInitializer(ClassMetadata $metadata, EntityPersister $persister) : \Closure |
| 143 | 143 | { |
| 144 | - return function ( |
|
| 144 | + return function( |
|
| 145 | 145 | GhostObjectInterface $ghostObject, |
| 146 | 146 | string $method, // we don't care |
| 147 | 147 | array $parameters, // we don't care |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | $identifier = $persister->getIdentifier($ghostObject); |
| 155 | 155 | |
| 156 | 156 | // @TODO how do we use `$properties` in the persister? That would be a massive optimisation |
| 157 | - if (! $persister->loadById($identifier, $ghostObject)) { |
|
| 157 | + if ( ! $persister->loadById($identifier, $ghostObject)) { |
|
| 158 | 158 | $initializer = $originalInitializer; |
| 159 | 159 | |
| 160 | 160 | throw EntityNotFoundException::fromClassNameAndIdentifier( |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | $transientFieldsFqns = []; |
| 182 | 182 | |
| 183 | 183 | foreach ($metadata->getDeclaredPropertiesIterator() as $name => $property) { |
| 184 | - if (! $property instanceof TransientMetadata) { |
|
| 184 | + if ( ! $property instanceof TransientMetadata) { |
|
| 185 | 185 | continue; |
| 186 | 186 | } |
| 187 | 187 | |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | $transientFieldsFqns = []; |
| 202 | 202 | |
| 203 | 203 | foreach ($metadata->getDeclaredPropertiesIterator() as $name => $property) { |
| 204 | - if (! $property instanceof ToManyAssociationMetadata) { |
|
| 204 | + if ( ! $property instanceof ToManyAssociationMetadata) { |
|
| 205 | 205 | continue; |
| 206 | 206 | } |
| 207 | 207 | |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | $toMany = []; |
| 225 | 225 | |
| 226 | 226 | foreach ($metadata->getDeclaredPropertiesIterator() as $property) { |
| 227 | - if (! $property instanceof ToManyAssociationMetadata) { |
|
| 227 | + if ( ! $property instanceof ToManyAssociationMetadata) { |
|
| 228 | 228 | continue; |
| 229 | 229 | } |
| 230 | 230 | |
@@ -254,11 +254,11 @@ discard block |
||
| 254 | 254 | private function propertyFqcn(\ReflectionProperty $property) : string |
| 255 | 255 | { |
| 256 | 256 | if ($property->isPrivate()) { |
| 257 | - return "\0" . $property->getDeclaringClass()->getName() . "\0" . $property->getName(); |
|
| 257 | + return "\0".$property->getDeclaringClass()->getName()."\0".$property->getName(); |
|
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | if ($property->isProtected()) { |
| 261 | - return "\0*\0" . $property->getName(); |
|
| 261 | + return "\0*\0".$property->getName(); |
|
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | return $property->getName(); |
@@ -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\Tests\Mocks; |
| 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\Tests\ORM\Mapping; |
| 6 | 6 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | { |
| 115 | 115 | require_once __DIR__."/../../Models/Global/GlobalNamespaceModel.php"; |
| 116 | 116 | |
| 117 | - $metadataDriver = $this->createAnnotationDriver([__DIR__ . '/../../Models/Global/']); |
|
| 117 | + $metadataDriver = $this->createAnnotationDriver([__DIR__.'/../../Models/Global/']); |
|
| 118 | 118 | |
| 119 | 119 | $entityManager = $this->createEntityManager($metadataDriver); |
| 120 | 120 | |
@@ -122,10 +122,10 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | self::assertSame( |
| 124 | 124 | $mf->getMetadataFor(DoctrineGlobal_Article::class), |
| 125 | - $mf->getMetadataFor('\\' . DoctrineGlobal_Article::class) |
|
| 125 | + $mf->getMetadataFor('\\'.DoctrineGlobal_Article::class) |
|
| 126 | 126 | ); |
| 127 | 127 | self::assertTrue($mf->hasMetadataFor(DoctrineGlobal_Article::class)); |
| 128 | - self::assertTrue($mf->hasMetadataFor('\\' . DoctrineGlobal_Article::class)); |
|
| 128 | + self::assertTrue($mf->hasMetadataFor('\\'.DoctrineGlobal_Article::class)); |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | /** |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | public function testAddDefaultDiscriminatorMap() |
| 177 | 177 | { |
| 178 | 178 | $cmf = new ClassMetadataFactory(); |
| 179 | - $driver = $this->createAnnotationDriver([__DIR__ . '/../../Models/JoinedInheritanceType/']); |
|
| 179 | + $driver = $this->createAnnotationDriver([__DIR__.'/../../Models/JoinedInheritanceType/']); |
|
| 180 | 180 | $em = $this->createEntityManager($driver); |
| 181 | 181 | $cmf->setEntityManager($em); |
| 182 | 182 | |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | { |
| 217 | 217 | // DDC-3551 |
| 218 | 218 | $conn = $this->createMock(Connection::class); |
| 219 | - $mockDriver = new MetadataDriverMock(); |
|
| 219 | + $mockDriver = new MetadataDriverMock(); |
|
| 220 | 220 | $conn->expects($this->any()) |
| 221 | 221 | ->method('getEventManager') |
| 222 | 222 | ->willReturn(new EventManager()); |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | $config->setAutoGenerateProxyClasses(ProxyFactory::AUTOGENERATE_EVAL); |
| 244 | 244 | $config->setProxyNamespace('Doctrine\Tests\Proxies'); |
| 245 | 245 | |
| 246 | - if (!$conn) { |
|
| 246 | + if ( ! $conn) { |
|
| 247 | 247 | $conn = new ConnectionMock([], $driverMock, $config, new EventManager()); |
| 248 | 248 | } |
| 249 | 249 | $eventManager = $conn->getEventManager(); |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | public function testQuoteMetadata() |
| 335 | 335 | { |
| 336 | 336 | $cmf = new ClassMetadataFactory(); |
| 337 | - $driver = $this->createAnnotationDriver([__DIR__ . '/../../Models/Quote/']); |
|
| 337 | + $driver = $this->createAnnotationDriver([__DIR__.'/../../Models/Quote/']); |
|
| 338 | 338 | $em = $this->createEntityManager($driver); |
| 339 | 339 | $cmf->setEntityManager($em); |
| 340 | 340 | |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | $listener |
| 424 | 424 | ->expects($this->any()) |
| 425 | 425 | ->method('onClassMetadataNotFound') |
| 426 | - ->will($this->returnCallback(function (OnClassMetadataNotFoundEventArgs $args) use ($metadata, $em, $test) { |
|
| 426 | + ->will($this->returnCallback(function(OnClassMetadataNotFoundEventArgs $args) use ($metadata, $em, $test) { |
|
| 427 | 427 | $test->assertNull($args->getFoundMetadata()); |
| 428 | 428 | $test->assertSame('Foo', $args->getClassName()); |
| 429 | 429 | $test->assertSame($em, $args->getObjectManager()); |
@@ -485,7 +485,7 @@ discard block |
||
| 485 | 485 | public function testInheritsIdGeneratorMappingFromEmbeddable() |
| 486 | 486 | { |
| 487 | 487 | $cmf = new ClassMetadataFactory(); |
| 488 | - $driver = $this->createAnnotationDriver([__DIR__ . '/../../Models/DDC4006/']); |
|
| 488 | + $driver = $this->createAnnotationDriver([__DIR__.'/../../Models/DDC4006/']); |
|
| 489 | 489 | $em = $this->createEntityManager($driver); |
| 490 | 490 | $cmf->setEntityManager($em); |
| 491 | 491 | |
@@ -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\ORM\Functional\Locking; |
| 6 | 6 | |
@@ -27,9 +27,9 @@ discard block |
||
| 27 | 27 | $worker->addFunction("dqlWithLock", [$lockAgent, "dqlWithLock"]); |
| 28 | 28 | $worker->addFunction('lock', [$lockAgent, 'lock']); |
| 29 | 29 | |
| 30 | - while($worker->work()) { |
|
| 30 | + while ($worker->work()) { |
|
| 31 | 31 | if ($worker->returnCode() != GEARMAN_SUCCESS) { |
| 32 | - echo "return_code: " . $worker->returnCode() . "\n"; |
|
| 32 | + echo "return_code: ".$worker->returnCode()."\n"; |
|
| 33 | 33 | break; |
| 34 | 34 | } |
| 35 | 35 | } |
@@ -80,18 +80,18 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | protected function processWorkload($job) |
| 82 | 82 | { |
| 83 | - echo "Received job: " . $job->handle() . " for function " . $job->functionName() . "\n"; |
|
| 83 | + echo "Received job: ".$job->handle()." for function ".$job->functionName()."\n"; |
|
| 84 | 84 | |
| 85 | 85 | $workload = $job->workload(); |
| 86 | 86 | $workload = unserialize($workload); |
| 87 | 87 | |
| 88 | - if (!isset($workload['conn']) || !is_array($workload['conn'])) { |
|
| 88 | + if ( ! isset($workload['conn']) || ! is_array($workload['conn'])) { |
|
| 89 | 89 | throw new \InvalidArgumentException("Missing Database parameters"); |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | $this->em = $this->createEntityManager($workload['conn']); |
| 93 | 93 | |
| 94 | - if (!isset($workload['fixture'])) { |
|
| 94 | + if ( ! isset($workload['fixture'])) { |
|
| 95 | 95 | throw new \InvalidArgumentException("Missing Fixture parameters"); |
| 96 | 96 | } |
| 97 | 97 | return $workload['fixture']; |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | $config->setProxyNamespace('MyProject\Proxies'); |
| 105 | 105 | $config->setAutoGenerateProxyClasses(true); |
| 106 | 106 | |
| 107 | - $annotDriver = $config->newDefaultAnnotationDriver([__DIR__ . '/../../../Models/']); |
|
| 107 | + $annotDriver = $config->newDefaultAnnotationDriver([__DIR__.'/../../../Models/']); |
|
| 108 | 108 | $config->setMetadataDriverImpl($annotDriver); |
| 109 | 109 | |
| 110 | 110 | $cache = new ArrayCache(); |
@@ -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 | |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | // Entity deletions come last and need to be in reverse commit order |
| 391 | 391 | if ($this->entityDeletions) { |
| 392 | 392 | foreach (array_reverse($commitOrder) as $committedEntityName) { |
| 393 | - if (! $this->entityDeletions) { |
|
| 393 | + if ( ! $this->entityDeletions) { |
|
| 394 | 394 | break; // just a performance optimisation |
| 395 | 395 | } |
| 396 | 396 | |
@@ -475,7 +475,7 @@ discard block |
||
| 475 | 475 | $oid = spl_object_hash($entity); |
| 476 | 476 | $data = []; |
| 477 | 477 | |
| 478 | - if (!isset($this->entityChangeSets[$oid])) { |
|
| 478 | + if ( ! isset($this->entityChangeSets[$oid])) { |
|
| 479 | 479 | return $data; |
| 480 | 480 | } |
| 481 | 481 | |
@@ -572,7 +572,7 @@ discard block |
||
| 572 | 572 | || ! $class->getProperty($name) instanceof FieldMetadata |
| 573 | 573 | || ! $class->getProperty($name)->hasValueGenerator() |
| 574 | 574 | || $class->getProperty($name)->getValueGenerator()->getType() !== GeneratorType::IDENTITY |
| 575 | - ) && (! $class->isVersioned() || $name !== $class->versionProperty->getName())) { |
|
| 575 | + ) && ( ! $class->isVersioned() || $name !== $class->versionProperty->getName())) { |
|
| 576 | 576 | $actualData[$name] = $value; |
| 577 | 577 | } |
| 578 | 578 | } |
@@ -626,7 +626,7 @@ discard block |
||
| 626 | 626 | if ($owner === null) { // cloned |
| 627 | 627 | $actualValue->setOwner($entity, $property); |
| 628 | 628 | } else if ($owner !== $entity) { // no clone, we have to fix |
| 629 | - if (! $actualValue->isInitialized()) { |
|
| 629 | + if ( ! $actualValue->isInitialized()) { |
|
| 630 | 630 | $actualValue->initialize(); // we have to do this otherwise the cols share state |
| 631 | 631 | } |
| 632 | 632 | |
@@ -664,7 +664,7 @@ discard block |
||
| 664 | 664 | // Check if original value exists |
| 665 | 665 | if ($orgValue instanceof PersistentCollection) { |
| 666 | 666 | // A PersistentCollection was de-referenced, so delete it. |
| 667 | - if (! $this->isCollectionScheduledForDeletion($orgValue)) { |
|
| 667 | + if ( ! $this->isCollectionScheduledForDeletion($orgValue)) { |
|
| 668 | 668 | $this->scheduleCollectionDeletion($orgValue); |
| 669 | 669 | |
| 670 | 670 | $changeSet[$propName] = $orgValue; // Signal changeset, to-many associations will be ignored |
@@ -700,7 +700,7 @@ discard block |
||
| 700 | 700 | continue; |
| 701 | 701 | } |
| 702 | 702 | |
| 703 | - if (! $property instanceof AssociationMetadata) { |
|
| 703 | + if ( ! $property instanceof AssociationMetadata) { |
|
| 704 | 704 | continue; |
| 705 | 705 | } |
| 706 | 706 | |
@@ -792,13 +792,13 @@ discard block |
||
| 792 | 792 | |
| 793 | 793 | // @TODO massive amount of duplication here - to be fixed. |
| 794 | 794 | foreach ($unwrappedValue as $key => $entry) { |
| 795 | - if (! ($entry instanceof $targetEntity)) { |
|
| 795 | + if ( ! ($entry instanceof $targetEntity)) { |
|
| 796 | 796 | throw ORMInvalidArgumentException::invalidAssociation($targetClass, $association, $entry); |
| 797 | 797 | } |
| 798 | 798 | |
| 799 | 799 | $state = $this->getEntityState($entry, self::STATE_NEW); |
| 800 | 800 | |
| 801 | - if (! ($entry instanceof $targetEntity)) { |
|
| 801 | + if ( ! ($entry instanceof $targetEntity)) { |
|
| 802 | 802 | throw ORMException::unexpectedAssociationValue( |
| 803 | 803 | $association->getSourceEntity(), |
| 804 | 804 | $association->getName(), |
@@ -873,13 +873,13 @@ discard block |
||
| 873 | 873 | $targetClass = $this->em->getClassMetadata($targetEntity); |
| 874 | 874 | |
| 875 | 875 | foreach ($unwrappedValue as $key => $entry) { |
| 876 | - if (! ($entry instanceof $targetEntity)) { |
|
| 876 | + if ( ! ($entry instanceof $targetEntity)) { |
|
| 877 | 877 | throw ORMInvalidArgumentException::invalidAssociation($targetClass, $association, $entry); |
| 878 | 878 | } |
| 879 | 879 | |
| 880 | 880 | $state = $this->getEntityState($entry, self::STATE_NEW); |
| 881 | 881 | |
| 882 | - if (! ($entry instanceof $targetEntity)) { |
|
| 882 | + if ( ! ($entry instanceof $targetEntity)) { |
|
| 883 | 883 | throw ORMException::unexpectedAssociationValue( |
| 884 | 884 | $association->getSourceEntity(), |
| 885 | 885 | $association->getName(), |
@@ -941,7 +941,7 @@ discard block |
||
| 941 | 941 | $persister = $this->getEntityPersister($class->getClassName()); |
| 942 | 942 | $generationPlan->executeImmediate($this->em, $entity); |
| 943 | 943 | |
| 944 | - if (! $generationPlan->containsDeferred()) { |
|
| 944 | + if ( ! $generationPlan->containsDeferred()) { |
|
| 945 | 945 | $id = $this->em->getIdentifierFlattener()->flattenIdentifier($class, $persister->getIdentifier($entity)); |
| 946 | 946 | $this->entityIdentifiers[$oid] = $id; |
| 947 | 947 | } |
@@ -974,7 +974,7 @@ discard block |
||
| 974 | 974 | { |
| 975 | 975 | $oid = spl_object_hash($entity); |
| 976 | 976 | |
| 977 | - if (! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) { |
|
| 977 | + if ( ! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) { |
|
| 978 | 978 | throw ORMInvalidArgumentException::entityNotManaged($entity); |
| 979 | 979 | } |
| 980 | 980 | |
@@ -996,7 +996,7 @@ discard block |
||
| 996 | 996 | break; |
| 997 | 997 | |
| 998 | 998 | case ($property instanceof FieldMetadata): |
| 999 | - if (! $property->isPrimaryKey() |
|
| 999 | + if ( ! $property->isPrimaryKey() |
|
| 1000 | 1000 | || ! $property->getValueGenerator() |
| 1001 | 1001 | || $property->getValueGenerator()->getType() !== GeneratorType::IDENTITY) { |
| 1002 | 1002 | $actualData[$name] = $property->getValue($entity); |
@@ -1149,7 +1149,7 @@ discard block |
||
| 1149 | 1149 | // Entity with this $oid after deletion treated as NEW, even if the $oid |
| 1150 | 1150 | // is obtained by a new entity because the old one went out of scope. |
| 1151 | 1151 | //$this->entityStates[$oid] = self::STATE_NEW; |
| 1152 | - if (! $class->isIdentifierComposite()) { |
|
| 1152 | + if ( ! $class->isIdentifierComposite()) { |
|
| 1153 | 1153 | $property = $class->getProperty($class->getSingleIdentifierFieldName()); |
| 1154 | 1154 | |
| 1155 | 1155 | if ($property instanceof FieldMetadata && $property->hasValueGenerator()) { |
@@ -1196,7 +1196,7 @@ discard block |
||
| 1196 | 1196 | // Calculate dependencies for new nodes |
| 1197 | 1197 | while ($class = array_pop($newNodes)) { |
| 1198 | 1198 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
| 1199 | - if (! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) { |
|
| 1199 | + if ( ! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) { |
|
| 1200 | 1200 | continue; |
| 1201 | 1201 | } |
| 1202 | 1202 | |
@@ -1210,7 +1210,7 @@ discard block |
||
| 1210 | 1210 | |
| 1211 | 1211 | $weight = ! array_filter( |
| 1212 | 1212 | $property->getJoinColumns(), |
| 1213 | - function (JoinColumnMetadata $joinColumn) { return $joinColumn->isNullable(); } |
|
| 1213 | + function(JoinColumnMetadata $joinColumn) { return $joinColumn->isNullable(); } |
|
| 1214 | 1214 | ); |
| 1215 | 1215 | |
| 1216 | 1216 | $calc->addDependency($targetClass->getClassName(), $class->getClassName(), $weight); |
@@ -1504,7 +1504,7 @@ discard block |
||
| 1504 | 1504 | $persister = $this->getEntityPersister($class->getClassName()); |
| 1505 | 1505 | $id = $persister->getIdentifier($entity); |
| 1506 | 1506 | |
| 1507 | - if (! $id) { |
|
| 1507 | + if ( ! $id) { |
|
| 1508 | 1508 | return self::STATE_NEW; |
| 1509 | 1509 | } |
| 1510 | 1510 | |
@@ -1737,7 +1737,7 @@ discard block |
||
| 1737 | 1737 | throw ORMInvalidArgumentException::detachedEntityCannot($entity, "persisted"); |
| 1738 | 1738 | |
| 1739 | 1739 | default: |
| 1740 | - throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity)); |
|
| 1740 | + throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity)); |
|
| 1741 | 1741 | } |
| 1742 | 1742 | |
| 1743 | 1743 | $this->cascadePersist($entity, $visited); |
@@ -1807,7 +1807,7 @@ discard block |
||
| 1807 | 1807 | case self::STATE_DETACHED: |
| 1808 | 1808 | throw ORMInvalidArgumentException::detachedEntityCannot($entity, "removed"); |
| 1809 | 1809 | default: |
| 1810 | - throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity)); |
|
| 1810 | + throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity)); |
|
| 1811 | 1811 | } |
| 1812 | 1812 | |
| 1813 | 1813 | } |
@@ -1876,7 +1876,7 @@ discard block |
||
| 1876 | 1876 | $class = $this->em->getClassMetadata(get_class($entity)); |
| 1877 | 1877 | |
| 1878 | 1878 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
| 1879 | - if (! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade()))) { |
|
| 1879 | + if ( ! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade()))) { |
|
| 1880 | 1880 | continue; |
| 1881 | 1881 | } |
| 1882 | 1882 | |
@@ -1925,7 +1925,7 @@ discard block |
||
| 1925 | 1925 | } |
| 1926 | 1926 | |
| 1927 | 1927 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
| 1928 | - if (! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade()))) { |
|
| 1928 | + if ( ! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade()))) { |
|
| 1929 | 1929 | continue; |
| 1930 | 1930 | } |
| 1931 | 1931 | |
@@ -1941,7 +1941,7 @@ discard block |
||
| 1941 | 1941 | |
| 1942 | 1942 | case ($relatedEntities instanceof Collection): |
| 1943 | 1943 | case (is_array($relatedEntities)): |
| 1944 | - if (! ($association instanceof ToManyAssociationMetadata)) { |
|
| 1944 | + if ( ! ($association instanceof ToManyAssociationMetadata)) { |
|
| 1945 | 1945 | throw ORMInvalidArgumentException::invalidAssociation( |
| 1946 | 1946 | $this->em->getClassMetadata($targetEntity), |
| 1947 | 1947 | $association, |
@@ -1956,7 +1956,7 @@ discard block |
||
| 1956 | 1956 | break; |
| 1957 | 1957 | |
| 1958 | 1958 | case ($relatedEntities !== null): |
| 1959 | - if (! $relatedEntities instanceof $targetEntity) { |
|
| 1959 | + if ( ! $relatedEntities instanceof $targetEntity) { |
|
| 1960 | 1960 | throw ORMInvalidArgumentException::invalidAssociation( |
| 1961 | 1961 | $this->em->getClassMetadata($targetEntity), |
| 1962 | 1962 | $association, |
@@ -1987,7 +1987,7 @@ discard block |
||
| 1987 | 1987 | $class = $this->em->getClassMetadata(get_class($entity)); |
| 1988 | 1988 | |
| 1989 | 1989 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
| 1990 | - if (! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade()))) { |
|
| 1990 | + if ( ! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade()))) { |
|
| 1991 | 1991 | continue; |
| 1992 | 1992 | } |
| 1993 | 1993 | |
@@ -2071,7 +2071,7 @@ discard block |
||
| 2071 | 2071 | case LockMode::NONE === $lockMode: |
| 2072 | 2072 | case LockMode::PESSIMISTIC_READ === $lockMode: |
| 2073 | 2073 | case LockMode::PESSIMISTIC_WRITE === $lockMode: |
| 2074 | - if (!$this->em->getConnection()->isTransactionActive()) { |
|
| 2074 | + if ( ! $this->em->getConnection()->isTransactionActive()) { |
|
| 2075 | 2075 | throw TransactionRequiredException::transactionRequired(); |
| 2076 | 2076 | } |
| 2077 | 2077 | |
@@ -2292,7 +2292,7 @@ discard block |
||
| 2292 | 2292 | } |
| 2293 | 2293 | |
| 2294 | 2294 | foreach ($class->getDeclaredPropertiesIterator() as $field => $association) { |
| 2295 | - if (! ($association instanceof AssociationMetadata)) { |
|
| 2295 | + if ( ! ($association instanceof AssociationMetadata)) { |
|
| 2296 | 2296 | continue; |
| 2297 | 2297 | } |
| 2298 | 2298 | |
@@ -2346,7 +2346,7 @@ discard block |
||
| 2346 | 2346 | continue; |
| 2347 | 2347 | } |
| 2348 | 2348 | |
| 2349 | - if (! $association->isOwningSide()) { |
|
| 2349 | + if ( ! $association->isOwningSide()) { |
|
| 2350 | 2350 | // use the given entity association |
| 2351 | 2351 | if (isset($data[$field]) && is_object($data[$field]) && |
| 2352 | 2352 | isset($this->entityStates[spl_object_hash($data[$field])])) { |
@@ -2396,7 +2396,7 @@ discard block |
||
| 2396 | 2396 | $associatedId[$targetField] = $joinColumnValue; |
| 2397 | 2397 | } |
| 2398 | 2398 | |
| 2399 | - if (! $associatedId) { |
|
| 2399 | + if ( ! $associatedId) { |
|
| 2400 | 2400 | // Foreign key is NULL |
| 2401 | 2401 | $association->setValue($entity, null); |
| 2402 | 2402 | $this->originalEntityData[$oid][$field] = null; |
@@ -2405,7 +2405,7 @@ discard block |
||
| 2405 | 2405 | } |
| 2406 | 2406 | |
| 2407 | 2407 | // @todo guilhermeblanco Can we remove the need of this somehow? |
| 2408 | - if (!isset($hints['fetchMode'][$class->getClassName()][$field])) { |
|
| 2408 | + if ( ! isset($hints['fetchMode'][$class->getClassName()][$field])) { |
|
| 2409 | 2409 | $hints['fetchMode'][$class->getClassName()][$field] = $association->getFetchMode(); |
| 2410 | 2410 | } |
| 2411 | 2411 | |
@@ -2422,7 +2422,7 @@ discard block |
||
| 2422 | 2422 | // If this is an uninitialized proxy, we are deferring eager loads, |
| 2423 | 2423 | // this association is marked as eager fetch, and its an uninitialized proxy (wtf!) |
| 2424 | 2424 | // then we can append this entity for eager loading! |
| 2425 | - if (!$targetClass->isIdentifierComposite() && |
|
| 2425 | + if ( ! $targetClass->isIdentifierComposite() && |
|
| 2426 | 2426 | $newValue instanceof GhostObjectInterface && |
| 2427 | 2427 | isset($hints[self::HINT_DEFEREAGERLOAD]) && |
| 2428 | 2428 | $hints['fetchMode'][$class->getClassName()][$field] === FetchMode::EAGER && |
@@ -2459,7 +2459,7 @@ discard block |
||
| 2459 | 2459 | break; |
| 2460 | 2460 | |
| 2461 | 2461 | // Deferred eager load only works for single identifier classes |
| 2462 | - case (isset($hints[self::HINT_DEFEREAGERLOAD]) && !$targetClass->isIdentifierComposite()): |
|
| 2462 | + case (isset($hints[self::HINT_DEFEREAGERLOAD]) && ! $targetClass->isIdentifierComposite()): |
|
| 2463 | 2463 | // TODO: Is there a faster approach? |
| 2464 | 2464 | $this->eagerLoadingEntities[$targetClass->getRootClassName()][$relatedIdHash] = current($normalizedAssociatedId); |
| 2465 | 2465 | |
@@ -2866,7 +2866,7 @@ discard block |
||
| 2866 | 2866 | { |
| 2867 | 2867 | $class = $this->em->getClassMetadata(get_class($entity)); |
| 2868 | 2868 | |
| 2869 | - if (! $class->getProperty($propertyName)) { |
|
| 2869 | + if ( ! $class->getProperty($propertyName)) { |
|
| 2870 | 2870 | return; // ignore non-persistent fields |
| 2871 | 2871 | } |
| 2872 | 2872 | |
@@ -3006,7 +3006,7 @@ discard block |
||
| 3006 | 3006 | */ |
| 3007 | 3007 | private function afterTransactionComplete() |
| 3008 | 3008 | { |
| 3009 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
| 3009 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
| 3010 | 3010 | $persister->afterTransactionComplete(); |
| 3011 | 3011 | }); |
| 3012 | 3012 | } |
@@ -3016,7 +3016,7 @@ discard block |
||
| 3016 | 3016 | */ |
| 3017 | 3017 | private function afterTransactionRolledBack() |
| 3018 | 3018 | { |
| 3019 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
| 3019 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
| 3020 | 3020 | $persister->afterTransactionRolledBack(); |
| 3021 | 3021 | }); |
| 3022 | 3022 | } |
@@ -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\Tests\Models\UniDirectionalManyToMany; |
| 6 | 6 | |
@@ -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\Tests\Models\UniDirectionalManyToMany; |
| 6 | 6 | |