@@ -29,7 +29,6 @@ |
||
| 29 | 29 | use Doctrine\ORM\Mapping\FieldMetadata; |
| 30 | 30 | use Doctrine\ORM\Mapping\ManyToManyAssociationMetadata; |
| 31 | 31 | use Doctrine\ORM\Mapping\ToOneAssociationMetadata; |
| 32 | -use Doctrine\ORM\Query\QueryException; |
|
| 33 | 32 | |
| 34 | 33 | /** |
| 35 | 34 | * The PersisterHelper contains logic to infer binding types which is used in |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | * <http://www.doctrine-project.org>. |
| 19 | 19 | */ |
| 20 | 20 | |
| 21 | -declare(strict_types=1); |
|
| 21 | +declare(strict_types = 1); |
|
| 22 | 22 | |
| 23 | 23 | namespace Doctrine\ORM\Utility; |
| 24 | 24 | |
@@ -79,14 +79,14 @@ discard block |
||
| 79 | 79 | |
| 80 | 80 | // iterate over association mappings |
| 81 | 81 | foreach ($class->getProperties() as $association) { |
| 82 | - if (! ($association instanceof AssociationMetadata)) { |
|
| 82 | + if ( ! ($association instanceof AssociationMetadata)) { |
|
| 83 | 83 | continue; |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | // resolve join columns over to-one or to-many |
| 87 | 87 | $targetClass = $em->getClassMetadata($association->getTargetEntity()); |
| 88 | 88 | |
| 89 | - if (! $association->isOwningSide()) { |
|
| 89 | + if ( ! $association->isOwningSide()) { |
|
| 90 | 90 | $association = $targetClass->getProperty($association->getMappedBy()); |
| 91 | 91 | $targetClass = $em->getClassMetadata($association->getTargetEntity()); |
| 92 | 92 | } |
@@ -10,7 +10,6 @@ |
||
| 10 | 10 | use Doctrine\ORM\Proxy\Factory\DefaultProxyResolver; |
| 11 | 11 | use Doctrine\ORM\Proxy\Factory\StaticProxyFactory; |
| 12 | 12 | use Doctrine\ORM\Query\ResultSetMapping; |
| 13 | -use Doctrine\ORM\Utility\IdentifierFlattener; |
|
| 14 | 13 | |
| 15 | 14 | /** |
| 16 | 15 | * An entity manager mock that prevents lazy-loading of proxies |
@@ -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\Performance\Mock; |
| 6 | 6 | |
@@ -5,8 +5,6 @@ |
||
| 5 | 5 | namespace Doctrine\Tests\Mocks; |
| 6 | 6 | |
| 7 | 7 | use Doctrine\Common\Collections\Criteria; |
| 8 | -use Doctrine\ORM\Mapping\ClassMetadata; |
|
| 9 | -use Doctrine\ORM\Mapping\GeneratorType; |
|
| 10 | 8 | use Doctrine\ORM\Persisters\Entity\BasicEntityPersister; |
| 11 | 9 | |
| 12 | 10 | /** |
@@ -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 | |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | |
| 235 | 235 | /** |
| 236 | 236 | * |
| 237 | - * @return kateglo\application\helpers\collections\ArrayCollection |
|
| 237 | + * @return ArrayCollection |
|
| 238 | 238 | */ |
| 239 | 239 | public function getTypes() |
| 240 | 240 | { |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | |
| 338 | 338 | /** |
| 339 | 339 | * |
| 340 | - * @param kateglo\application\models\Lemma $lemma |
|
| 340 | + * @param Lemma $lemma |
|
| 341 | 341 | * @return void |
| 342 | 342 | */ |
| 343 | 343 | public function addLemma(Lemma $lemma) |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | |
| 351 | 351 | /** |
| 352 | 352 | * |
| 353 | - * @param kateglo\application\models\Lemma $lemma |
|
| 353 | + * @param Lemma $lemma |
|
| 354 | 354 | * @return void |
| 355 | 355 | */ |
| 356 | 356 | public function removeLEmma(Lemma $lemma) |
@@ -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; |
| 6 | 6 | |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | * |
| 207 | 207 | * @return string |
| 208 | 208 | */ |
| 209 | - public function getLemma(){ |
|
| 209 | + public function getLemma() { |
|
| 210 | 210 | return $this->lemma; |
| 211 | 211 | } |
| 212 | 212 | |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | */ |
| 216 | 216 | public function addType(Type $type) |
| 217 | 217 | { |
| 218 | - if (!$this->types->contains($type)) { |
|
| 218 | + if ( ! $this->types->contains($type)) { |
|
| 219 | 219 | $this->types[] = $type; |
| 220 | 220 | $type->addLemma($this); |
| 221 | 221 | } |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | */ |
| 343 | 343 | public function addLemma(Lemma $lemma) |
| 344 | 344 | { |
| 345 | - if (!$this->lemmas->contains($lemma)) { |
|
| 345 | + if ( ! $this->lemmas->contains($lemma)) { |
|
| 346 | 346 | $this->lemmas[] = $lemma; |
| 347 | 347 | $lemma->addType($this); |
| 348 | 348 | } |
@@ -6,7 +6,6 @@ |
||
| 6 | 6 | |
| 7 | 7 | use Doctrine\DBAL\Logging\DebugStack; |
| 8 | 8 | use Doctrine\ORM\EntityNotFoundException; |
| 9 | -use Doctrine\ORM\Mapping\ClassMetadata; |
|
| 10 | 9 | use Doctrine\ORM\Mapping\FetchMode; |
| 11 | 10 | use Doctrine\ORM\ORMInvalidArgumentException; |
| 12 | 11 | use Doctrine\ORM\PersistentCollection; |
@@ -363,9 +363,9 @@ discard block |
||
| 363 | 363 | self::assertEquals(2, count($user->phonenumbers)); |
| 364 | 364 | $dql = "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = ?1"; |
| 365 | 365 | $user = $this->em->createQuery($dql) |
| 366 | - ->setParameter(1, $user->id) |
|
| 367 | - ->setHint(Query::HINT_REFRESH, true) |
|
| 368 | - ->getSingleResult(); |
|
| 366 | + ->setParameter(1, $user->id) |
|
| 367 | + ->setHint(Query::HINT_REFRESH, true) |
|
| 368 | + ->getSingleResult(); |
|
| 369 | 369 | |
| 370 | 370 | self::assertEquals(1, count($user->phonenumbers)); |
| 371 | 371 | } |
@@ -400,8 +400,8 @@ discard block |
||
| 400 | 400 | |
| 401 | 401 | $dql = "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = ?1"; |
| 402 | 402 | $user = $this->em->createQuery($dql) |
| 403 | - ->setParameter(1, $userId) |
|
| 404 | - ->getSingleResult(); |
|
| 403 | + ->setParameter(1, $userId) |
|
| 404 | + ->getSingleResult(); |
|
| 405 | 405 | |
| 406 | 406 | self::assertEquals(1, count($user->phonenumbers)); |
| 407 | 407 | } |
@@ -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; |
| 6 | 6 | |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | $user->username = 'gblanco'; |
| 186 | 186 | $user->status = 'developer'; |
| 187 | 187 | |
| 188 | - for ($i=0; $i<3; ++$i) { |
|
| 188 | + for ($i = 0; $i < 3; ++$i) { |
|
| 189 | 189 | $phone = new CmsPhonenumber; |
| 190 | 190 | $phone->phonenumber = 100 + $i; |
| 191 | 191 | $user->addPhonenumber($phone); |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | $user->username = 'gblanco'; |
| 414 | 414 | $user->status = 'developer'; |
| 415 | 415 | |
| 416 | - for ($i=0; $i<3; ++$i) { |
|
| 416 | + for ($i = 0; $i < 3; ++$i) { |
|
| 417 | 417 | $phone = new CmsPhonenumber; |
| 418 | 418 | $phone->phonenumber = 100 + $i; |
| 419 | 419 | $user->addPhonenumber($phone); |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | $user->username = 'gblanco'; |
| 454 | 454 | $user->status = 'developer'; |
| 455 | 455 | |
| 456 | - for ($i=0; $i<3; ++$i) { |
|
| 456 | + for ($i = 0; $i < 3; ++$i) { |
|
| 457 | 457 | $phone = new CmsPhonenumber; |
| 458 | 458 | $phone->phonenumber = 100 + $i; |
| 459 | 459 | $user->addPhonenumber($phone); |
@@ -533,7 +533,7 @@ discard block |
||
| 533 | 533 | $user->username = 'gblanco'; |
| 534 | 534 | $user->status = 'developer'; |
| 535 | 535 | |
| 536 | - for ($i=0; $i<3; ++$i) { |
|
| 536 | + for ($i = 0; $i < 3; ++$i) { |
|
| 537 | 537 | $phone = new CmsPhonenumber; |
| 538 | 538 | $phone->phonenumber = 100 + $i; |
| 539 | 539 | $user->addPhonenumber($phone); |
@@ -1003,7 +1003,7 @@ discard block |
||
| 1003 | 1003 | |
| 1004 | 1004 | self::assertInstanceOf(Proxy::class, $article->user, "It IS a proxy, ..."); |
| 1005 | 1005 | self::assertTrue($article->user->__isInitialized(), "...but its initialized!"); |
| 1006 | - self::assertEquals($qc+2, $this->getCurrentQueryCount()); |
|
| 1006 | + self::assertEquals($qc + 2, $this->getCurrentQueryCount()); |
|
| 1007 | 1007 | } |
| 1008 | 1008 | |
| 1009 | 1009 | /** |
@@ -1064,7 +1064,7 @@ discard block |
||
| 1064 | 1064 | |
| 1065 | 1065 | $this->expectException(ORMInvalidArgumentException::class); |
| 1066 | 1066 | $this->expectExceptionMessage( |
| 1067 | - 'Expected value of type "Doctrine\Tests\Models\CMS\CmsAddress" for association field ' . |
|
| 1067 | + 'Expected value of type "Doctrine\Tests\Models\CMS\CmsAddress" for association field '. |
|
| 1068 | 1068 | '"Doctrine\Tests\Models\CMS\CmsUser#$address", got "Doctrine\Tests\Models\CMS\CmsUser" instead.' |
| 1069 | 1069 | ); |
| 1070 | 1070 | |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | declare(strict_types=1); |
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\ORM\Functional; |
| 6 | -use Doctrine\Common\Util\Debug; |
|
| 7 | 6 | use Doctrine\ORM\ORMException; |
| 8 | 7 | use Doctrine\ORM\Query\QueryException; |
| 9 | 8 | use Doctrine\Tests\Models\Navigation\NavCountry; |
@@ -112,9 +112,9 @@ discard block |
||
| 112 | 112 | $this->putTripAroundEurope(); |
| 113 | 113 | |
| 114 | 114 | $dql = 'SELECT t, p, c ' |
| 115 | - . 'FROM Doctrine\Tests\Models\Navigation\NavTour t ' |
|
| 116 | - . 'INNER JOIN t.pois p ' |
|
| 117 | - . 'INNER JOIN p.country c' |
|
| 115 | + . 'FROM Doctrine\Tests\Models\Navigation\NavTour t ' |
|
| 116 | + . 'INNER JOIN t.pois p ' |
|
| 117 | + . 'INNER JOIN p.country c' |
|
| 118 | 118 | ; |
| 119 | 119 | |
| 120 | 120 | $tours = $this->em->createQuery($dql)->getResult(); |
@@ -134,9 +134,9 @@ discard block |
||
| 134 | 134 | $this->putTripAroundEurope(); |
| 135 | 135 | |
| 136 | 136 | $dql = 'SELECT t ' |
| 137 | - . 'FROM Doctrine\Tests\Models\Navigation\NavTour t ' |
|
| 138 | - . ', Doctrine\Tests\Models\Navigation\NavPointOfInterest p ' |
|
| 139 | - . 'WHERE p MEMBER OF t.pois' |
|
| 137 | + . 'FROM Doctrine\Tests\Models\Navigation\NavTour t ' |
|
| 138 | + . ', Doctrine\Tests\Models\Navigation\NavPointOfInterest p ' |
|
| 139 | + . 'WHERE p MEMBER OF t.pois' |
|
| 140 | 140 | ; |
| 141 | 141 | |
| 142 | 142 | $query = $this->em->createQuery($dql); |
@@ -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\ORM\Functional; |
| 6 | 6 | use Doctrine\Common\Util\Debug; |
@@ -6,7 +6,6 @@ |
||
| 6 | 6 | |
| 7 | 7 | use Doctrine\DBAL\Exception\UniqueConstraintViolationException; |
| 8 | 8 | use Doctrine\ORM\OptimisticLockException; |
| 9 | -use Doctrine\ORM\ORMException; |
|
| 10 | 9 | use Doctrine\ORM\Proxy\Proxy; |
| 11 | 10 | use Doctrine\Tests\Models\CMS\CmsUser; |
| 12 | 11 | use Doctrine\Tests\Models\CMS\CmsPhonenumber; |
@@ -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; |
| 6 | 6 | |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | $this->em->flush(); |
| 176 | 176 | $this->em->detach($user); |
| 177 | 177 | |
| 178 | - $dql = 'SELECT u FROM ' . CmsUser::class . ' u WHERE u.id = ?1'; |
|
| 178 | + $dql = 'SELECT u FROM '.CmsUser::class.' u WHERE u.id = ?1'; |
|
| 179 | 179 | $query = $this->em->createQuery($dql); |
| 180 | 180 | |
| 181 | 181 | $query->setParameter(1, $user); |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | |
| 220 | 220 | $this->em->detach($article); |
| 221 | 221 | |
| 222 | - $sql = 'UPDATE cms_articles SET version = version + 1 WHERE id = ' . $article->id; |
|
| 222 | + $sql = 'UPDATE cms_articles SET version = version + 1 WHERE id = '.$article->id; |
|
| 223 | 223 | $this->em->getConnection()->executeUpdate($sql); |
| 224 | 224 | |
| 225 | 225 | $this->expectException(OptimisticLockException::class); |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\ORM\Functional; |
| 6 | 6 | |
| 7 | -use Doctrine\ORM\Mapping\ClassMetadata; |
|
| 8 | 7 | use Doctrine\ORM\Mapping\FetchMode; |
| 9 | 8 | use Doctrine\Tests\Models\CMS\CmsArticle; |
| 10 | 9 | use Doctrine\Tests\Models\CMS\CmsGroup; |
@@ -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; |
| 6 | 6 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | $this->useModelSet('ddc2504'); |
| 44 | 44 | parent::setUp(); |
| 45 | 45 | |
| 46 | - $class = $this->em->getClassMetadata(CmsUser::class); |
|
| 46 | + $class = $this->em->getClassMetadata(CmsUser::class); |
|
| 47 | 47 | |
| 48 | 48 | $class->getProperty('groups')->setFetchMode(FetchMode::EXTRA_LAZY); |
| 49 | 49 | $class->getProperty('articles')->setFetchMode(FetchMode::EXTRA_LAZY); |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | |
| 305 | 305 | $queryCount = $this->getCurrentQueryCount(); |
| 306 | 306 | self::assertFalse($user->articles->contains($article)); |
| 307 | - self::assertEquals($queryCount+1, $this->getCurrentQueryCount(), "Checking for contains of persisted entity should cause one query to be executed."); |
|
| 307 | + self::assertEquals($queryCount + 1, $this->getCurrentQueryCount(), "Checking for contains of persisted entity should cause one query to be executed."); |
|
| 308 | 308 | self::assertFalse($user->articles->isInitialized(), "Post-Condition: Collection is not initialized."); |
| 309 | 309 | |
| 310 | 310 | // Test One to Many existence with state managed |
@@ -471,7 +471,7 @@ discard block |
||
| 471 | 471 | |
| 472 | 472 | $queryCount = $this->getCurrentQueryCount(); |
| 473 | 473 | self::assertTrue($group->users->contains($user)); |
| 474 | - self::assertEquals($queryCount+1, $this->getCurrentQueryCount(), "Checking for contains of managed entity should cause one query to be executed."); |
|
| 474 | + self::assertEquals($queryCount + 1, $this->getCurrentQueryCount(), "Checking for contains of managed entity should cause one query to be executed."); |
|
| 475 | 475 | self::assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized."); |
| 476 | 476 | |
| 477 | 477 | $newUser = new CmsUser(); |
@@ -1251,7 +1251,7 @@ discard block |
||
| 1251 | 1251 | $user = new User(); |
| 1252 | 1252 | $userList = new UserList(); |
| 1253 | 1253 | |
| 1254 | - $user->name = 'ocramius'; |
|
| 1254 | + $user->name = 'ocramius'; |
|
| 1255 | 1255 | $userList->listName = 'PHP Developers to follow closely'; |
| 1256 | 1256 | |
| 1257 | 1257 | $user->addUserList($userList); |
@@ -6,8 +6,6 @@ |
||
| 6 | 6 | |
| 7 | 7 | use Doctrine\ORM\Mapping\FetchMode; |
| 8 | 8 | use Doctrine\Tests\Models\ECommerce\ECommerceProduct; |
| 9 | -use Doctrine\ORM\Mapping\AssociationMapping; |
|
| 10 | -use Doctrine\ORM\Mapping\ClassMetadata; |
|
| 11 | 9 | |
| 12 | 10 | /** |
| 13 | 11 | * Tests a self referential many-to-many association mapping (from a model to the same model, without inheritance). |
@@ -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\ORM\Functional; |
| 6 | 6 | |