@@ -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 | |
@@ -7,8 +7,6 @@ |
||
| 7 | 7 | use Doctrine\ORM\Mapping\FetchMode; |
| 8 | 8 | use Doctrine\Tests\Models\ECommerce\ECommerceCart; |
| 9 | 9 | use Doctrine\Tests\Models\ECommerce\ECommerceProduct; |
| 10 | -use Doctrine\ORM\Mapping\AssociationMapping; |
|
| 11 | -use Doctrine\ORM\Mapping\ClassMetadata; |
|
| 12 | 10 | |
| 13 | 11 | /** |
| 14 | 12 | * Tests a unidirectional many-to-many association mapping (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 | |
@@ -100,6 +100,9 @@ discard block |
||
| 100 | 100 | $this->listeners[] = $listener; |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | + /** |
|
| 104 | + * @param string $propName |
|
| 105 | + */ |
|
| 103 | 106 | protected function onPropertyChanged($propName, $oldValue, $newValue) { |
| 104 | 107 | if ($this->listeners) { |
| 105 | 108 | foreach ($this->listeners as $listener) { |
@@ -132,6 +135,9 @@ discard block |
||
| 132 | 135 | return $this->name; |
| 133 | 136 | } |
| 134 | 137 | |
| 138 | + /** |
|
| 139 | + * @param string $name |
|
| 140 | + */ |
|
| 135 | 141 | public function setName($name) { |
| 136 | 142 | $this->onPropertyChanged('name', $this->name, $name); |
| 137 | 143 | $this->name = $name; |
@@ -165,6 +171,9 @@ discard block |
||
| 165 | 171 | return $this->name; |
| 166 | 172 | } |
| 167 | 173 | |
| 174 | + /** |
|
| 175 | + * @param string $name |
|
| 176 | + */ |
|
| 168 | 177 | public function setName($name) { |
| 169 | 178 | $this->onPropertyChanged('name', $this->name, $name); |
| 170 | 179 | $this->name = $name; |
@@ -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 | |
@@ -4,8 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\ORM\Functional; |
| 6 | 6 | |
| 7 | -use Doctrine\ORM\Mapping\AssociationMapping; |
|
| 8 | -use Doctrine\ORM\Mapping\ClassMetadata; |
|
| 9 | 7 | use Doctrine\ORM\Mapping\FetchMode; |
| 10 | 8 | use Doctrine\Tests\Models\ECommerce\ECommerceCategory; |
| 11 | 9 | use Doctrine\Tests\OrmFunctionalTestCase; |
@@ -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 | |
@@ -4,8 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\ORM\Functional; |
| 6 | 6 | |
| 7 | -use Doctrine\ORM\Mapping\AssociationMapping; |
|
| 8 | -use Doctrine\ORM\Mapping\ClassMetadata; |
|
| 9 | 7 | use Doctrine\ORM\Mapping\FetchMode; |
| 10 | 8 | use Doctrine\ORM\Proxy\Proxy; |
| 11 | 9 | use Doctrine\Tests\Models\ECommerce\ECommerceCart; |
@@ -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 | |