@@ -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\Ticket; |
6 | 6 | |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $entity = new DDC1526Menu; |
30 | 30 | |
31 | 31 | if (isset($parents[($i % 3)])) { |
32 | - $entity->parent = $parents[($i%3)]; |
|
32 | + $entity->parent = $parents[($i % 3)]; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | $this->em->persist($entity); |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | $this->em->clear(); |
40 | 40 | |
41 | 41 | $dql = 'SELECT m, c |
42 | - FROM ' . __NAMESPACE__ . '\DDC1526Menu m |
|
42 | + FROM ' . __NAMESPACE__.'\DDC1526Menu m |
|
43 | 43 | LEFT JOIN m.children c'; |
44 | 44 | $menus = $this->em->createQuery($dql)->getResult(); |
45 | 45 |
@@ -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\Ticket; |
6 | 6 | |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | // Show difference between expected and actual queries on error |
27 | 27 | self::assertEquals( |
28 | - 'SELECT _a FROM ' . __NAMESPACE__ . '\DDC1757A _a, ' . __NAMESPACE__ . '\DDC1757B _b INNER JOIN _b.c _c INNER JOIN _c.d _d', |
|
28 | + 'SELECT _a FROM '.__NAMESPACE__.'\DDC1757A _a, '.__NAMESPACE__.'\DDC1757B _b INNER JOIN _b.c _c INNER JOIN _c.d _d', |
|
29 | 29 | $dql, |
30 | 30 | 'Wrong DQL query' |
31 | 31 | ); |
@@ -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 | |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public function testIssue2059() |
32 | 32 | { |
33 | - if (! $this->em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
33 | + if ( ! $this->em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
34 | 34 | $this->markTestSkipped('Platform does not support foreign keys.'); |
35 | 35 | } |
36 | 36 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | public function testLoadMetadataFromDatabase() |
54 | 54 | { |
55 | - if (! $this->em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
55 | + if ( ! $this->em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
56 | 56 | $this->markTestSkipped('Platform does not support foreign keys.'); |
57 | 57 | } |
58 | 58 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | |
91 | 91 | public function testLoadMetadataWithForeignKeyFromDatabase() |
92 | 92 | { |
93 | - if (! $this->em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
93 | + if ( ! $this->em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
94 | 94 | $this->markTestSkipped('Platform does not support foreign keys.'); |
95 | 95 | } |
96 | 96 | |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | |
124 | 124 | public function testDetectManyToManyTables() |
125 | 125 | { |
126 | - if (! $this->em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
126 | + if ( ! $this->em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
127 | 127 | $this->markTestSkipped('Platform does not support foreign keys.'); |
128 | 128 | } |
129 | 129 | |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | |
164 | 164 | public function testLoadMetadataFromDatabaseDetail() |
165 | 165 | { |
166 | - if (! $this->em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
166 | + if ( ! $this->em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
167 | 167 | $this->markTestSkipped('Platform does not support foreign keys.'); |
168 | 168 | } |
169 | 169 | |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | |
203 | 203 | // FIXME: Condition here is fugly. |
204 | 204 | // NOTE: PostgreSQL and SQL SERVER do not support UNSIGNED integer |
205 | - if (! $this->em->getConnection()->getDatabasePlatform() instanceof PostgreSqlPlatform && |
|
205 | + if ( ! $this->em->getConnection()->getDatabasePlatform() instanceof PostgreSqlPlatform && |
|
206 | 206 | ! $this->em->getConnection()->getDatabasePlatform() instanceof SQLServerPlatform) { |
207 | 207 | self::assertNotNull($metadata->getProperty('columnUnsigned')); |
208 | 208 | |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | |
245 | 245 | self::assertNotEmpty($indexes['index1']['columns']); |
246 | 246 | self::assertEquals( |
247 | - ['column_index1','column_index2'], |
|
247 | + ['column_index1', 'column_index2'], |
|
248 | 248 | $indexes['index1']['columns'] |
249 | 249 | ); |
250 | 250 |
@@ -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 | |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | |
39 | 39 | public function assertCollectionEquals(Collection $first, Collection $second) |
40 | 40 | { |
41 | - return $first->forAll(function ($k, $e) use ($second) { |
|
41 | + return $first->forAll(function($k, $e) use ($second) { |
|
42 | 42 | return $second->contains($e); |
43 | 43 | }); |
44 | 44 | } |
@@ -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 | |
@@ -136,13 +136,13 @@ discard block |
||
136 | 136 | |
137 | 137 | self::assertTrue( |
138 | 138 | $this->maxRunTime > $forTime, |
139 | - 'Because of locking this tests should have run at least ' . $forTime . ' seconds, ' . |
|
140 | - 'but only did for ' . $this->maxRunTime . ' seconds.' |
|
139 | + 'Because of locking this tests should have run at least '.$forTime.' seconds, '. |
|
140 | + 'but only did for '.$this->maxRunTime.' seconds.' |
|
141 | 141 | ); |
142 | 142 | self::assertTrue( |
143 | 143 | $this->maxRunTime < $notLongerThan, |
144 | - 'The longest task should not run longer than ' . $notLongerThan . ' seconds, ' . |
|
145 | - 'but did for ' . $this->maxRunTime . ' seconds.' |
|
144 | + 'The longest task should not run longer than '.$notLongerThan.' seconds, '. |
|
145 | + 'but did for '.$this->maxRunTime.' seconds.' |
|
146 | 146 | ); |
147 | 147 | } |
148 | 148 |
@@ -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 | } |
@@ -53,14 +53,14 @@ discard block |
||
53 | 53 | |
54 | 54 | public function findWithLock($job) |
55 | 55 | { |
56 | - return $this->process($job, function ($fixture, $em) { |
|
56 | + return $this->process($job, function($fixture, $em) { |
|
57 | 57 | $entity = $em->find($fixture['entityName'], $fixture['entityId'], $fixture['lockMode']); |
58 | 58 | }); |
59 | 59 | } |
60 | 60 | |
61 | 61 | public function dqlWithLock($job) |
62 | 62 | { |
63 | - return $this->process($job, function ($fixture, $em) { |
|
63 | + return $this->process($job, function($fixture, $em) { |
|
64 | 64 | /* @var $query Doctrine\ORM\Query */ |
65 | 65 | $query = $em->createQuery($fixture['dql']); |
66 | 66 | $query->setLockMode($fixture['lockMode']); |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | |
72 | 72 | public function lock($job) |
73 | 73 | { |
74 | - return $this->process($job, function ($fixture, $em) { |
|
74 | + return $this->process($job, function($fixture, $em) { |
|
75 | 75 | $entity = $em->find($fixture['entityName'], $fixture['entityId']); |
76 | 76 | $em->lock($entity, $fixture['lockMode']); |
77 | 77 | }); |
@@ -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(); |
@@ -136,24 +136,24 @@ |
||
136 | 136 | ->will($this->returnValue(10)); |
137 | 137 | |
138 | 138 | $parserResultMock = $this->getMockBuilder(ParserResult::class) |
139 | - ->setMethods(['getSqlExecutor']) |
|
140 | - ->getMock(); |
|
139 | + ->setMethods(['getSqlExecutor']) |
|
140 | + ->getMock(); |
|
141 | 141 | $parserResultMock->expects($this->once()) |
142 | - ->method('getSqlExecutor') |
|
143 | - ->will($this->returnValue($sqlExecMock)); |
|
142 | + ->method('getSqlExecutor') |
|
143 | + ->will($this->returnValue($sqlExecMock)); |
|
144 | 144 | |
145 | 145 | $cache = $this->getMockBuilder(CacheProvider::class) |
146 | - ->setMethods(['doFetch', 'doContains', 'doSave', 'doDelete', 'doFlush', 'doGetStats']) |
|
147 | - ->getMock(); |
|
146 | + ->setMethods(['doFetch', 'doContains', 'doSave', 'doDelete', 'doFlush', 'doGetStats']) |
|
147 | + ->getMock(); |
|
148 | 148 | |
149 | 149 | $cache->expects($this->at(0))->method('doFetch')->will($this->returnValue(1)); |
150 | 150 | $cache->expects($this->at(1)) |
151 | - ->method('doFetch') |
|
152 | - ->with($this->isType('string')) |
|
153 | - ->will($this->returnValue($parserResultMock)); |
|
151 | + ->method('doFetch') |
|
152 | + ->with($this->isType('string')) |
|
153 | + ->will($this->returnValue($parserResultMock)); |
|
154 | 154 | |
155 | 155 | $cache->expects($this->never()) |
156 | - ->method('doSave'); |
|
156 | + ->method('doSave'); |
|
157 | 157 | |
158 | 158 | $query->setQueryCacheDriver($cache); |
159 | 159 |
@@ -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 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | $iter = $paginator->getIterator(); |
132 | 132 | self::assertCount(9, $iter); |
133 | 133 | $result = iterator_to_array($iter); |
134 | - self::assertEquals($checkField . '0', $result[0]->{$checkField}); |
|
134 | + self::assertEquals($checkField.'0', $result[0]->{$checkField}); |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | private function iterateWithOrderAscWithLimit($useOutputWalkers, $fetchJoinCollection, $baseDql, $checkField) |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | $iter = $paginator->getIterator(); |
148 | 148 | self::assertCount(3, $iter); |
149 | 149 | $result = iterator_to_array($iter); |
150 | - self::assertEquals($checkField . '0', $result[0]->{$checkField}); |
|
150 | + self::assertEquals($checkField.'0', $result[0]->{$checkField}); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | private function iterateWithOrderAscWithLimitAndOffset($useOutputWalkers, $fetchJoinCollection, $baseDql, $checkField) |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $iter = $paginator->getIterator(); |
164 | 164 | self::assertCount(3, $iter); |
165 | 165 | $result = iterator_to_array($iter); |
166 | - self::assertEquals($checkField . '3', $result[0]->{$checkField}); |
|
166 | + self::assertEquals($checkField.'3', $result[0]->{$checkField}); |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | private function iterateWithOrderDesc($useOutputWalkers, $fetchJoinCollection, $baseDql, $checkField) |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | $iter = $paginator->getIterator(); |
177 | 177 | self::assertCount(9, $iter); |
178 | 178 | $result = iterator_to_array($iter); |
179 | - self::assertEquals($checkField . '8', $result[0]->{$checkField}); |
|
179 | + self::assertEquals($checkField.'8', $result[0]->{$checkField}); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | private function iterateWithOrderDescWithLimit($useOutputWalkers, $fetchJoinCollection, $baseDql, $checkField) |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | $iter = $paginator->getIterator(); |
192 | 192 | self::assertCount(3, $iter); |
193 | 193 | $result = iterator_to_array($iter); |
194 | - self::assertEquals($checkField . '8', $result[0]->{$checkField}); |
|
194 | + self::assertEquals($checkField.'8', $result[0]->{$checkField}); |
|
195 | 195 | } |
196 | 196 | |
197 | 197 | private function iterateWithOrderDescWithLimitAndOffset($useOutputWalkers, $fetchJoinCollection, $baseDql, $checkField) |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | $iter = $paginator->getIterator(); |
207 | 207 | self::assertCount(3, $iter); |
208 | 208 | $result = iterator_to_array($iter); |
209 | - self::assertEquals($checkField . '5', $result[0]->{$checkField}); |
|
209 | + self::assertEquals($checkField.'5', $result[0]->{$checkField}); |
|
210 | 210 | } |
211 | 211 | |
212 | 212 | /** |
@@ -479,8 +479,8 @@ discard block |
||
479 | 479 | public function testIterateWithFetchJoinOneToManyWithOrderByColumnFromBoth($useOutputWalkers) |
480 | 480 | { |
481 | 481 | $dql = 'SELECT c, d FROM Doctrine\Tests\Models\Pagination\Company c JOIN c.departments d ORDER BY c.name'; |
482 | - $dqlAsc = $dql . ' ASC, d.name'; |
|
483 | - $dqlDesc = $dql . ' DESC, d.name'; |
|
482 | + $dqlAsc = $dql.' ASC, d.name'; |
|
483 | + $dqlDesc = $dql.' DESC, d.name'; |
|
484 | 484 | $this->iterateWithOrderAsc($useOutputWalkers, true, $dqlAsc, 'name'); |
485 | 485 | $this->iterateWithOrderDesc($useOutputWalkers, true, $dqlDesc, 'name'); |
486 | 486 | } |
@@ -488,8 +488,8 @@ discard block |
||
488 | 488 | public function testIterateWithFetchJoinOneToManyWithOrderByColumnFromBothWithLimitWithOutputWalker() |
489 | 489 | { |
490 | 490 | $dql = 'SELECT c, d FROM Doctrine\Tests\Models\Pagination\Company c JOIN c.departments d ORDER BY c.name'; |
491 | - $dqlAsc = $dql . ' ASC, d.name'; |
|
492 | - $dqlDesc = $dql . ' DESC, d.name'; |
|
491 | + $dqlAsc = $dql.' ASC, d.name'; |
|
492 | + $dqlDesc = $dql.' DESC, d.name'; |
|
493 | 493 | $this->iterateWithOrderAscWithLimit(true, true, $dqlAsc, 'name'); |
494 | 494 | $this->iterateWithOrderDescWithLimit(true, true, $dqlDesc, 'name'); |
495 | 495 | } |
@@ -500,8 +500,8 @@ discard block |
||
500 | 500 | $this->expectExceptionMessage('Cannot select distinct identifiers from query with LIMIT and ORDER BY on a column from a fetch joined to-many association. Use output walkers.'); |
501 | 501 | |
502 | 502 | $dql = 'SELECT c, d FROM Doctrine\Tests\Models\Pagination\Company c JOIN c.departments d ORDER BY c.name'; |
503 | - $dqlAsc = $dql . ' ASC, d.name'; |
|
504 | - $dqlDesc = $dql . ' DESC, d.name'; |
|
503 | + $dqlAsc = $dql.' ASC, d.name'; |
|
504 | + $dqlDesc = $dql.' DESC, d.name'; |
|
505 | 505 | $this->iterateWithOrderAscWithLimit(false, true, $dqlAsc, 'name'); |
506 | 506 | $this->iterateWithOrderDescWithLimit(false, true, $dqlDesc, 'name'); |
507 | 507 | } |
@@ -585,7 +585,7 @@ discard block |
||
585 | 585 | $users = iterator_to_array($paginator->getIterator()); |
586 | 586 | self::assertCount(9, $users); |
587 | 587 | foreach ($users as $i => $user) { |
588 | - self::assertEquals('username' . (8 - $i), $user->username); |
|
588 | + self::assertEquals('username'.(8 - $i), $user->username); |
|
589 | 589 | } |
590 | 590 | } |
591 | 591 | |
@@ -735,7 +735,7 @@ discard block |
||
735 | 735 | $company->logo->image_width = 100 + $i; |
736 | 736 | $company->logo->image_height = 100 + $i; |
737 | 737 | $company->logo->company = $company; |
738 | - for ($j=0; $j<3; $j++) { |
|
738 | + for ($j = 0; $j < 3; $j++) { |
|
739 | 739 | $department = new Department(); |
740 | 740 | $department->name = "name$i$j"; |
741 | 741 | $department->company = $company; |