@@ -104,8 +104,8 @@ |
||
104 | 104 | $routeId = $this->createPersistedRouteWithLegs(); |
105 | 105 | |
106 | 106 | $route = $this->em->createQuery("SELECT r, l FROM Doctrine\Tests\Models\Routing\RoutingRoute r JOIN r.legs l WHERE r.id = ?1") |
107 | - ->setParameter(1, $routeId) |
|
108 | - ->getSingleResult(); |
|
107 | + ->setParameter(1, $routeId) |
|
108 | + ->getSingleResult(); |
|
109 | 109 | |
110 | 110 | self::assertEquals(2, count($route->legs)); |
111 | 111 | self::assertEquals("Berlin", $route->legs[0]->fromLocation->getName()); |
@@ -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 |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * @ORM\DiscriminatorMap({"parent" = "CTIParent", "child" = "CTIChild"}) |
87 | 87 | */ |
88 | 88 | class CTIParent { |
89 | - /** |
|
89 | + /** |
|
90 | 90 | * @ORM\Id @ORM\Column(type="integer") |
91 | 91 | * @ORM\GeneratedValue(strategy="AUTO") |
92 | 92 | */ |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | * @ORM\Entity @ORM\Table(name="cti_children") |
114 | 114 | */ |
115 | 115 | class CTIChild extends CTIParent { |
116 | - /** |
|
116 | + /** |
|
117 | 117 | * @ORM\Column(type="string") |
118 | 118 | */ |
119 | 119 | private $data; |
@@ -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\Collections\ArrayCollection; |
@@ -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 | |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | self::assertNull($this->cache->getEntityCacheRegion(ComplexAction::class)); |
217 | 217 | self::assertInstanceOf(Region::class, $this->cache->getEntityCacheRegion(Token::class)); |
218 | 218 | |
219 | - $token = new Token('token-hash'); |
|
219 | + $token = new Token('token-hash'); |
|
220 | 220 | |
221 | 221 | $action1 = new Action('login'); |
222 | 222 | $action2 = new Action('logout'); |
@@ -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 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public $address; |
115 | 115 | |
116 | - public function getId() {return $this->id;} |
|
116 | + public function getId() {return $this->id; } |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | /** |
@@ -155,5 +155,5 @@ discard block |
||
155 | 155 | */ |
156 | 156 | public $user; |
157 | 157 | |
158 | - public function getUser() {return $this->user;} |
|
158 | + public function getUser() {return $this->user; } |
|
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 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | self::assertEquals('FOO', $this->em->getConnection()->fetchColumn("select named_lower_case_string from customtype_uppercases where id=".$entity->id.""), 'Database holds uppercase string'); |
73 | 73 | |
74 | 74 | |
75 | - $entity->namedLowerCaseString = 'bar'; |
|
75 | + $entity->namedLowerCaseString = 'bar'; |
|
76 | 76 | |
77 | 77 | $this->em->persist($entity); |
78 | 78 | $this->em->flush(); |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | |
131 | 131 | $this->em->clear(); |
132 | 132 | |
133 | - $query = $this->em->createQuery("SELECT p, p.customInteger, c from Doctrine\Tests\Models\CustomType\CustomTypeParent p JOIN p.child c where p.id = " . $parentId); |
|
133 | + $query = $this->em->createQuery("SELECT p, p.customInteger, c from Doctrine\Tests\Models\CustomType\CustomTypeParent p JOIN p.child c where p.id = ".$parentId); |
|
134 | 134 | |
135 | 135 | $result = $query->getResult(); |
136 | 136 |
@@ -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 | |
@@ -37,12 +37,12 @@ discard block |
||
37 | 37 | $fix = new CompanyFixContract(); |
38 | 38 | $fix->setFixPrice(2000); |
39 | 39 | |
40 | - $this->listener->preFlushCalls = []; |
|
40 | + $this->listener->preFlushCalls = []; |
|
41 | 41 | |
42 | 42 | $this->em->persist($fix); |
43 | 43 | $this->em->flush(); |
44 | 44 | |
45 | - self::assertCount(1,$this->listener->preFlushCalls); |
|
45 | + self::assertCount(1, $this->listener->preFlushCalls); |
|
46 | 46 | self::assertSame($fix, $this->listener->preFlushCalls[0][0]); |
47 | 47 | self::assertInstanceOf(CompanyFixContract::class, $this->listener->preFlushCalls[0][0]); |
48 | 48 | self::assertInstanceOf(PreFlushEventArgs::class, $this->listener->preFlushCalls[0][1]); |
@@ -57,12 +57,12 @@ discard block |
||
57 | 57 | $this->em->flush(); |
58 | 58 | $this->em->clear(); |
59 | 59 | |
60 | - $this->listener->postLoadCalls = []; |
|
60 | + $this->listener->postLoadCalls = []; |
|
61 | 61 | |
62 | 62 | $dql = "SELECT f FROM Doctrine\Tests\Models\Company\CompanyFixContract f WHERE f.id = ?1"; |
63 | 63 | $fix = $this->em->createQuery($dql)->setParameter(1, $fix->getId())->getSingleResult(); |
64 | 64 | |
65 | - self::assertCount(1,$this->listener->postLoadCalls); |
|
65 | + self::assertCount(1, $this->listener->postLoadCalls); |
|
66 | 66 | self::assertSame($fix, $this->listener->postLoadCalls[0][0]); |
67 | 67 | self::assertInstanceOf(CompanyFixContract::class, $this->listener->postLoadCalls[0][0]); |
68 | 68 | self::assertInstanceOf(LifecycleEventArgs::class, $this->listener->postLoadCalls[0][1]); |
@@ -73,12 +73,12 @@ discard block |
||
73 | 73 | $fix = new CompanyFixContract(); |
74 | 74 | $fix->setFixPrice(2000); |
75 | 75 | |
76 | - $this->listener->prePersistCalls = []; |
|
76 | + $this->listener->prePersistCalls = []; |
|
77 | 77 | |
78 | 78 | $this->em->persist($fix); |
79 | 79 | $this->em->flush(); |
80 | 80 | |
81 | - self::assertCount(1,$this->listener->prePersistCalls); |
|
81 | + self::assertCount(1, $this->listener->prePersistCalls); |
|
82 | 82 | self::assertSame($fix, $this->listener->prePersistCalls[0][0]); |
83 | 83 | self::assertInstanceOf(CompanyFixContract::class, $this->listener->prePersistCalls[0][0]); |
84 | 84 | self::assertInstanceOf(LifecycleEventArgs::class, $this->listener->prePersistCalls[0][1]); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | $this->em->persist($fix); |
95 | 95 | $this->em->flush(); |
96 | 96 | |
97 | - self::assertCount(1,$this->listener->postPersistCalls); |
|
97 | + self::assertCount(1, $this->listener->postPersistCalls); |
|
98 | 98 | self::assertSame($fix, $this->listener->postPersistCalls[0][0]); |
99 | 99 | self::assertInstanceOf(CompanyFixContract::class, $this->listener->postPersistCalls[0][0]); |
100 | 100 | self::assertInstanceOf(LifecycleEventArgs::class, $this->listener->postPersistCalls[0][1]); |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $this->em->persist($fix); |
116 | 116 | $this->em->flush(); |
117 | 117 | |
118 | - self::assertCount(1,$this->listener->preUpdateCalls); |
|
118 | + self::assertCount(1, $this->listener->preUpdateCalls); |
|
119 | 119 | self::assertSame($fix, $this->listener->preUpdateCalls[0][0]); |
120 | 120 | self::assertInstanceOf(CompanyFixContract::class, $this->listener->preUpdateCalls[0][0]); |
121 | 121 | self::assertInstanceOf(PreUpdateEventArgs::class, $this->listener->preUpdateCalls[0][1]); |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | $this->em->persist($fix); |
137 | 137 | $this->em->flush(); |
138 | 138 | |
139 | - self::assertCount(1,$this->listener->postUpdateCalls); |
|
139 | + self::assertCount(1, $this->listener->postUpdateCalls); |
|
140 | 140 | self::assertSame($fix, $this->listener->postUpdateCalls[0][0]); |
141 | 141 | self::assertInstanceOf(CompanyFixContract::class, $this->listener->postUpdateCalls[0][0]); |
142 | 142 | self::assertInstanceOf(LifecycleEventArgs::class, $this->listener->postUpdateCalls[0][1]); |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $this->em->remove($fix); |
156 | 156 | $this->em->flush(); |
157 | 157 | |
158 | - self::assertCount(1,$this->listener->preRemoveCalls); |
|
158 | + self::assertCount(1, $this->listener->preRemoveCalls); |
|
159 | 159 | self::assertSame($fix, $this->listener->preRemoveCalls[0][0]); |
160 | 160 | self::assertInstanceOf(CompanyFixContract::class, $this->listener->preRemoveCalls[0][0]); |
161 | 161 | self::assertInstanceOf(LifecycleEventArgs::class, $this->listener->preRemoveCalls[0][1]); |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | $this->em->remove($fix); |
175 | 175 | $this->em->flush(); |
176 | 176 | |
177 | - self::assertCount(1,$this->listener->postRemoveCalls); |
|
177 | + self::assertCount(1, $this->listener->postRemoveCalls); |
|
178 | 178 | self::assertSame($fix, $this->listener->postRemoveCalls[0][0]); |
179 | 179 | self::assertInstanceOf(CompanyFixContract::class, $this->listener->postRemoveCalls[0][0]); |
180 | 180 | self::assertInstanceOf(LifecycleEventArgs::class, $this->listener->postRemoveCalls[0][1]); |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | $this->expectExceptionMessage('Too few parameters: the query defines 1 parameters but you only bound 0'); |
153 | 153 | |
154 | 154 | $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1') |
155 | - ->getSingleResult(); |
|
155 | + ->getSingleResult(); |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | public function testInvalidInputParameterThrowsException() |
@@ -160,8 +160,8 @@ discard block |
||
160 | 160 | $this->expectException(QueryException::class); |
161 | 161 | |
162 | 162 | $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?') |
163 | - ->setParameter(1, 'jwage') |
|
164 | - ->getSingleResult(); |
|
163 | + ->setParameter(1, 'jwage') |
|
164 | + ->getSingleResult(); |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | public function testSetParameters() |
@@ -171,8 +171,8 @@ discard block |
||
171 | 171 | $parameters->add(new Parameter(2, 'active')); |
172 | 172 | |
173 | 173 | $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1 AND u.status = ?2') |
174 | - ->setParameters($parameters) |
|
175 | - ->getResult(); |
|
174 | + ->setParameters($parameters) |
|
175 | + ->getResult(); |
|
176 | 176 | |
177 | 177 | $extractValue = function (Parameter $parameter) { |
178 | 178 | return $parameter->getValue(); |
@@ -189,8 +189,8 @@ discard block |
||
189 | 189 | $parameters = [1 => 'jwage', 2 => 'active']; |
190 | 190 | |
191 | 191 | $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1 AND u.status = ?2') |
192 | - ->setParameters($parameters) |
|
193 | - ->getResult(); |
|
192 | + ->setParameters($parameters) |
|
193 | + ->getResult(); |
|
194 | 194 | |
195 | 195 | self::assertSame( |
196 | 196 | array_values($parameters), |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | public function testGetSingleResultThrowsExceptionOnNoResult() |
335 | 335 | { |
336 | 336 | $this->em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a") |
337 | - ->getSingleResult(); |
|
337 | + ->getSingleResult(); |
|
338 | 338 | } |
339 | 339 | |
340 | 340 | /** |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | public function testGetSingleScalarResultThrowsExceptionOnNoResult() |
344 | 344 | { |
345 | 345 | $this->em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a") |
346 | - ->getSingleScalarResult(); |
|
346 | + ->getSingleScalarResult(); |
|
347 | 347 | } |
348 | 348 | |
349 | 349 | /** |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | $this->em->clear(); |
375 | 375 | |
376 | 376 | $this->em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a") |
377 | - ->getSingleScalarResult(); |
|
377 | + ->getSingleScalarResult(); |
|
378 | 378 | } |
379 | 379 | |
380 | 380 | public function testModifiedLimitQuery() |
@@ -391,27 +391,27 @@ discard block |
||
391 | 391 | $this->em->clear(); |
392 | 392 | |
393 | 393 | $data = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u') |
394 | - ->setFirstResult(1) |
|
395 | - ->setMaxResults(2) |
|
396 | - ->getResult(); |
|
394 | + ->setFirstResult(1) |
|
395 | + ->setMaxResults(2) |
|
396 | + ->getResult(); |
|
397 | 397 | |
398 | 398 | self::assertEquals(2, count($data)); |
399 | 399 | self::assertEquals('gblanco1', $data[0]->username); |
400 | 400 | self::assertEquals('gblanco2', $data[1]->username); |
401 | 401 | |
402 | 402 | $data = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u') |
403 | - ->setFirstResult(3) |
|
404 | - ->setMaxResults(2) |
|
405 | - ->getResult(); |
|
403 | + ->setFirstResult(3) |
|
404 | + ->setMaxResults(2) |
|
405 | + ->getResult(); |
|
406 | 406 | |
407 | 407 | self::assertEquals(2, count($data)); |
408 | 408 | self::assertEquals('gblanco3', $data[0]->username); |
409 | 409 | self::assertEquals('gblanco4', $data[1]->username); |
410 | 410 | |
411 | 411 | $data = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u') |
412 | - ->setFirstResult(3) |
|
413 | - ->setMaxResults(2) |
|
414 | - ->getScalarResult(); |
|
412 | + ->setFirstResult(3) |
|
413 | + ->setMaxResults(2) |
|
414 | + ->getScalarResult(); |
|
415 | 415 | } |
416 | 416 | |
417 | 417 | public function testSupportsQueriesWithEntityNamespaces() |
@@ -633,9 +633,9 @@ discard block |
||
633 | 633 | { |
634 | 634 | $qb = $this->em->createQueryBuilder(); |
635 | 635 | $qb->select('u') |
636 | - ->from(CmsUser::class, 'u') |
|
637 | - ->innerJoin('u.articles', 'a') |
|
638 | - ->where('(u.id = 0) OR (u.id IS NULL)'); |
|
636 | + ->from(CmsUser::class, 'u') |
|
637 | + ->innerJoin('u.articles', 'a') |
|
638 | + ->where('(u.id = 0) OR (u.id IS NULL)'); |
|
639 | 639 | |
640 | 640 | $query = $qb->getQuery(); |
641 | 641 | $users = $query->execute(); |
@@ -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 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $this->em->flush(); |
98 | 98 | $this->em->clear(); |
99 | 99 | |
100 | - $query = $this->em->createQuery('select u, a from ' . CmsUser::class . ' u join u.articles a ORDER BY a.topic'); |
|
100 | + $query = $this->em->createQuery('select u, a from '.CmsUser::class.' u join u.articles a ORDER BY a.topic'); |
|
101 | 101 | $users = $query->getResult(); |
102 | 102 | |
103 | 103 | self::assertEquals(1, count($users)); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $this->em->flush(); |
118 | 118 | $this->em->clear(); |
119 | 119 | |
120 | - $q = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.username = ?0'); |
|
120 | + $q = $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u WHERE u.username = ?0'); |
|
121 | 121 | $q->setParameter(0, 'jwage'); |
122 | 122 | $user = $q->getSingleResult(); |
123 | 123 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | $this->expectException(QueryException::class); |
130 | 130 | $this->expectExceptionMessage('Invalid parameter: token 2 is not defined in the query.'); |
131 | 131 | |
132 | - $q = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1'); |
|
132 | + $q = $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u WHERE u.name = ?1'); |
|
133 | 133 | $q->setParameter(2, 'jwage'); |
134 | 134 | $user = $q->getSingleResult(); |
135 | 135 | } |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | $this->expectException(QueryException::class); |
140 | 140 | $this->expectExceptionMessage('Too many parameters: the query defines 1 parameters and you bound 2'); |
141 | 141 | |
142 | - $q = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1'); |
|
142 | + $q = $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u WHERE u.name = ?1'); |
|
143 | 143 | $q->setParameter(1, 'jwage'); |
144 | 144 | $q->setParameter(2, 'jwage'); |
145 | 145 | |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $this->expectException(QueryException::class); |
152 | 152 | $this->expectExceptionMessage('Too few parameters: the query defines 1 parameters but you only bound 0'); |
153 | 153 | |
154 | - $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1') |
|
154 | + $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u WHERE u.name = ?1') |
|
155 | 155 | ->getSingleResult(); |
156 | 156 | } |
157 | 157 | |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | { |
160 | 160 | $this->expectException(QueryException::class); |
161 | 161 | |
162 | - $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?') |
|
162 | + $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u WHERE u.name = ?') |
|
163 | 163 | ->setParameter(1, 'jwage') |
164 | 164 | ->getSingleResult(); |
165 | 165 | } |
@@ -170,11 +170,11 @@ discard block |
||
170 | 170 | $parameters->add(new Parameter(1, 'jwage')); |
171 | 171 | $parameters->add(new Parameter(2, 'active')); |
172 | 172 | |
173 | - $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1 AND u.status = ?2') |
|
173 | + $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u WHERE u.name = ?1 AND u.status = ?2') |
|
174 | 174 | ->setParameters($parameters) |
175 | 175 | ->getResult(); |
176 | 176 | |
177 | - $extractValue = function (Parameter $parameter) { |
|
177 | + $extractValue = function(Parameter $parameter) { |
|
178 | 178 | return $parameter->getValue(); |
179 | 179 | }; |
180 | 180 | |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | { |
189 | 189 | $parameters = [1 => 'jwage', 2 => 'active']; |
190 | 190 | |
191 | - $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1 AND u.status = ?2') |
|
191 | + $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u WHERE u.name = ?1 AND u.status = ?2') |
|
192 | 192 | ->setParameters($parameters) |
193 | 193 | ->getResult(); |
194 | 194 | |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | $this->em->clear(); |
219 | 219 | $articleId = $article1->id; |
220 | 220 | |
221 | - $query = $this->em->createQuery('select a from ' . CmsArticle::class . ' a WHERE a.topic = ?1'); |
|
221 | + $query = $this->em->createQuery('select a from '.CmsArticle::class.' a WHERE a.topic = ?1'); |
|
222 | 222 | $articles = $query->iterate(new ArrayCollection([new Parameter(1, 'Doctrine 2')]), Query::HYDRATE_ARRAY); |
223 | 223 | |
224 | 224 | $found = []; |
@@ -259,19 +259,19 @@ discard block |
||
259 | 259 | $this->em->flush(); |
260 | 260 | $this->em->clear(); |
261 | 261 | |
262 | - $query = $this->em->createQuery('select a from ' . CmsArticle::class . ' a'); |
|
262 | + $query = $this->em->createQuery('select a from '.CmsArticle::class.' a'); |
|
263 | 263 | $articles = $query->iterate(); |
264 | 264 | |
265 | 265 | $iteratedCount = 0; |
266 | 266 | $topics = []; |
267 | 267 | |
268 | - foreach($articles AS $row) { |
|
268 | + foreach ($articles AS $row) { |
|
269 | 269 | $article = $row[0]; |
270 | 270 | $topics[] = $article->topic; |
271 | 271 | |
272 | 272 | $identityMap = $this->em->getUnitOfWork()->getIdentityMap(); |
273 | 273 | $identityMapCount = count($identityMap[CmsArticle::class]); |
274 | - self::assertTrue($identityMapCount>$iteratedCount); |
|
274 | + self::assertTrue($identityMapCount > $iteratedCount); |
|
275 | 275 | |
276 | 276 | $iteratedCount++; |
277 | 277 | } |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | |
305 | 305 | $iteratedCount = 0; |
306 | 306 | $topics = []; |
307 | - foreach($articles AS $row) { |
|
307 | + foreach ($articles AS $row) { |
|
308 | 308 | $article = $row[0]; |
309 | 309 | $topics[] = $article->topic; |
310 | 310 | |
@@ -381,8 +381,8 @@ discard block |
||
381 | 381 | { |
382 | 382 | for ($i = 0; $i < 5; $i++) { |
383 | 383 | $user = new CmsUser; |
384 | - $user->name = 'Guilherme' . $i; |
|
385 | - $user->username = 'gblanco' . $i; |
|
384 | + $user->name = 'Guilherme'.$i; |
|
385 | + $user->username = 'gblanco'.$i; |
|
386 | 386 | $user->status = 'developer'; |
387 | 387 | $this->em->persist($user); |
388 | 388 | } |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | $this->em->flush(); |
391 | 391 | $this->em->clear(); |
392 | 392 | |
393 | - $data = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u') |
|
393 | + $data = $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u') |
|
394 | 394 | ->setFirstResult(1) |
395 | 395 | ->setMaxResults(2) |
396 | 396 | ->getResult(); |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | self::assertEquals('gblanco1', $data[0]->username); |
400 | 400 | self::assertEquals('gblanco2', $data[1]->username); |
401 | 401 | |
402 | - $data = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u') |
|
402 | + $data = $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u') |
|
403 | 403 | ->setFirstResult(3) |
404 | 404 | ->setMaxResults(2) |
405 | 405 | ->getResult(); |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | self::assertEquals('gblanco3', $data[0]->username); |
409 | 409 | self::assertEquals('gblanco4', $data[1]->username); |
410 | 410 | |
411 | - $data = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u') |
|
411 | + $data = $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u') |
|
412 | 412 | ->setFirstResult(3) |
413 | 413 | ->setMaxResults(2) |
414 | 414 | ->getScalarResult(); |
@@ -511,13 +511,13 @@ discard block |
||
511 | 511 | $this->em->flush(); |
512 | 512 | $this->em->clear(); |
513 | 513 | |
514 | - $query = $this->em->createQuery("select u from " . CmsUser::class . " u where u.username = 'gblanco'"); |
|
514 | + $query = $this->em->createQuery("select u from ".CmsUser::class." u where u.username = 'gblanco'"); |
|
515 | 515 | $fetchedUser = $query->getOneOrNullResult(); |
516 | 516 | |
517 | 517 | self::assertInstanceOf(CmsUser::class, $fetchedUser); |
518 | 518 | self::assertEquals('gblanco', $fetchedUser->username); |
519 | 519 | |
520 | - $query = $this->em->createQuery("select u.username from " . CmsUser::class . " u where u.username = 'gblanco'"); |
|
520 | + $query = $this->em->createQuery("select u.username from ".CmsUser::class." u where u.username = 'gblanco'"); |
|
521 | 521 | $fetchedUsername = $query->getOneOrNullResult(Query::HYDRATE_SINGLE_SCALAR); |
522 | 522 | |
523 | 523 | self::assertEquals('gblanco', $fetchedUsername); |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | |
104 | 104 | public function testMultiLevelUpdateAndFind() |
105 | 105 | { |
106 | - $manager = new CompanyManager; |
|
106 | + $manager = new CompanyManager; |
|
107 | 107 | $manager->setName('Roman S. Borschel'); |
108 | 108 | $manager->setSalary(100000); |
109 | 109 | $manager->setDepartment('IT'); |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | |
152 | 152 | public function testSelfReferencingOneToOne() |
153 | 153 | { |
154 | - $manager = new CompanyManager; |
|
154 | + $manager = new CompanyManager; |
|
155 | 155 | $manager->setName('John Smith'); |
156 | 156 | $manager->setSalary(100000); |
157 | 157 | $manager->setDepartment('IT'); |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | public function testBulkUpdateIssueDDC368() |
301 | 301 | { |
302 | 302 | $this->em->createQuery('UPDATE ' . CompanyEmployee::class . ' AS p SET p.salary = 1') |
303 | - ->execute(); |
|
303 | + ->execute(); |
|
304 | 304 | |
305 | 305 | $result = $this->em->createQuery('SELECT count(p.id) FROM ' . CompanyEmployee::class . ' p WHERE p.salary = 1') |
306 | 306 | ->getResult(); |
@@ -314,9 +314,9 @@ discard block |
||
314 | 314 | public function testBulkUpdateNonScalarParameterDDC1341() |
315 | 315 | { |
316 | 316 | $this->em->createQuery('UPDATE ' . CompanyEmployee::class . ' AS p SET p.startDate = ?0 WHERE p.department = ?1') |
317 | - ->setParameter(0, new \DateTime()) |
|
318 | - ->setParameter(1, 'IT') |
|
319 | - ->execute(); |
|
317 | + ->setParameter(0, new \DateTime()) |
|
318 | + ->setParameter(1, 'IT') |
|
319 | + ->execute(); |
|
320 | 320 | |
321 | 321 | self::addToAssertionCount(1); |
322 | 322 | } |
@@ -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 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | $this->em->clear(); |
51 | 51 | |
52 | - $query = $this->em->createQuery('select p from ' . CompanyPerson::class . ' p order by p.name desc'); |
|
52 | + $query = $this->em->createQuery('select p from '.CompanyPerson::class.' p order by p.name desc'); |
|
53 | 53 | |
54 | 54 | $entities = $query->getResult(); |
55 | 55 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | $this->em->clear(); |
66 | 66 | |
67 | - $query = $this->em->createQuery('select p from ' . CompanyEmployee::class . ' p'); |
|
67 | + $query = $this->em->createQuery('select p from '.CompanyEmployee::class.' p'); |
|
68 | 68 | |
69 | 69 | $entities = $query->getResult(); |
70 | 70 | |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | |
84 | 84 | $this->em->clear(); |
85 | 85 | |
86 | - $query = $this->em->createQuery("update " . CompanyEmployee::class . " p set p.name = ?1, p.department = ?2 where p.name='Guilherme Blanco' and p.salary = ?3"); |
|
86 | + $query = $this->em->createQuery("update ".CompanyEmployee::class." p set p.name = ?1, p.department = ?2 where p.name='Guilherme Blanco' and p.salary = ?3"); |
|
87 | 87 | |
88 | 88 | $query->setParameter(1, 'NewName', 'string'); |
89 | 89 | $query->setParameter(2, 'NewDepartment'); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | |
95 | 95 | self::assertEquals(1, $numUpdated); |
96 | 96 | |
97 | - $query = $this->em->createQuery('delete from ' . CompanyPerson::class . ' p'); |
|
97 | + $query = $this->em->createQuery('delete from '.CompanyPerson::class.' p'); |
|
98 | 98 | |
99 | 99 | $numDeleted = $query->execute(); |
100 | 100 | |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | $this->em->flush(); |
170 | 170 | $this->em->clear(); |
171 | 171 | |
172 | - $query = $this->em->createQuery('select p, s from ' . CompanyPerson::class . ' p join p.spouse s where p.name=\'Mary Smith\''); |
|
172 | + $query = $this->em->createQuery('select p, s from '.CompanyPerson::class.' p join p.spouse s where p.name=\'Mary Smith\''); |
|
173 | 173 | |
174 | 174 | $result = $query->getResult(); |
175 | 175 | |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | |
202 | 202 | $this->em->clear(); |
203 | 203 | |
204 | - $query = $this->em->createQuery('select p, f from ' . CompanyPerson::class . ' p join p.friends f where p.name=?1'); |
|
204 | + $query = $this->em->createQuery('select p, f from '.CompanyPerson::class.' p join p.friends f where p.name=?1'); |
|
205 | 205 | |
206 | 206 | $query->setParameter(1, 'Roman'); |
207 | 207 | |
@@ -267,18 +267,18 @@ discard block |
||
267 | 267 | $this->em->flush(); |
268 | 268 | $this->em->clear(); |
269 | 269 | |
270 | - $q = $this->em->createQuery('select a from ' . CompanyEvent::class . ' a where a.id = ?1'); |
|
270 | + $q = $this->em->createQuery('select a from '.CompanyEvent::class.' a where a.id = ?1'); |
|
271 | 271 | |
272 | 272 | $q->setParameter(1, $event1->getId()); |
273 | 273 | |
274 | 274 | $result = $q->getResult(); |
275 | 275 | |
276 | 276 | self::assertCount(1, $result); |
277 | - self::assertInstanceOf(CompanyAuction::class, $result[0], sprintf("Is of class %s",get_class($result[0]))); |
|
277 | + self::assertInstanceOf(CompanyAuction::class, $result[0], sprintf("Is of class %s", get_class($result[0]))); |
|
278 | 278 | |
279 | 279 | $this->em->clear(); |
280 | 280 | |
281 | - $q = $this->em->createQuery('select a from ' . CompanyOrganization::class . ' a where a.id = ?1'); |
|
281 | + $q = $this->em->createQuery('select a from '.CompanyOrganization::class.' a where a.id = ?1'); |
|
282 | 282 | |
283 | 283 | $q->setParameter(1, $org->getId()); |
284 | 284 | |
@@ -299,10 +299,10 @@ discard block |
||
299 | 299 | */ |
300 | 300 | public function testBulkUpdateIssueDDC368() |
301 | 301 | { |
302 | - $this->em->createQuery('UPDATE ' . CompanyEmployee::class . ' AS p SET p.salary = 1') |
|
302 | + $this->em->createQuery('UPDATE '.CompanyEmployee::class.' AS p SET p.salary = 1') |
|
303 | 303 | ->execute(); |
304 | 304 | |
305 | - $result = $this->em->createQuery('SELECT count(p.id) FROM ' . CompanyEmployee::class . ' p WHERE p.salary = 1') |
|
305 | + $result = $this->em->createQuery('SELECT count(p.id) FROM '.CompanyEmployee::class.' p WHERE p.salary = 1') |
|
306 | 306 | ->getResult(); |
307 | 307 | |
308 | 308 | self::assertGreaterThan(0, count($result)); |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | */ |
314 | 314 | public function testBulkUpdateNonScalarParameterDDC1341() |
315 | 315 | { |
316 | - $this->em->createQuery('UPDATE ' . CompanyEmployee::class . ' AS p SET p.startDate = ?0 WHERE p.department = ?1') |
|
316 | + $this->em->createQuery('UPDATE '.CompanyEmployee::class.' AS p SET p.startDate = ?0 WHERE p.department = ?1') |
|
317 | 317 | ->setParameter(0, new \DateTime()) |
318 | 318 | ->setParameter(1, 'IT') |
319 | 319 | ->execute(); |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | $this->em->flush(); |
372 | 372 | $this->em->clear(); |
373 | 373 | |
374 | - $dqlManager = $this->em->createQuery('SELECT m FROM ' . CompanyManager::class . ' m WHERE m.spouse = ?1') |
|
374 | + $dqlManager = $this->em->createQuery('SELECT m FROM '.CompanyManager::class.' m WHERE m.spouse = ?1') |
|
375 | 375 | ->setParameter(1, $person->getId()) |
376 | 376 | ->getSingleResult(); |
377 | 377 |
@@ -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 | |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | { |
19 | 19 | parent::setUp(); |
20 | 20 | |
21 | - if (! $this->em->getConnection()->getDatabasePlatform()->supportsSequences()) { |
|
21 | + if ( ! $this->em->getConnection()->getDatabasePlatform()->supportsSequences()) { |
|
22 | 22 | $this->markTestSkipped('Only working for Databases that support sequences.'); |
23 | 23 | } |
24 | 24 | |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | $this->em->getClassMetadata(SequenceEntity::class), |
29 | 29 | ] |
30 | 30 | ); |
31 | - } catch(\Exception $e) { |
|
31 | + } catch (\Exception $e) { |
|
32 | 32 | } |
33 | 33 | } |
34 | 34 |