@@ -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\Persisters; |
| 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\Functional\SchemaTool; |
| 6 | 6 | |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | parent::setUp(); |
| 17 | 17 | |
| 18 | 18 | if ($this->em->getConnection()->getDatabasePlatform()->getName() !== 'postgresql') { |
| 19 | - $this->markTestSkipped('The ' . __CLASS__ .' requires the use of postgresql.'); |
|
| 19 | + $this->markTestSkipped('The '.__CLASS__.' requires the use of postgresql.'); |
|
| 20 | 20 | } |
| 21 | 21 | } |
| 22 | 22 | |
@@ -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\SchemaTool; |
| 6 | 6 | |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | */ |
| 59 | 59 | public function testDropPartSchemaWithForeignKeys() |
| 60 | 60 | { |
| 61 | - if (!$this->em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
| 61 | + if ( ! $this->em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
| 62 | 62 | $this->markTestSkipped("Foreign Key test"); |
| 63 | 63 | } |
| 64 | 64 | |
@@ -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\SchemaTool; |
| 6 | 6 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | $updateSql = $this->schemaTool->getUpdateSchemaSql([$class]); |
| 32 | 32 | |
| 33 | - $updateSql = array_filter($updateSql, function ($sql) { |
|
| 33 | + $updateSql = array_filter($updateSql, function($sql) { |
|
| 34 | 34 | return strpos($sql, 'DBAL483') !== false; |
| 35 | 35 | }); |
| 36 | 36 | |
@@ -36,37 +36,37 @@ |
||
| 36 | 36 | $dql = "SELECT u FROM Doctrine\Tests\Models\Cms\CmsUser u"; |
| 37 | 37 | |
| 38 | 38 | $users = $this->em->createQuery($dql) |
| 39 | - ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache)) |
|
| 40 | - ->getResult(); |
|
| 39 | + ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache)) |
|
| 40 | + ->getResult(); |
|
| 41 | 41 | |
| 42 | 42 | $c = $this->getCurrentQueryCount(); |
| 43 | 43 | $users = $this->em->createQuery($dql) |
| 44 | - ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache)) |
|
| 45 | - ->getResult(); |
|
| 44 | + ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache)) |
|
| 45 | + ->getResult(); |
|
| 46 | 46 | |
| 47 | 47 | self::assertEquals($c, $this->getCurrentQueryCount(), "Should not execute query. Its cached!"); |
| 48 | 48 | |
| 49 | 49 | $users = $this->em->createQuery($dql) |
| 50 | - ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache)) |
|
| 51 | - ->getArrayResult(); |
|
| 50 | + ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache)) |
|
| 51 | + ->getArrayResult(); |
|
| 52 | 52 | |
| 53 | 53 | self::assertEquals($c + 1, $this->getCurrentQueryCount(), "Hydration is part of cache key."); |
| 54 | 54 | |
| 55 | 55 | $users = $this->em->createQuery($dql) |
| 56 | - ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache)) |
|
| 57 | - ->getArrayResult(); |
|
| 56 | + ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache)) |
|
| 57 | + ->getArrayResult(); |
|
| 58 | 58 | |
| 59 | 59 | self::assertEquals($c + 1, $this->getCurrentQueryCount(), "Hydration now cached"); |
| 60 | 60 | |
| 61 | 61 | $users = $this->em->createQuery($dql) |
| 62 | - ->setHydrationCacheProfile(new QueryCacheProfile(null, 'cachekey', $cache)) |
|
| 63 | - ->getArrayResult(); |
|
| 62 | + ->setHydrationCacheProfile(new QueryCacheProfile(null, 'cachekey', $cache)) |
|
| 63 | + ->getArrayResult(); |
|
| 64 | 64 | |
| 65 | 65 | self::assertTrue($cache->contains('cachekey'), 'Explicit cache key'); |
| 66 | 66 | |
| 67 | 67 | $users = $this->em->createQuery($dql) |
| 68 | - ->setHydrationCacheProfile(new QueryCacheProfile(null, 'cachekey', $cache)) |
|
| 69 | - ->getArrayResult(); |
|
| 68 | + ->setHydrationCacheProfile(new QueryCacheProfile(null, 'cachekey', $cache)) |
|
| 69 | + ->getArrayResult(); |
|
| 70 | 70 | self::assertEquals($c + 2, $this->getCurrentQueryCount(), "Hydration now cached"); |
| 71 | 71 | } |
| 72 | 72 | |
@@ -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 | |
@@ -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 | |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | $test = new OptimisticStandard(); |
| 119 | 119 | |
| 120 | 120 | for ($i = 0; $i < 5; $i++) { |
| 121 | - $test->name = 'test' . $i; |
|
| 121 | + $test->name = 'test'.$i; |
|
| 122 | 122 | |
| 123 | 123 | $this->em->persist($test); |
| 124 | 124 | $this->em->flush(); |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | $caughtException = null; |
| 253 | 253 | |
| 254 | 254 | try { |
| 255 | - $expectedVersionExpired = DateTime::createFromFormat('U', (string) ($test->version->getTimestamp()-3600)); |
|
| 255 | + $expectedVersionExpired = DateTime::createFromFormat('U', (string) ($test->version->getTimestamp() - 3600)); |
|
| 256 | 256 | |
| 257 | 257 | $this->em->lock($test, LockMode::OPTIMISTIC, $expectedVersionExpired); |
| 258 | 258 | } catch (OptimisticLockException $e) { |
@@ -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 | |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | protected function setUp() |
| 21 | 21 | { |
| 22 | - if (!class_exists('GearmanClient', false)) { |
|
| 22 | + if ( ! class_exists('GearmanClient', false)) { |
|
| 23 | 23 | $this->markTestSkipped('pecl/gearman is required for this test to run.'); |
| 24 | 24 | } |
| 25 | 25 | |
@@ -135,11 +135,11 @@ discard block |
||
| 135 | 135 | $this->gearman->runTasks(); |
| 136 | 136 | |
| 137 | 137 | self::assertTrue($this->maxRunTime > $forTime, |
| 138 | - "Because of locking this tests should have run at least " . $forTime . " seconds, ". |
|
| 139 | - "but only did for " . $this->maxRunTime . " seconds."); |
|
| 138 | + "Because of locking this tests should have run at least ".$forTime." seconds, ". |
|
| 139 | + "but only did for ".$this->maxRunTime." seconds."); |
|
| 140 | 140 | self::assertTrue($this->maxRunTime < $notLongerThan, |
| 141 | - "The longest task should not run longer than " . $notLongerThan . " seconds, ". |
|
| 142 | - "but did for " . $this->maxRunTime . " seconds." |
|
| 141 | + "The longest task should not run longer than ".$notLongerThan." seconds, ". |
|
| 142 | + "but did for ".$this->maxRunTime." seconds." |
|
| 143 | 143 | ); |
| 144 | 144 | } |
| 145 | 145 | |
@@ -212,7 +212,7 @@ |
||
| 212 | 212 | $this->expectExceptionMessage('The optimistic lock on an entity failed.'); |
| 213 | 213 | |
| 214 | 214 | $this->em->createQuery($dql) |
| 215 | - ->setHint(Query::HINT_LOCK_MODE, LockMode::OPTIMISTIC) |
|
| 216 | - ->getSQL(); |
|
| 215 | + ->setHint(Query::HINT_LOCK_MODE, LockMode::OPTIMISTIC) |
|
| 216 | + ->getSQL(); |
|
| 217 | 217 | } |
| 218 | 218 | } |
@@ -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 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | $article = new CmsArticle(); |
| 90 | 90 | |
| 91 | 91 | $this->expectException(\InvalidArgumentException::class); |
| 92 | - $this->expectExceptionMessage('Entity ' . CmsArticle::class); |
|
| 92 | + $this->expectExceptionMessage('Entity '.CmsArticle::class); |
|
| 93 | 93 | |
| 94 | 94 | $this->em->lock($article, LockMode::OPTIMISTIC, $article->version + 1); |
| 95 | 95 | } |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | { |
| 139 | 139 | $writeLockSql = $this->em->getConnection()->getDatabasePlatform()->getWriteLockSQL(); |
| 140 | 140 | |
| 141 | - if (! $writeLockSql) { |
|
| 141 | + if ( ! $writeLockSql) { |
|
| 142 | 142 | $this->markTestSkipped('Database Driver has no Write Lock support.'); |
| 143 | 143 | } |
| 144 | 144 | |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | { |
| 174 | 174 | $readLockSql = $this->em->getConnection()->getDatabasePlatform()->getReadLockSQL(); |
| 175 | 175 | |
| 176 | - if (! $readLockSql) { |
|
| 176 | + if ( ! $readLockSql) { |
|
| 177 | 177 | $this->markTestSkipped('Database Driver has no Write Lock support.'); |
| 178 | 178 | } |
| 179 | 179 | |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | */ |
| 207 | 207 | public function testLockOptimisticNonVersionedThrowsExceptionInDQL() |
| 208 | 208 | { |
| 209 | - $dql = "SELECT u FROM " . CmsUser::class . " u WHERE u.username = 'gblanco'"; |
|
| 209 | + $dql = "SELECT u FROM ".CmsUser::class." u WHERE u.username = 'gblanco'"; |
|
| 210 | 210 | |
| 211 | 211 | $this->expectException(OptimisticLockException::class); |
| 212 | 212 | $this->expectExceptionMessage('The optimistic lock on an entity failed.'); |
@@ -224,13 +224,13 @@ |
||
| 224 | 224 | |
| 225 | 225 | $q = $this->em->createNativeQuery('SELECT id, name, status, phonenumber FROM cms_users INNER JOIN cms_phonenumbers ON id = user_id WHERE username = ?', $rsm); |
| 226 | 226 | $q2 = $q->setSQL('foo') |
| 227 | - ->setResultSetMapping($rsm) |
|
| 228 | - ->expireResultCache(true) |
|
| 229 | - ->setHint('foo', 'bar') |
|
| 230 | - ->setParameter(1, 'foo') |
|
| 231 | - ->setParameters($parameters) |
|
| 232 | - ->setResultCacheDriver(null) |
|
| 233 | - ->setResultCacheLifetime(3500); |
|
| 227 | + ->setResultSetMapping($rsm) |
|
| 228 | + ->expireResultCache(true) |
|
| 229 | + ->setHint('foo', 'bar') |
|
| 230 | + ->setParameter(1, 'foo') |
|
| 231 | + ->setParameters($parameters) |
|
| 232 | + ->setResultCacheDriver(null) |
|
| 233 | + ->setResultCacheLifetime(3500); |
|
| 234 | 234 | |
| 235 | 235 | self::assertSame($q, $q2); |
| 236 | 236 | } |
@@ -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 | |
@@ -436,8 +436,8 @@ discard block |
||
| 436 | 436 | |
| 437 | 437 | self::assertCount(1, $result); |
| 438 | 438 | self::assertInstanceOf(CmsAddress::class, $result[0]); |
| 439 | - self::assertEquals($addr->id, $result[0]->id); |
|
| 440 | - self::assertEquals($addr->city, $result[0]->city); |
|
| 439 | + self::assertEquals($addr->id, $result[0]->id); |
|
| 440 | + self::assertEquals($addr->city, $result[0]->city); |
|
| 441 | 441 | self::assertEquals($addr->country, $result[0]->country); |
| 442 | 442 | } |
| 443 | 443 | |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | |
| 455 | 455 | $email = new CmsEmail(); |
| 456 | 456 | |
| 457 | - $email->email = '[email protected]'; |
|
| 457 | + $email->email = '[email protected]'; |
|
| 458 | 458 | |
| 459 | 459 | $user->setEmail($email); |
| 460 | 460 | |
@@ -605,7 +605,7 @@ discard block |
||
| 605 | 605 | $repository = $this->em->getRepository(CmsUser::class); |
| 606 | 606 | $result = $repository |
| 607 | 607 | ->createNativeNamedQuery('fetchUserPhonenumberCount') |
| 608 | - ->setParameter(1, ['test','FabioBatSilva'])->getResult(); |
|
| 608 | + ->setParameter(1, ['test', 'FabioBatSilva'])->getResult(); |
|
| 609 | 609 | |
| 610 | 610 | self::assertCount(2, $result); |
| 611 | 611 | self::assertInternalType('array', $result[0]); |
@@ -832,7 +832,7 @@ discard block |
||
| 832 | 832 | |
| 833 | 833 | $rsm->addRootEntityFromClassMetadata(CmsUser::class, 'u'); |
| 834 | 834 | |
| 835 | - self::assertSQLEquals('u.id AS id0, u.status AS status1, u.username AS username2, u.name AS name3, u.email_id AS email_id4', (string)$rsm); |
|
| 835 | + self::assertSQLEquals('u.id AS id0, u.status AS status1, u.username AS username2, u.name AS name3, u.email_id AS email_id4', (string) $rsm); |
|
| 836 | 836 | } |
| 837 | 837 | |
| 838 | 838 | /** |