@@ -237,10 +237,10 @@ |
||
| 237 | 237 | { |
| 238 | 238 | $config = new Configuration(); |
| 239 | 239 | |
| 240 | - $config->setProxyDir(realpath(__DIR__ . '/../../Proxies')); |
|
| 240 | + $config->setProxyDir(realpath(__DIR__.'/../../Proxies')); |
|
| 241 | 241 | $config->setProxyNamespace('Doctrine\Tests\Proxies'); |
| 242 | 242 | $config->setMetadataDriverImpl($config->newDefaultAnnotationDriver( |
| 243 | - [realpath(__DIR__ . '/../../Models/Cache')], |
|
| 243 | + [realpath(__DIR__.'/../../Models/Cache')], |
|
| 244 | 244 | true |
| 245 | 245 | )); |
| 246 | 246 | $config->setSQLLogger($logger); |
@@ -152,10 +152,10 @@ |
||
| 152 | 152 | */ |
| 153 | 153 | private $ownerO; |
| 154 | 154 | |
| 155 | - public function __construct(CascadeRemoveOrderEntityO $eO, $position=1) |
|
| 155 | + public function __construct(CascadeRemoveOrderEntityO $eO, $position = 1) |
|
| 156 | 156 | { |
| 157 | 157 | $this->position = $position; |
| 158 | - $this->ownerO= $eO; |
|
| 158 | + $this->ownerO = $eO; |
|
| 159 | 159 | $this->ownerO->addOneToManyG($this); |
| 160 | 160 | } |
| 161 | 161 | |
@@ -214,7 +214,7 @@ |
||
| 214 | 214 | $this->assertNull($this->cache->getEntityCacheRegion(ComplexAction::class)); |
| 215 | 215 | $this->assertInstanceOf(Region::class, $this->cache->getEntityCacheRegion(Token::class)); |
| 216 | 216 | |
| 217 | - $token = new Token('token-hash'); |
|
| 217 | + $token = new Token('token-hash'); |
|
| 218 | 218 | |
| 219 | 219 | $action1 = new Action('login'); |
| 220 | 220 | $action2 = new Action('logout'); |
@@ -411,9 +411,9 @@ |
||
| 411 | 411 | |
| 412 | 412 | $dql = 'SELECT f FROM Doctrine\Tests\Models\Company\CompanyFixContract f WHERE f.id = ?1'; |
| 413 | 413 | $contract = $this->_em->createQuery($dql) |
| 414 | - ->setFetchMode(CompanyFixContract::class, 'salesPerson', ClassMetadata::FETCH_EAGER) |
|
| 415 | - ->setParameter(1, $this->fix->getId()) |
|
| 416 | - ->getSingleResult(); |
|
| 414 | + ->setFetchMode(CompanyFixContract::class, 'salesPerson', ClassMetadata::FETCH_EAGER) |
|
| 415 | + ->setParameter(1, $this->fix->getId()) |
|
| 416 | + ->getSingleResult(); |
|
| 417 | 417 | |
| 418 | 418 | $this->assertNotInstanceOf(Proxy::class, $contract->getSalesPerson()); |
| 419 | 419 | } |
@@ -330,19 +330,19 @@ |
||
| 330 | 330 | |
| 331 | 331 | $repos = $this->_em->getRepository(CompanyContract::class); |
| 332 | 332 | $contracts = $repos->findBy(['salesPerson' => $this->salesPerson->getId()]); |
| 333 | - $this->assertEquals(3, count($contracts), "There should be 3 entities related to " . $this->salesPerson->getId() . " for 'Doctrine\Tests\Models\Company\CompanyContract'"); |
|
| 333 | + $this->assertEquals(3, count($contracts), "There should be 3 entities related to ".$this->salesPerson->getId()." for 'Doctrine\Tests\Models\Company\CompanyContract'"); |
|
| 334 | 334 | |
| 335 | 335 | $repos = $this->_em->getRepository(CompanyFixContract::class); |
| 336 | 336 | $contracts = $repos->findBy(['salesPerson' => $this->salesPerson->getId()]); |
| 337 | - $this->assertEquals(1, count($contracts), "There should be 1 entities related to " . $this->salesPerson->getId() . " for 'Doctrine\Tests\Models\Company\CompanyFixContract'"); |
|
| 337 | + $this->assertEquals(1, count($contracts), "There should be 1 entities related to ".$this->salesPerson->getId()." for 'Doctrine\Tests\Models\Company\CompanyFixContract'"); |
|
| 338 | 338 | |
| 339 | 339 | $repos = $this->_em->getRepository(CompanyFlexContract::class); |
| 340 | 340 | $contracts = $repos->findBy(['salesPerson' => $this->salesPerson->getId()]); |
| 341 | - $this->assertEquals(2, count($contracts), "There should be 2 entities related to " . $this->salesPerson->getId() . " for 'Doctrine\Tests\Models\Company\CompanyFlexContract'"); |
|
| 341 | + $this->assertEquals(2, count($contracts), "There should be 2 entities related to ".$this->salesPerson->getId()." for 'Doctrine\Tests\Models\Company\CompanyFlexContract'"); |
|
| 342 | 342 | |
| 343 | 343 | $repos = $this->_em->getRepository(CompanyFlexUltraContract::class); |
| 344 | 344 | $contracts = $repos->findBy(['salesPerson' => $this->salesPerson->getId()]); |
| 345 | - $this->assertEquals(1, count($contracts), "There should be 1 entities related to " . $this->salesPerson->getId() . " for 'Doctrine\Tests\Models\Company\CompanyFlexUltraContract'"); |
|
| 345 | + $this->assertEquals(1, count($contracts), "There should be 1 entities related to ".$this->salesPerson->getId()." for 'Doctrine\Tests\Models\Company\CompanyFlexUltraContract'"); |
|
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | /** |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | */ |
| 111 | 111 | public $address; |
| 112 | 112 | |
| 113 | - public function getId() {return $this->id;} |
|
| 113 | + public function getId() {return $this->id; } |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | /** |
@@ -152,5 +152,5 @@ discard block |
||
| 152 | 152 | */ |
| 153 | 153 | public $user; |
| 154 | 154 | |
| 155 | - public function getUser() {return $this->user;} |
|
| 155 | + public function getUser() {return $this->user; } |
|
| 156 | 156 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | private function registerType(string $className) |
| 36 | 36 | { |
| 37 | - $type = constant($className . '::NAME'); |
|
| 37 | + $type = constant($className.'::NAME'); |
|
| 38 | 38 | |
| 39 | 39 | if (DBALType::hasType($type)) { |
| 40 | 40 | DBALType::overrideType($type, $className); |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | foreach ($classes as $class) { |
| 71 | 71 | $ce = $validator->validateClass($class); |
| 72 | 72 | |
| 73 | - $this->assertEmpty($ce, "Invalid Modelset: " . $modelSet . " class " . $class->name . ": ". implode("\n", $ce)); |
|
| 73 | + $this->assertEmpty($ce, "Invalid Modelset: ".$modelSet." class ".$class->name.": ".implode("\n", $ce)); |
|
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | } |
@@ -232,8 +232,8 @@ discard block |
||
| 232 | 232 | $eventManager->addEventListener([Events::postLoad], $listener); |
| 233 | 233 | |
| 234 | 234 | $this->_em->find(CmsUser::class, $this->userId); |
| 235 | - $this->assertSame(1, $listener->countHandledEvents(CmsUser::class), CmsUser::class . ' should be handled once!'); |
|
| 236 | - $this->assertSame(1, $listener->countHandledEvents(CmsEmail::class), CmsEmail::class . ' should be handled once!'); |
|
| 235 | + $this->assertSame(1, $listener->countHandledEvents(CmsUser::class), CmsUser::class.' should be handled once!'); |
|
| 236 | + $this->assertSame(1, $listener->countHandledEvents(CmsEmail::class), CmsEmail::class.' should be handled once!'); |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | private function loadFixture() |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | { |
| 310 | 310 | $object = $event->getObject(); |
| 311 | 311 | $class = ClassUtils::getClass($object); |
| 312 | - if (!isset($this->firedByClasses[$class])) { |
|
| 312 | + if ( ! isset($this->firedByClasses[$class])) { |
|
| 313 | 313 | $this->firedByClasses[$class] = 1; |
| 314 | 314 | } else { |
| 315 | 315 | $this->firedByClasses[$class]++; |
@@ -34,37 +34,37 @@ |
||
| 34 | 34 | $dql = "SELECT u FROM Doctrine\Tests\Models\Cms\CmsUser u"; |
| 35 | 35 | |
| 36 | 36 | $users = $this->_em->createQuery($dql) |
| 37 | - ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache)) |
|
| 38 | - ->getResult(); |
|
| 37 | + ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache)) |
|
| 38 | + ->getResult(); |
|
| 39 | 39 | |
| 40 | 40 | $c = $this->getCurrentQueryCount(); |
| 41 | 41 | $users = $this->_em->createQuery($dql) |
| 42 | - ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache)) |
|
| 43 | - ->getResult(); |
|
| 42 | + ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache)) |
|
| 43 | + ->getResult(); |
|
| 44 | 44 | |
| 45 | 45 | $this->assertEquals($c, $this->getCurrentQueryCount(), "Should not execute query. Its cached!"); |
| 46 | 46 | |
| 47 | 47 | $users = $this->_em->createQuery($dql) |
| 48 | - ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache)) |
|
| 49 | - ->getArrayResult(); |
|
| 48 | + ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache)) |
|
| 49 | + ->getArrayResult(); |
|
| 50 | 50 | |
| 51 | 51 | $this->assertEquals($c + 1, $this->getCurrentQueryCount(), "Hydration is part of cache key."); |
| 52 | 52 | |
| 53 | 53 | $users = $this->_em->createQuery($dql) |
| 54 | - ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache)) |
|
| 55 | - ->getArrayResult(); |
|
| 54 | + ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache)) |
|
| 55 | + ->getArrayResult(); |
|
| 56 | 56 | |
| 57 | 57 | $this->assertEquals($c + 1, $this->getCurrentQueryCount(), "Hydration now cached"); |
| 58 | 58 | |
| 59 | 59 | $users = $this->_em->createQuery($dql) |
| 60 | - ->setHydrationCacheProfile(new QueryCacheProfile(null, 'cachekey', $cache)) |
|
| 61 | - ->getArrayResult(); |
|
| 60 | + ->setHydrationCacheProfile(new QueryCacheProfile(null, 'cachekey', $cache)) |
|
| 61 | + ->getArrayResult(); |
|
| 62 | 62 | |
| 63 | 63 | $this->assertTrue($cache->contains('cachekey'), 'Explicit cache key'); |
| 64 | 64 | |
| 65 | 65 | $users = $this->_em->createQuery($dql) |
| 66 | - ->setHydrationCacheProfile(new QueryCacheProfile(null, 'cachekey', $cache)) |
|
| 67 | - ->getArrayResult(); |
|
| 66 | + ->setHydrationCacheProfile(new QueryCacheProfile(null, 'cachekey', $cache)) |
|
| 67 | + ->getArrayResult(); |
|
| 68 | 68 | $this->assertEquals($c + 2, $this->getCurrentQueryCount(), "Hydration now cached"); |
| 69 | 69 | } |
| 70 | 70 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | $this->_em->clear(); |
| 51 | 51 | |
| 52 | - $result2 = $this->_em->createQuery($dql) |
|
| 52 | + $result2 = $this->_em->createQuery($dql) |
|
| 53 | 53 | ->setCacheable(true) |
| 54 | 54 | ->getResult(); |
| 55 | 55 | |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | |
| 253 | 253 | $this->_em->clear(); |
| 254 | 254 | |
| 255 | - $result2 = $this->_em->createQuery($dql) |
|
| 255 | + $result2 = $this->_em->createQuery($dql) |
|
| 256 | 256 | ->setCacheable(true) |
| 257 | 257 | ->getResult(); |
| 258 | 258 | |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | |
| 345 | 345 | $this->_em->clear(); |
| 346 | 346 | |
| 347 | - $result2 = $this->_em->createQuery($dql) |
|
| 347 | + $result2 = $this->_em->createQuery($dql) |
|
| 348 | 348 | ->setCacheable(true) |
| 349 | 349 | ->getResult(); |
| 350 | 350 | |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | |
| 393 | 393 | $this->_em->clear(); |
| 394 | 394 | |
| 395 | - $result2 = $this->_em->createQuery($dql)->setCacheable(true) |
|
| 395 | + $result2 = $this->_em->createQuery($dql)->setCacheable(true) |
|
| 396 | 396 | ->setParameter('name', $name) |
| 397 | 397 | ->getResult(); |
| 398 | 398 | |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | $result1 = $this->_em->createQuery($dql)->setCacheable(true)->getResult(); |
| 421 | 421 | |
| 422 | 422 | $this->assertCount(2, $result1); |
| 423 | - $this->assertEquals($queryCount + 1 , $this->getCurrentQueryCount()); |
|
| 423 | + $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount()); |
|
| 424 | 424 | $this->assertEquals($this->countries[0]->getId(), $result1[0]->getId()); |
| 425 | 425 | $this->assertEquals($this->countries[1]->getId(), $result1[1]->getId()); |
| 426 | 426 | $this->assertEquals($this->countries[0]->getName(), $result1[0]->getName()); |
@@ -436,11 +436,11 @@ discard block |
||
| 436 | 436 | |
| 437 | 437 | $this->_em->clear(); |
| 438 | 438 | |
| 439 | - $result2 = $this->_em->createQuery($dql) |
|
| 439 | + $result2 = $this->_em->createQuery($dql) |
|
| 440 | 440 | ->setCacheable(true) |
| 441 | 441 | ->getResult(); |
| 442 | 442 | |
| 443 | - $this->assertEquals($queryCount + 2 , $this->getCurrentQueryCount()); |
|
| 443 | + $this->assertEquals($queryCount + 2, $this->getCurrentQueryCount()); |
|
| 444 | 444 | $this->assertCount(2, $result2); |
| 445 | 445 | |
| 446 | 446 | $this->assertEquals(5, $this->secondLevelCacheLogger->getPutCount()); |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | $this->assertEquals($result1[0]->getName(), $result2[0]->getName()); |
| 458 | 458 | $this->assertEquals($result1[1]->getName(), $result2[1]->getName()); |
| 459 | 459 | |
| 460 | - $this->assertEquals($queryCount + 2 , $this->getCurrentQueryCount()); |
|
| 460 | + $this->assertEquals($queryCount + 2, $this->getCurrentQueryCount()); |
|
| 461 | 461 | } |
| 462 | 462 | |
| 463 | 463 | public function testBasicQueryFetchJoinsOneToMany() |
@@ -498,7 +498,7 @@ discard block |
||
| 498 | 498 | |
| 499 | 499 | $this->_em->clear(); |
| 500 | 500 | |
| 501 | - $result2 = $this->_em->createQuery($dql) |
|
| 501 | + $result2 = $this->_em->createQuery($dql) |
|
| 502 | 502 | ->setCacheable(true) |
| 503 | 503 | ->getResult(); |
| 504 | 504 | |
@@ -564,7 +564,7 @@ discard block |
||
| 564 | 564 | $this->_em->clear(); |
| 565 | 565 | $this->secondLevelCacheLogger->clearStats(); |
| 566 | 566 | |
| 567 | - $result2 = $this->_em->createQuery($dql) |
|
| 567 | + $result2 = $this->_em->createQuery($dql) |
|
| 568 | 568 | ->setCacheable(true) |
| 569 | 569 | ->getResult(); |
| 570 | 570 | |
@@ -624,7 +624,7 @@ discard block |
||
| 624 | 624 | |
| 625 | 625 | $this->cache->evictEntityRegion(State::class); |
| 626 | 626 | |
| 627 | - $result2 = $this->_em->createQuery($dql) |
|
| 627 | + $result2 = $this->_em->createQuery($dql) |
|
| 628 | 628 | ->setCacheable(true) |
| 629 | 629 | ->getResult(); |
| 630 | 630 | |
@@ -667,7 +667,7 @@ discard block |
||
| 667 | 667 | |
| 668 | 668 | $this->cache->evictEntityRegion(City::class); |
| 669 | 669 | |
| 670 | - $result2 = $this->_em->createQuery($dql) |
|
| 670 | + $result2 = $this->_em->createQuery($dql) |
|
| 671 | 671 | ->setCacheable(true) |
| 672 | 672 | ->getResult(); |
| 673 | 673 | |
@@ -718,7 +718,7 @@ discard block |
||
| 718 | 718 | |
| 719 | 719 | $this->_em->clear(); |
| 720 | 720 | |
| 721 | - $result2 = $this->_em->createNativeQuery($sql, $rsm) |
|
| 721 | + $result2 = $this->_em->createNativeQuery($sql, $rsm) |
|
| 722 | 722 | ->setCacheable(true) |
| 723 | 723 | ->getResult(); |
| 724 | 724 | |
@@ -773,7 +773,7 @@ discard block |
||
| 773 | 773 | |
| 774 | 774 | $this->_em->clear(); |
| 775 | 775 | |
| 776 | - $result2 = $this->_em->createQuery($dql) |
|
| 776 | + $result2 = $this->_em->createQuery($dql) |
|
| 777 | 777 | ->setCacheable(true) |
| 778 | 778 | ->setFirstResult(2) |
| 779 | 779 | ->setMaxResults(1) |
@@ -785,7 +785,7 @@ discard block |
||
| 785 | 785 | |
| 786 | 786 | $this->_em->clear(); |
| 787 | 787 | |
| 788 | - $result3 = $this->_em->createQuery($dql) |
|
| 788 | + $result3 = $this->_em->createQuery($dql) |
|
| 789 | 789 | ->setCacheable(true) |
| 790 | 790 | ->getResult(); |
| 791 | 791 | |
@@ -802,7 +802,7 @@ discard block |
||
| 802 | 802 | $this->secondLevelCacheLogger->clearStats(); |
| 803 | 803 | $this->_em->clear(); |
| 804 | 804 | |
| 805 | - $getHash = function(AbstractQuery $query){ |
|
| 805 | + $getHash = function(AbstractQuery $query) { |
|
| 806 | 806 | $method = new \ReflectionMethod($query, 'getHash'); |
| 807 | 807 | $method->setAccessible(true); |
| 808 | 808 | |
@@ -835,7 +835,7 @@ discard block |
||
| 835 | 835 | ->getRegion() |
| 836 | 836 | ->put($key, $entry); |
| 837 | 837 | |
| 838 | - $result2 = $this->_em->createQuery($dql) |
|
| 838 | + $result2 = $this->_em->createQuery($dql) |
|
| 839 | 839 | ->setCacheable(true) |
| 840 | 840 | ->setLifetime(3600) |
| 841 | 841 | ->getResult(); |