@@ -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\Query; |
6 | 6 | |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | $this->addToAssertionCount(1); |
31 | 31 | } catch (QueryException $e) { |
32 | 32 | if ($debug) { |
33 | - echo $e->getTraceAsString() . PHP_EOL; |
|
33 | + echo $e->getTraceAsString().PHP_EOL; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | $this->fail($e->getMessage()); |
@@ -45,8 +45,8 @@ discard block |
||
45 | 45 | $this->fail('No syntax errors were detected, when syntax errors were expected'); |
46 | 46 | } catch (QueryException $e) { |
47 | 47 | if ($debug) { |
48 | - echo $e->getMessage() . PHP_EOL; |
|
49 | - echo $e->getTraceAsString() . PHP_EOL; |
|
48 | + echo $e->getMessage().PHP_EOL; |
|
49 | + echo $e->getTraceAsString().PHP_EOL; |
|
50 | 50 | } |
51 | 51 | $this->addToAssertionCount(1); |
52 | 52 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | ['SELECT foo: FROM Doctrine\Tests\Models\CMS\CmsUser foo:'], |
109 | 109 | |
110 | 110 | /* Checks for invalid AbstractSchemaName */ |
111 | - ['SELECT u FROM UnknownClass u'], // unknown |
|
111 | + ['SELECT u FROM UnknownClass u'], // unknown |
|
112 | 112 | ['SELECT u FROM \Unknown\Class u'], // unknown, leading backslash |
113 | 113 | ['SELECT u FROM Unknown\\\\Class u'], // unknown, syntactically bogus (duplicate \\) |
114 | 114 | ['SELECT u FROM Unknown\Class\ u'], // unknown, syntactically bogus (trailing \) |
@@ -574,7 +574,7 @@ discard block |
||
574 | 574 | */ |
575 | 575 | public function testDQLKeywordInJoinIsAllowed() |
576 | 576 | { |
577 | - self::assertValidDQL('SELECT u FROM ' . __NAMESPACE__ . '\DQLKeywordsModelUser u JOIN u.group g'); |
|
577 | + self::assertValidDQL('SELECT u FROM '.__NAMESPACE__.'\DQLKeywordsModelUser u JOIN u.group g'); |
|
578 | 578 | } |
579 | 579 | |
580 | 580 | /** |
@@ -582,7 +582,7 @@ discard block |
||
582 | 582 | */ |
583 | 583 | public function testDQLKeywordInConditionIsAllowed() |
584 | 584 | { |
585 | - self::assertValidDQL('SELECT g FROM ' . __NAMESPACE__ . '\DQLKeywordsModelGroup g WHERE g.from=0'); |
|
585 | + self::assertValidDQL('SELECT g FROM '.__NAMESPACE__.'\DQLKeywordsModelGroup g WHERE g.from=0'); |
|
586 | 586 | } |
587 | 587 | |
588 | 588 | /* The exception is currently thrown in the SQLWalker, not earlier. |
@@ -687,7 +687,7 @@ discard block |
||
687 | 687 | */ |
688 | 688 | public function testNewLiteralExpression() |
689 | 689 | { |
690 | - self::assertValidDQL("SELECT new " . __NAMESPACE__ . "\\DummyStruct(u.id, 'foo', 1, true) FROM Doctrine\Tests\Models\CMS\CmsUser u"); |
|
690 | + self::assertValidDQL("SELECT new ".__NAMESPACE__."\\DummyStruct(u.id, 'foo', 1, true) FROM Doctrine\Tests\Models\CMS\CmsUser u"); |
|
691 | 691 | } |
692 | 692 | |
693 | 693 | /** |
@@ -695,7 +695,7 @@ discard block |
||
695 | 695 | */ |
696 | 696 | public function testNewLiteralWithSubselectExpression() |
697 | 697 | { |
698 | - self::assertValidDQL("SELECT new " . __NAMESPACE__ . "\\DummyStruct(u.id, 'foo', (SELECT 1 FROM Doctrine\Tests\Models\CMS\CmsUser su), true) FROM Doctrine\Tests\Models\CMS\CmsUser u"); |
|
698 | + self::assertValidDQL("SELECT new ".__NAMESPACE__."\\DummyStruct(u.id, 'foo', (SELECT 1 FROM Doctrine\Tests\Models\CMS\CmsUser su), true) FROM Doctrine\Tests\Models\CMS\CmsUser u"); |
|
699 | 699 | } |
700 | 700 | } |
701 | 701 |
@@ -135,13 +135,13 @@ |
||
135 | 135 | $cmf = new ClassMetadataFactory(); |
136 | 136 | $driver = $this->createMock(MappingDriver::class); |
137 | 137 | $driver->expects($this->at(0)) |
138 | - ->method('isTransient') |
|
139 | - ->with($this->equalTo(CmsUser::class)) |
|
140 | - ->will($this->returnValue(true)); |
|
138 | + ->method('isTransient') |
|
139 | + ->with($this->equalTo(CmsUser::class)) |
|
140 | + ->will($this->returnValue(true)); |
|
141 | 141 | $driver->expects($this->at(1)) |
142 | - ->method('isTransient') |
|
143 | - ->with($this->equalTo(CmsArticle::class)) |
|
144 | - ->will($this->returnValue(false)); |
|
142 | + ->method('isTransient') |
|
143 | + ->with($this->equalTo(CmsArticle::class)) |
|
144 | + ->will($this->returnValue(false)); |
|
145 | 145 | |
146 | 146 | $em = $this->createEntityManager($driver); |
147 | 147 |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $this->expectExceptionMessage('Too few parameters: the query defines 1 parameters but you only bound 0'); |
151 | 151 | |
152 | 152 | $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1') |
153 | - ->getSingleResult(); |
|
153 | + ->getSingleResult(); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | public function testInvalidInputParameterThrowsException() |
@@ -158,8 +158,8 @@ discard block |
||
158 | 158 | $this->expectException(QueryException::class); |
159 | 159 | |
160 | 160 | $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?') |
161 | - ->setParameter(1, 'jwage') |
|
162 | - ->getSingleResult(); |
|
161 | + ->setParameter(1, 'jwage') |
|
162 | + ->getSingleResult(); |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | public function testSetParameters() |
@@ -169,8 +169,8 @@ discard block |
||
169 | 169 | $parameters->add(new Parameter(2, 'active')); |
170 | 170 | |
171 | 171 | $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1 AND u.status = ?2') |
172 | - ->setParameters($parameters) |
|
173 | - ->getResult(); |
|
172 | + ->setParameters($parameters) |
|
173 | + ->getResult(); |
|
174 | 174 | |
175 | 175 | $extractValue = function (Parameter $parameter) { |
176 | 176 | return $parameter->getValue(); |
@@ -187,8 +187,8 @@ discard block |
||
187 | 187 | $parameters = [1 => 'jwage', 2 => 'active']; |
188 | 188 | |
189 | 189 | $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1 AND u.status = ?2') |
190 | - ->setParameters($parameters) |
|
191 | - ->getResult(); |
|
190 | + ->setParameters($parameters) |
|
191 | + ->getResult(); |
|
192 | 192 | |
193 | 193 | self::assertSame( |
194 | 194 | array_values($parameters), |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | public function testGetSingleResultThrowsExceptionOnNoResult() |
333 | 333 | { |
334 | 334 | $this->em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a") |
335 | - ->getSingleResult(); |
|
335 | + ->getSingleResult(); |
|
336 | 336 | } |
337 | 337 | |
338 | 338 | /** |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | public function testGetSingleScalarResultThrowsExceptionOnNoResult() |
342 | 342 | { |
343 | 343 | $this->em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a") |
344 | - ->getSingleScalarResult(); |
|
344 | + ->getSingleScalarResult(); |
|
345 | 345 | } |
346 | 346 | |
347 | 347 | /** |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | $this->em->clear(); |
373 | 373 | |
374 | 374 | $this->em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a") |
375 | - ->getSingleScalarResult(); |
|
375 | + ->getSingleScalarResult(); |
|
376 | 376 | } |
377 | 377 | |
378 | 378 | public function testModifiedLimitQuery() |
@@ -389,27 +389,27 @@ discard block |
||
389 | 389 | $this->em->clear(); |
390 | 390 | |
391 | 391 | $data = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u') |
392 | - ->setFirstResult(1) |
|
393 | - ->setMaxResults(2) |
|
394 | - ->getResult(); |
|
392 | + ->setFirstResult(1) |
|
393 | + ->setMaxResults(2) |
|
394 | + ->getResult(); |
|
395 | 395 | |
396 | 396 | self::assertCount(2, $data); |
397 | 397 | self::assertEquals('gblanco1', $data[0]->username); |
398 | 398 | self::assertEquals('gblanco2', $data[1]->username); |
399 | 399 | |
400 | 400 | $data = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u') |
401 | - ->setFirstResult(3) |
|
402 | - ->setMaxResults(2) |
|
403 | - ->getResult(); |
|
401 | + ->setFirstResult(3) |
|
402 | + ->setMaxResults(2) |
|
403 | + ->getResult(); |
|
404 | 404 | |
405 | 405 | self::assertCount(2, $data); |
406 | 406 | self::assertEquals('gblanco3', $data[0]->username); |
407 | 407 | self::assertEquals('gblanco4', $data[1]->username); |
408 | 408 | |
409 | 409 | $data = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u') |
410 | - ->setFirstResult(3) |
|
411 | - ->setMaxResults(2) |
|
412 | - ->getScalarResult(); |
|
410 | + ->setFirstResult(3) |
|
411 | + ->setMaxResults(2) |
|
412 | + ->getScalarResult(); |
|
413 | 413 | } |
414 | 414 | |
415 | 415 | /** |
@@ -620,9 +620,9 @@ discard block |
||
620 | 620 | { |
621 | 621 | $qb = $this->em->createQueryBuilder(); |
622 | 622 | $qb->select('u') |
623 | - ->from(CmsUser::class, 'u') |
|
624 | - ->innerJoin('u.articles', 'a') |
|
625 | - ->where('(u.id = 0) OR (u.id IS NULL)'); |
|
623 | + ->from(CmsUser::class, 'u') |
|
624 | + ->innerJoin('u.articles', 'a') |
|
625 | + ->where('(u.id = 0) OR (u.id IS NULL)'); |
|
626 | 626 | |
627 | 627 | $query = $qb->getQuery(); |
628 | 628 | $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 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | $this->em->flush(); |
96 | 96 | $this->em->clear(); |
97 | 97 | |
98 | - $query = $this->em->createQuery('select u, a from ' . CmsUser::class . ' u join u.articles a ORDER BY a.topic'); |
|
98 | + $query = $this->em->createQuery('select u, a from '.CmsUser::class.' u join u.articles a ORDER BY a.topic'); |
|
99 | 99 | $users = $query->getResult(); |
100 | 100 | |
101 | 101 | self::assertCount(1, $users); |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $this->em->flush(); |
116 | 116 | $this->em->clear(); |
117 | 117 | |
118 | - $q = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.username = ?0'); |
|
118 | + $q = $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u WHERE u.username = ?0'); |
|
119 | 119 | $q->setParameter(0, 'jwage'); |
120 | 120 | $user = $q->getSingleResult(); |
121 | 121 | |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | $this->expectException(QueryException::class); |
128 | 128 | $this->expectExceptionMessage('Invalid parameter: token 2 is not defined in the query.'); |
129 | 129 | |
130 | - $q = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1'); |
|
130 | + $q = $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u WHERE u.name = ?1'); |
|
131 | 131 | $q->setParameter(2, 'jwage'); |
132 | 132 | $user = $q->getSingleResult(); |
133 | 133 | } |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $this->expectException(QueryException::class); |
138 | 138 | $this->expectExceptionMessage('Too many parameters: the query defines 1 parameters and you bound 2'); |
139 | 139 | |
140 | - $q = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1'); |
|
140 | + $q = $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u WHERE u.name = ?1'); |
|
141 | 141 | $q->setParameter(1, 'jwage'); |
142 | 142 | $q->setParameter(2, 'jwage'); |
143 | 143 | |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | $this->expectException(QueryException::class); |
150 | 150 | $this->expectExceptionMessage('Too few parameters: the query defines 1 parameters but you only bound 0'); |
151 | 151 | |
152 | - $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1') |
|
152 | + $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u WHERE u.name = ?1') |
|
153 | 153 | ->getSingleResult(); |
154 | 154 | } |
155 | 155 | |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | { |
158 | 158 | $this->expectException(QueryException::class); |
159 | 159 | |
160 | - $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?') |
|
160 | + $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u WHERE u.name = ?') |
|
161 | 161 | ->setParameter(1, 'jwage') |
162 | 162 | ->getSingleResult(); |
163 | 163 | } |
@@ -168,11 +168,11 @@ discard block |
||
168 | 168 | $parameters->add(new Parameter(1, 'jwage')); |
169 | 169 | $parameters->add(new Parameter(2, 'active')); |
170 | 170 | |
171 | - $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1 AND u.status = ?2') |
|
171 | + $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u WHERE u.name = ?1 AND u.status = ?2') |
|
172 | 172 | ->setParameters($parameters) |
173 | 173 | ->getResult(); |
174 | 174 | |
175 | - $extractValue = function (Parameter $parameter) { |
|
175 | + $extractValue = function(Parameter $parameter) { |
|
176 | 176 | return $parameter->getValue(); |
177 | 177 | }; |
178 | 178 | |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | { |
187 | 187 | $parameters = [1 => 'jwage', 2 => 'active']; |
188 | 188 | |
189 | - $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1 AND u.status = ?2') |
|
189 | + $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u WHERE u.name = ?1 AND u.status = ?2') |
|
190 | 190 | ->setParameters($parameters) |
191 | 191 | ->getResult(); |
192 | 192 | |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | $this->em->clear(); |
217 | 217 | $articleId = $article1->id; |
218 | 218 | |
219 | - $query = $this->em->createQuery('select a from ' . CmsArticle::class . ' a WHERE a.topic = ?1'); |
|
219 | + $query = $this->em->createQuery('select a from '.CmsArticle::class.' a WHERE a.topic = ?1'); |
|
220 | 220 | $articles = $query->iterate(new ArrayCollection([new Parameter(1, 'Doctrine 2')]), Query::HYDRATE_ARRAY); |
221 | 221 | |
222 | 222 | $found = []; |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | $this->em->flush(); |
258 | 258 | $this->em->clear(); |
259 | 259 | |
260 | - $query = $this->em->createQuery('select a from ' . CmsArticle::class . ' a'); |
|
260 | + $query = $this->em->createQuery('select a from '.CmsArticle::class.' a'); |
|
261 | 261 | $articles = $query->iterate(); |
262 | 262 | |
263 | 263 | $iteratedCount = 0; |
@@ -379,8 +379,8 @@ discard block |
||
379 | 379 | { |
380 | 380 | for ($i = 0; $i < 5; $i++) { |
381 | 381 | $user = new CmsUser; |
382 | - $user->name = 'Guilherme' . $i; |
|
383 | - $user->username = 'gblanco' . $i; |
|
382 | + $user->name = 'Guilherme'.$i; |
|
383 | + $user->username = 'gblanco'.$i; |
|
384 | 384 | $user->status = 'developer'; |
385 | 385 | $this->em->persist($user); |
386 | 386 | } |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | $this->em->flush(); |
389 | 389 | $this->em->clear(); |
390 | 390 | |
391 | - $data = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u') |
|
391 | + $data = $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u') |
|
392 | 392 | ->setFirstResult(1) |
393 | 393 | ->setMaxResults(2) |
394 | 394 | ->getResult(); |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | self::assertEquals('gblanco1', $data[0]->username); |
398 | 398 | self::assertEquals('gblanco2', $data[1]->username); |
399 | 399 | |
400 | - $data = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u') |
|
400 | + $data = $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u') |
|
401 | 401 | ->setFirstResult(3) |
402 | 402 | ->setMaxResults(2) |
403 | 403 | ->getResult(); |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | self::assertEquals('gblanco3', $data[0]->username); |
407 | 407 | self::assertEquals('gblanco4', $data[1]->username); |
408 | 408 | |
409 | - $data = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u') |
|
409 | + $data = $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u') |
|
410 | 410 | ->setFirstResult(3) |
411 | 411 | ->setMaxResults(2) |
412 | 412 | ->getScalarResult(); |
@@ -515,13 +515,13 @@ discard block |
||
515 | 515 | $this->em->flush(); |
516 | 516 | $this->em->clear(); |
517 | 517 | |
518 | - $query = $this->em->createQuery("select u from " . CmsUser::class . " u where u.username = 'gblanco'"); |
|
518 | + $query = $this->em->createQuery("select u from ".CmsUser::class." u where u.username = 'gblanco'"); |
|
519 | 519 | $fetchedUser = $query->getOneOrNullResult(); |
520 | 520 | |
521 | 521 | self::assertInstanceOf(CmsUser::class, $fetchedUser); |
522 | 522 | self::assertEquals('gblanco', $fetchedUser->username); |
523 | 523 | |
524 | - $query = $this->em->createQuery("select u.username from " . CmsUser::class . " u where u.username = 'gblanco'"); |
|
524 | + $query = $this->em->createQuery("select u.username from ".CmsUser::class." u where u.username = 'gblanco'"); |
|
525 | 525 | $fetchedUsername = $query->getOneOrNullResult(Query::HYDRATE_SINGLE_SCALAR); |
526 | 526 | |
527 | 527 | self::assertEquals('gblanco', $fetchedUsername); |
@@ -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\ORM\Query; |
6 | 6 | |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | $tokenStr = substr($dql, (int) $token['position'], $length); |
471 | 471 | |
472 | 472 | // Building informative message |
473 | - $message = 'line 0, col ' . $tokenPos . " near '" . $tokenStr . "': Error: " . $message; |
|
473 | + $message = 'line 0, col '.$tokenPos." near '".$tokenStr."': Error: ".$message; |
|
474 | 474 | |
475 | 475 | throw QueryException::semanticalError( |
476 | 476 | $message, |
@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | // If the namespace is not given then assumes the first FROM entity namespace |
619 | 619 | if (strpos($className, '\\') === false && ! class_exists($className) && strpos($fromClassName, '\\') !== false) { |
620 | 620 | $namespace = substr($fromClassName, 0, strrpos($fromClassName, '\\')); |
621 | - $fqcn = $namespace . '\\' . $className; |
|
621 | + $fqcn = $namespace.'\\'.$className; |
|
622 | 622 | |
623 | 623 | if (class_exists($fqcn)) { |
624 | 624 | $expression->className = $fqcn; |
@@ -667,13 +667,13 @@ discard block |
||
667 | 667 | } |
668 | 668 | |
669 | 669 | $this->semanticalError( |
670 | - "There is no mapped field named '$field' on class " . $class->getClassName() . ".", $deferredItem['token'] |
|
670 | + "There is no mapped field named '$field' on class ".$class->getClassName().".", $deferredItem['token'] |
|
671 | 671 | ); |
672 | 672 | } |
673 | 673 | |
674 | 674 | if (array_intersect($class->identifier, $expr->partialFieldSet) != $class->identifier) { |
675 | 675 | $this->semanticalError( |
676 | - "The partial field selection of class " . $class->getClassName() . " must contain the identifier.", |
|
676 | + "The partial field selection of class ".$class->getClassName()." must contain the identifier.", |
|
677 | 677 | $deferredItem['token'] |
678 | 678 | ); |
679 | 679 | } |
@@ -742,9 +742,9 @@ discard block |
||
742 | 742 | $property = $class->getProperty($field); |
743 | 743 | |
744 | 744 | // Check if field or association exists |
745 | - if (! $property) { |
|
745 | + if ( ! $property) { |
|
746 | 746 | $this->semanticalError( |
747 | - 'Class ' . $class->getClassName() . ' has no field or association named ' . $field, |
|
747 | + 'Class '.$class->getClassName().' has no field or association named '.$field, |
|
748 | 748 | $deferredItem['token'] |
749 | 749 | ); |
750 | 750 | } |
@@ -783,8 +783,8 @@ discard block |
||
783 | 783 | // Build the error message |
784 | 784 | $semanticalError = 'Invalid PathExpression. '; |
785 | 785 | $semanticalError .= \count($expectedStringTypes) === 1 |
786 | - ? 'Must be a ' . $expectedStringTypes[0] . '.' |
|
787 | - : implode(' or ', $expectedStringTypes) . ' expected.'; |
|
786 | + ? 'Must be a '.$expectedStringTypes[0].'.' |
|
787 | + : implode(' or ', $expectedStringTypes).' expected.'; |
|
788 | 788 | |
789 | 789 | $this->semanticalError($semanticalError, $deferredItem['token']); |
790 | 790 | } |
@@ -1029,7 +1029,7 @@ discard block |
||
1029 | 1029 | |
1030 | 1030 | if ( ! isset($this->queryComponents[$identVariable])) { |
1031 | 1031 | $this->semanticalError( |
1032 | - 'Identification Variable ' . $identVariable .' used in join path expression but was not defined before.' |
|
1032 | + 'Identification Variable '.$identVariable.' used in join path expression but was not defined before.' |
|
1033 | 1033 | ); |
1034 | 1034 | } |
1035 | 1035 | |
@@ -1042,8 +1042,8 @@ discard block |
||
1042 | 1042 | $qComp = $this->queryComponents[$identVariable]; |
1043 | 1043 | $class = $qComp['metadata']; |
1044 | 1044 | |
1045 | - if (! (($property = $class->getProperty($field)) !== null && $property instanceof AssociationMetadata)) { |
|
1046 | - $this->semanticalError('Class ' . $class->getClassName() . ' has no association named ' . $field); |
|
1045 | + if ( ! (($property = $class->getProperty($field)) !== null && $property instanceof AssociationMetadata)) { |
|
1046 | + $this->semanticalError('Class '.$class->getClassName().' has no association named '.$field); |
|
1047 | 1047 | } |
1048 | 1048 | |
1049 | 1049 | return new AST\JoinAssociationPathExpression($identVariable, $field); |
@@ -2465,7 +2465,7 @@ discard block |
||
2465 | 2465 | // Peek beyond the matching closing parenthesis ')' |
2466 | 2466 | $peek = $this->peekBeyondClosingParenthesis(); |
2467 | 2467 | |
2468 | - if (in_array($peek['value'], ["=", "<", "<=", "<>", ">", ">=", "!="]) || |
|
2468 | + if (in_array($peek['value'], ["=", "<", "<=", "<>", ">", ">=", "!="]) || |
|
2469 | 2469 | in_array($peek['type'], [Lexer::T_NOT, Lexer::T_BETWEEN, Lexer::T_LIKE, Lexer::T_IN, Lexer::T_IS, Lexer::T_EXISTS]) || |
2470 | 2470 | $this->isMathOperator($peek)) { |
2471 | 2471 | $condPrimary->simpleConditionalExpression = $this->SimpleConditionalExpression(); |
@@ -2570,7 +2570,7 @@ discard block |
||
2570 | 2570 | return $this->NullComparisonExpression(); |
2571 | 2571 | } |
2572 | 2572 | |
2573 | - if ($token['type'] === Lexer::T_IS && $lookahead['type'] === Lexer::T_EMPTY) { |
|
2573 | + if ($token['type'] === Lexer::T_IS && $lookahead['type'] === Lexer::T_EMPTY) { |
|
2574 | 2574 | return $this->EmptyCollectionComparisonExpression(); |
2575 | 2575 | } |
2576 | 2576 |
@@ -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\ORM\Mapping; |
6 | 6 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | ClassMetadataBuildingContext $metadataBuildingContext |
91 | 91 | ) : ?ClassMetadata |
92 | 92 | { |
93 | - if (! $this->evm->hasListeners(Events::onClassMetadataNotFound)) { |
|
93 | + if ( ! $this->evm->hasListeners(Events::onClassMetadataNotFound)) { |
|
94 | 94 | return null; |
95 | 95 | } |
96 | 96 | |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | } |
166 | 166 | } |
167 | 167 | |
168 | - if (! $classMetadata->discriminatorMap && $classMetadata->inheritanceType !== InheritanceType::NONE && $classMetadata->isRootEntity()) { |
|
168 | + if ( ! $classMetadata->discriminatorMap && $classMetadata->inheritanceType !== InheritanceType::NONE && $classMetadata->isRootEntity()) { |
|
169 | 169 | $this->addDefaultDiscriminatorMap($classMetadata); |
170 | 170 | } |
171 | 171 | |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | */ |
192 | 192 | protected function completeRuntimeMetadata(ClassMetadata $class, ClassMetadata $parent = null) : void |
193 | 193 | { |
194 | - if (! $parent || ! $parent->isMappedSuperclass) { |
|
194 | + if ( ! $parent || ! $parent->isMappedSuperclass) { |
|
195 | 195 | return; |
196 | 196 | } |
197 | 197 | |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | continue; |
210 | 210 | } |
211 | 211 | |
212 | - if (! ($property instanceof ToOneAssociationMetadata)) { |
|
212 | + if ( ! ($property instanceof ToOneAssociationMetadata)) { |
|
213 | 213 | continue; |
214 | 214 | } |
215 | 215 | |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | */ |
234 | 234 | protected function validateRuntimeMetadata(ClassMetadata $class, ClassMetadata $parent = null) : void |
235 | 235 | { |
236 | - if (! $class->getReflectionClass()) { |
|
236 | + if ( ! $class->getReflectionClass()) { |
|
237 | 237 | // only validate if there is a reflection class instance |
238 | 238 | return; |
239 | 239 | } |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | // verify inheritance |
246 | 246 | if ( ! $class->isMappedSuperclass && $class->inheritanceType !== InheritanceType::NONE) { |
247 | 247 | if ( ! $parent) { |
248 | - if (! $class->discriminatorMap) { |
|
248 | + if ( ! $class->discriminatorMap) { |
|
249 | 249 | throw MappingException::missingDiscriminatorMap($class->getClassName()); |
250 | 250 | } |
251 | 251 | |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | |
508 | 508 | private function completeFieldIdentifierGeneratorMapping(FieldMetadata $field) |
509 | 509 | { |
510 | - if (!$field->hasValueGenerator()) { |
|
510 | + if ( ! $field->hasValueGenerator()) { |
|
511 | 511 | return; |
512 | 512 | } |
513 | 513 | |
@@ -574,7 +574,7 @@ discard block |
||
574 | 574 | break; |
575 | 575 | |
576 | 576 | default: |
577 | - throw new ORMException("Unknown generator type: " . $generator->getType()); |
|
577 | + throw new ORMException("Unknown generator type: ".$generator->getType()); |
|
578 | 578 | } |
579 | 579 | } |
580 | 580 | |
@@ -599,7 +599,7 @@ discard block |
||
599 | 599 | */ |
600 | 600 | private function getTargetPlatform() : Platforms\AbstractPlatform |
601 | 601 | { |
602 | - if (!$this->targetPlatform) { |
|
602 | + if ( ! $this->targetPlatform) { |
|
603 | 603 | $this->targetPlatform = $this->em->getConnection()->getDatabasePlatform(); |
604 | 604 | } |
605 | 605 | |
@@ -617,7 +617,7 @@ discard block |
||
617 | 617 | $generatedProperties = []; |
618 | 618 | |
619 | 619 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
620 | - if (! ($property instanceof LocalColumnMetadata && $property->hasValueGenerator())) { |
|
620 | + if ( ! ($property instanceof LocalColumnMetadata && $property->hasValueGenerator())) { |
|
621 | 621 | continue; |
622 | 622 | } |
623 | 623 |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | public function testExceptionIsThrownWhenCallingFindByWithoutParameter() |
312 | 312 | { |
313 | 313 | $this->em->getRepository(CmsUser::class) |
314 | - ->findByStatus(); |
|
314 | + ->findByStatus(); |
|
315 | 315 | } |
316 | 316 | |
317 | 317 | /** |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | public function testExceptionIsThrownWhenUsingInvalidFieldName() |
321 | 321 | { |
322 | 322 | $this->em->getRepository(CmsUser::class) |
323 | - ->findByThisFieldDoesNotExist('testvalue'); |
|
323 | + ->findByThisFieldDoesNotExist('testvalue'); |
|
324 | 324 | } |
325 | 325 | |
326 | 326 | /** |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | $this->expectException(TransactionRequiredException::class); |
333 | 333 | |
334 | 334 | $this->em->getRepository(CmsUser::class) |
335 | - ->find(1, LockMode::PESSIMISTIC_READ); |
|
335 | + ->find(1, LockMode::PESSIMISTIC_READ); |
|
336 | 336 | } |
337 | 337 | |
338 | 338 | /** |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | $this->expectException(TransactionRequiredException::class); |
345 | 345 | |
346 | 346 | $this->em->getRepository(CmsUser::class) |
347 | - ->find(1, LockMode::PESSIMISTIC_WRITE); |
|
347 | + ->find(1, LockMode::PESSIMISTIC_WRITE); |
|
348 | 348 | } |
349 | 349 | |
350 | 350 | /** |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | $this->expectException(OptimisticLockException::class); |
357 | 357 | |
358 | 358 | $this->em->getRepository(CmsUser::class) |
359 | - ->find(1, LockMode::OPTIMISTIC); |
|
359 | + ->find(1, LockMode::OPTIMISTIC); |
|
360 | 360 | } |
361 | 361 | |
362 | 362 | /** |
@@ -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 | |
@@ -676,7 +676,7 @@ discard block |
||
676 | 676 | public function testCanRetrieveRepositoryFromClassNameWithLeadingBackslash() |
677 | 677 | { |
678 | 678 | self::assertSame( |
679 | - $this->em->getRepository('\\' . CmsUser::class), |
|
679 | + $this->em->getRepository('\\'.CmsUser::class), |
|
680 | 680 | $this->em->getRepository(CmsUser::class) |
681 | 681 | ); |
682 | 682 | } |
@@ -714,7 +714,7 @@ discard block |
||
714 | 714 | $data = $repo->findBy(['user' => [1, 2, 3]]); |
715 | 715 | |
716 | 716 | $query = array_pop($this->sqlLoggerStack->queries); |
717 | - self::assertEquals([1,2,3], $query['params'][0]); |
|
717 | + self::assertEquals([1, 2, 3], $query['params'][0]); |
|
718 | 718 | self::assertEquals(Connection::PARAM_INT_ARRAY, $query['types'][0]); |
719 | 719 | } |
720 | 720 |
@@ -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\ORM; |
6 | 6 | |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | public function getParameter($key) |
306 | 306 | { |
307 | 307 | $filteredParameters = $this->parameters->filter( |
308 | - function (Query\Parameter $parameter) use ($key) : bool { |
|
308 | + function(Query\Parameter $parameter) use ($key) : bool { |
|
309 | 309 | $parameterName = $parameter->getName(); |
310 | 310 | |
311 | 311 | return $key === $parameterName || (string) $key === (string) $parameterName; |
@@ -955,7 +955,7 @@ discard block |
||
955 | 955 | $this->getTimestampKey() |
956 | 956 | ); |
957 | 957 | |
958 | - $result = $queryCache->get($queryKey, $rsm, $this->hints); |
|
958 | + $result = $queryCache->get($queryKey, $rsm, $this->hints); |
|
959 | 959 | |
960 | 960 | if ($result !== null) { |
961 | 961 | if ($this->cacheLogger) { |
@@ -1089,6 +1089,6 @@ discard block |
||
1089 | 1089 | |
1090 | 1090 | ksort($hints); |
1091 | 1091 | |
1092 | - return sha1($query . '-' . serialize($params) . '-' . serialize($hints)); |
|
1092 | + return sha1($query.'-'.serialize($params).'-'.serialize($hints)); |
|
1093 | 1093 | } |
1094 | 1094 | } |