@@ -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 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $driver = new DatabaseDriver($sm); |
57 | 57 | |
58 | 58 | foreach ($driver->getAllClassNames() as $className) { |
59 | - if (! in_array(strtolower($className), $classNames, true)) { |
|
59 | + if ( ! in_array(strtolower($className), $classNames, true)) { |
|
60 | 60 | continue; |
61 | 61 | } |
62 | 62 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | } |
69 | 69 | |
70 | 70 | if (count($metadatas) != count($classNames)) { |
71 | - $this->fail("Have not found all classes matching the names '" . implode(', ', $classNames) . "' only tables " . implode(', ', array_keys($metadatas))); |
|
71 | + $this->fail("Have not found all classes matching the names '".implode(', ', $classNames)."' only tables ".implode(', ', array_keys($metadatas))); |
|
72 | 72 | } |
73 | 73 | return $metadatas; |
74 | 74 | } |
@@ -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 | |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | $user->username = 'gblanco'; |
184 | 184 | $user->status = 'developer'; |
185 | 185 | |
186 | - for ($i=0; $i<3; ++$i) { |
|
186 | + for ($i = 0; $i < 3; ++$i) { |
|
187 | 187 | $phone = new CmsPhonenumber; |
188 | 188 | $phone->phonenumber = 100 + $i; |
189 | 189 | $user->addPhonenumber($phone); |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | $user->username = 'gblanco'; |
412 | 412 | $user->status = 'developer'; |
413 | 413 | |
414 | - for ($i=0; $i<3; ++$i) { |
|
414 | + for ($i = 0; $i < 3; ++$i) { |
|
415 | 415 | $phone = new CmsPhonenumber; |
416 | 416 | $phone->phonenumber = 100 + $i; |
417 | 417 | $user->addPhonenumber($phone); |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | $user->username = 'gblanco'; |
452 | 452 | $user->status = 'developer'; |
453 | 453 | |
454 | - for ($i=0; $i<3; ++$i) { |
|
454 | + for ($i = 0; $i < 3; ++$i) { |
|
455 | 455 | $phone = new CmsPhonenumber; |
456 | 456 | $phone->phonenumber = 100 + $i; |
457 | 457 | $user->addPhonenumber($phone); |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | $user->username = 'gblanco'; |
493 | 493 | $user->status = 'developer'; |
494 | 494 | |
495 | - for ($i=0; $i<3; ++$i) { |
|
495 | + for ($i = 0; $i < 3; ++$i) { |
|
496 | 496 | $phone = new CmsPhonenumber; |
497 | 497 | $phone->phonenumber = 100 + $i; |
498 | 498 | $user->addPhonenumber($phone); |
@@ -678,12 +678,12 @@ discard block |
||
678 | 678 | $this->em->persist($user); |
679 | 679 | $this->em->flush(); |
680 | 680 | |
681 | - self::assertEquals(1, $this->em->getConnection()->fetchColumn('select 1 from cms_addresses where user_id = ' . $user->id)); |
|
681 | + self::assertEquals(1, $this->em->getConnection()->fetchColumn('select 1 from cms_addresses where user_id = '.$user->id)); |
|
682 | 682 | |
683 | 683 | $address->user = null; |
684 | 684 | $this->em->flush(); |
685 | 685 | |
686 | - self::assertNotEquals(1, $this->em->getConnection()->fetchColumn('select 1 from cms_addresses where user_id = ' . $user->id)); |
|
686 | + self::assertNotEquals(1, $this->em->getConnection()->fetchColumn('select 1 from cms_addresses where user_id = '.$user->id)); |
|
687 | 687 | } |
688 | 688 | |
689 | 689 | /** |
@@ -877,7 +877,7 @@ discard block |
||
877 | 877 | |
878 | 878 | self::assertInstanceOf(GhostObjectInterface::class, $fetchedUser, 'It IS a proxy, ...'); |
879 | 879 | self::assertTrue($fetchedUser->isProxyInitialized(), '...but its initialized!'); |
880 | - self::assertEquals($qc+2, $this->getCurrentQueryCount()); |
|
880 | + self::assertEquals($qc + 2, $this->getCurrentQueryCount()); |
|
881 | 881 | } |
882 | 882 | |
883 | 883 | /** |
@@ -938,7 +938,7 @@ discard block |
||
938 | 938 | |
939 | 939 | $this->expectException(ORMInvalidArgumentException::class); |
940 | 940 | $this->expectExceptionMessage( |
941 | - 'Expected value of type "Doctrine\Tests\Models\CMS\CmsAddress" for association field ' . |
|
941 | + 'Expected value of type "Doctrine\Tests\Models\CMS\CmsAddress" for association field '. |
|
942 | 942 | '"Doctrine\Tests\Models\CMS\CmsUser#$address", got "Doctrine\Tests\Models\CMS\CmsUser" instead.' |
943 | 943 | ); |
944 | 944 |
@@ -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 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | $this->em->flush(); |
112 | 112 | $this->em->clear(); |
113 | 113 | |
114 | - $dql = 'SELECT p FROM ' . __NAMESPACE__ . "\DDC93Person p"; |
|
114 | + $dql = 'SELECT p FROM '.__NAMESPACE__."\DDC93Person p"; |
|
115 | 115 | $persons = $this->em->createQuery($dql)->getResult(); |
116 | 116 | |
117 | 117 | self::assertCount(3, $persons); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | self::assertEquals('United States of America', $person->address->country->name); |
125 | 125 | } |
126 | 126 | |
127 | - $dql = 'SELECT p FROM ' . __NAMESPACE__ . "\DDC93Person p"; |
|
127 | + $dql = 'SELECT p FROM '.__NAMESPACE__."\DDC93Person p"; |
|
128 | 128 | $persons = $this->em->createQuery($dql)->getArrayResult(); |
129 | 129 | |
130 | 130 | foreach ($persons as $person) { |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | $this->em->flush(); |
150 | 150 | |
151 | 151 | // SELECT |
152 | - $selectDql = 'SELECT p FROM ' . __NAMESPACE__ . '\\DDC93Person p WHERE p.address.city = :city AND p.address.country.name = :country'; |
|
152 | + $selectDql = 'SELECT p FROM '.__NAMESPACE__.'\\DDC93Person p WHERE p.address.city = :city AND p.address.country.name = :country'; |
|
153 | 153 | $loadedPerson = $this->em->createQuery($selectDql) |
154 | 154 | ->setParameter('city', 'Karlsruhe') |
155 | 155 | ->setParameter('country', 'Germany') |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | ); |
165 | 165 | |
166 | 166 | // UPDATE |
167 | - $updateDql = 'UPDATE ' . __NAMESPACE__ . '\\DDC93Person p SET p.address.street = :street, p.address.country.name = :country WHERE p.address.city = :city'; |
|
167 | + $updateDql = 'UPDATE '.__NAMESPACE__.'\\DDC93Person p SET p.address.street = :street, p.address.country.name = :country WHERE p.address.city = :city'; |
|
168 | 168 | $this->em->createQuery($updateDql) |
169 | 169 | ->setParameter('street', 'Boo') |
170 | 170 | ->setParameter('country', 'DE') |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | self::assertEquals('DE', $person->address->country->name); |
177 | 177 | |
178 | 178 | // DELETE |
179 | - $this->em->createQuery('DELETE ' . __NAMESPACE__ . '\\DDC93Person p WHERE p.address.city = :city AND p.address.country.name = :country') |
|
179 | + $this->em->createQuery('DELETE '.__NAMESPACE__.'\\DDC93Person p WHERE p.address.city = :city AND p.address.country.name = :country') |
|
180 | 180 | ->setParameter('city', 'Karlsruhe') |
181 | 181 | ->setParameter('country', 'DE') |
182 | 182 | ->execute(); |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | $this->em->clear(); |
194 | 194 | |
195 | 195 | // Prove that the entity was persisted correctly. |
196 | - $dql = 'SELECT p FROM ' . __NAMESPACE__ . '\\DDC93Person p WHERE p.name = :name'; |
|
196 | + $dql = 'SELECT p FROM '.__NAMESPACE__.'\\DDC93Person p WHERE p.name = :name'; |
|
197 | 197 | |
198 | 198 | $person = $this->em->createQuery($dql) |
199 | 199 | ->setParameter('name', 'Karl') |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | // Clear the EM and prove that the embeddable can be the subject of a partial query. |
208 | 208 | $this->em->clear(); |
209 | 209 | |
210 | - $dql = 'SELECT PARTIAL p.{id,address.city} FROM ' . __NAMESPACE__ . '\\DDC93Person p WHERE p.name = :name'; |
|
210 | + $dql = 'SELECT PARTIAL p.{id,address.city} FROM '.__NAMESPACE__.'\\DDC93Person p WHERE p.name = :name'; |
|
211 | 211 | |
212 | 212 | $person = $this->em->createQuery($dql) |
213 | 213 | ->setParameter('name', 'Karl') |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | // Clear the EM and prove that the embeddable can be the subject of a partial query regardless of attributes positions. |
224 | 224 | $this->em->clear(); |
225 | 225 | |
226 | - $dql = 'SELECT PARTIAL p.{address.city, id} FROM ' . __NAMESPACE__ . '\\DDC93Person p WHERE p.name = :name'; |
|
226 | + $dql = 'SELECT PARTIAL p.{address.city, id} FROM '.__NAMESPACE__.'\\DDC93Person p WHERE p.name = :name'; |
|
227 | 227 | |
228 | 228 | $person = $this->em->createQuery($dql) |
229 | 229 | ->setParameter('name', 'Karl') |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | $this->expectException(QueryException::class); |
243 | 243 | $this->expectExceptionMessage('no field or association named address.asdfasdf'); |
244 | 244 | |
245 | - $this->em->createQuery('SELECT p FROM ' . __NAMESPACE__ . '\\DDC93Person p WHERE p.address.asdfasdf IS NULL') |
|
245 | + $this->em->createQuery('SELECT p FROM '.__NAMESPACE__.'\\DDC93Person p WHERE p.address.asdfasdf IS NULL') |
|
246 | 246 | ->execute(); |
247 | 247 | } |
248 | 248 | |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | $this->expectException(QueryException::class); |
252 | 252 | $this->expectExceptionMessage("no mapped field named 'address.asdfasdf'"); |
253 | 253 | |
254 | - $this->em->createQuery('SELECT PARTIAL p.{id,address.asdfasdf} FROM ' . __NAMESPACE__ . '\\DDC93Person p') |
|
254 | + $this->em->createQuery('SELECT PARTIAL p.{id,address.asdfasdf} FROM '.__NAMESPACE__.'\\DDC93Person p') |
|
255 | 255 | ->execute(); |
256 | 256 | } |
257 | 257 | |
@@ -313,15 +313,15 @@ discard block |
||
313 | 313 | $this->expectException(MappingException::class); |
314 | 314 | $this->expectExceptionMessage( |
315 | 315 | sprintf( |
316 | - 'Infinite nesting detected for embedded property %s::nested. ' . |
|
316 | + 'Infinite nesting detected for embedded property %s::nested. '. |
|
317 | 317 | 'You cannot embed an embeddable from the same type inside an embeddable.', |
318 | - __NAMESPACE__ . '\\' . $declaredEmbeddableClassName |
|
318 | + __NAMESPACE__.'\\'.$declaredEmbeddableClassName |
|
319 | 319 | ) |
320 | 320 | ); |
321 | 321 | |
322 | 322 | $this->schemaTool->createSchema( |
323 | 323 | [ |
324 | - $this->em->getClassMetadata(__NAMESPACE__ . '\\' . $embeddableClassName), |
|
324 | + $this->em->getClassMetadata(__NAMESPACE__.'\\'.$embeddableClassName), |
|
325 | 325 | ] |
326 | 326 | ); |
327 | 327 | } |
@@ -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 | |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | while ($worker->work()) { |
30 | 30 | if ($worker->returnCode() != GEARMAN_SUCCESS) { |
31 | - echo 'return_code: ' . $worker->returnCode() . "\n"; |
|
31 | + echo 'return_code: '.$worker->returnCode()."\n"; |
|
32 | 32 | break; |
33 | 33 | } |
34 | 34 | } |
@@ -79,18 +79,18 @@ discard block |
||
79 | 79 | |
80 | 80 | protected function processWorkload($job) |
81 | 81 | { |
82 | - echo 'Received job: ' . $job->handle() . ' for function ' . $job->functionName() . "\n"; |
|
82 | + echo 'Received job: '.$job->handle().' for function '.$job->functionName()."\n"; |
|
83 | 83 | |
84 | 84 | $workload = $job->workload(); |
85 | 85 | $workload = unserialize($workload); |
86 | 86 | |
87 | - if (! isset($workload['conn']) || ! is_array($workload['conn'])) { |
|
87 | + if ( ! isset($workload['conn']) || ! is_array($workload['conn'])) { |
|
88 | 88 | throw new \InvalidArgumentException('Missing Database parameters'); |
89 | 89 | } |
90 | 90 | |
91 | 91 | $this->em = $this->createEntityManager($workload['conn']); |
92 | 92 | |
93 | - if (! isset($workload['fixture'])) { |
|
93 | + if ( ! isset($workload['fixture'])) { |
|
94 | 94 | throw new \InvalidArgumentException('Missing Fixture parameters'); |
95 | 95 | } |
96 | 96 | return $workload['fixture']; |
@@ -99,11 +99,11 @@ discard block |
||
99 | 99 | protected function createEntityManager($conn) |
100 | 100 | { |
101 | 101 | $config = new Configuration(); |
102 | - $config->setProxyDir(__DIR__ . '/../../../Proxies'); |
|
102 | + $config->setProxyDir(__DIR__.'/../../../Proxies'); |
|
103 | 103 | $config->setProxyNamespace('MyProject\Proxies'); |
104 | 104 | $config->setAutoGenerateProxyClasses(true); |
105 | 105 | |
106 | - $annotDriver = $config->newDefaultAnnotationDriver([__DIR__ . '/../../../Models/']); |
|
106 | + $annotDriver = $config->newDefaultAnnotationDriver([__DIR__.'/../../../Models/']); |
|
107 | 107 | $config->setMetadataDriverImpl($annotDriver); |
108 | 108 | |
109 | 109 | $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\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.'); |
@@ -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 |
@@ -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 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | */ |
58 | 58 | public function testDropPartSchemaWithForeignKeys() |
59 | 59 | { |
60 | - if (! $this->em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
60 | + if ( ! $this->em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
61 | 61 | $this->markTestSkipped('Foreign Key test'); |
62 | 62 | } |
63 | 63 |
@@ -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 | |
@@ -86,6 +86,6 @@ discard block |
||
86 | 86 | $sql = $schemaDiff->toSql($this->em->getConnection()->getDatabasePlatform()); |
87 | 87 | $sql = array_filter($sql, function($sql) { return strpos($sql, 'DROP') === false; }); |
88 | 88 | |
89 | - self::assertCount(0, $sql, 'SQL: ' . implode(PHP_EOL, $sql)); |
|
89 | + self::assertCount(0, $sql, 'SQL: '.implode(PHP_EOL, $sql)); |
|
90 | 90 | } |
91 | 91 | } |
@@ -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 |