@@ -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\ORM\Query; |
| 6 | 6 | |
@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | } |
| 390 | 390 | |
| 391 | 391 | foreach ($this->queryComponents as $dqlAlias => $qComp) { |
| 392 | - if (! isset($this->identVariableExpressions[$dqlAlias])) { |
|
| 392 | + if ( ! isset($this->identVariableExpressions[$dqlAlias])) { |
|
| 393 | 393 | continue; |
| 394 | 394 | } |
| 395 | 395 | |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | $tokenStr = substr($dql, (int) $token['position'], $length); |
| 454 | 454 | |
| 455 | 455 | // Building informative message |
| 456 | - $message = 'line 0, col ' . $tokenPos . " near '" . $tokenStr . "': Error: " . $message; |
|
| 456 | + $message = 'line 0, col '.$tokenPos." near '".$tokenStr."': Error: ".$message; |
|
| 457 | 457 | |
| 458 | 458 | throw QueryException::semanticalError( |
| 459 | 459 | $message, |
@@ -556,7 +556,7 @@ discard block |
||
| 556 | 556 | $identVariable = $deferredItem['expression']; |
| 557 | 557 | |
| 558 | 558 | // Check if IdentificationVariable exists in queryComponents |
| 559 | - if (! isset($this->queryComponents[$identVariable])) { |
|
| 559 | + if ( ! isset($this->queryComponents[$identVariable])) { |
|
| 560 | 560 | $this->semanticalError( |
| 561 | 561 | sprintf("'%s' is not defined.", $identVariable), |
| 562 | 562 | $deferredItem['token'] |
@@ -566,7 +566,7 @@ discard block |
||
| 566 | 566 | $qComp = $this->queryComponents[$identVariable]; |
| 567 | 567 | |
| 568 | 568 | // Check if queryComponent points to an AbstractSchemaName or a ResultVariable |
| 569 | - if (! isset($qComp['metadata'])) { |
|
| 569 | + if ( ! isset($qComp['metadata'])) { |
|
| 570 | 570 | $this->semanticalError( |
| 571 | 571 | sprintf("'%s' does not point to a Class.", $identVariable), |
| 572 | 572 | $deferredItem['token'] |
@@ -600,7 +600,7 @@ discard block |
||
| 600 | 600 | // If the namespace is not given then assumes the first FROM entity namespace |
| 601 | 601 | if (strpos($className, '\\') === false && ! class_exists($className) && strpos($fromClassName, '\\') !== false) { |
| 602 | 602 | $namespace = substr($fromClassName, 0, strrpos($fromClassName, '\\')); |
| 603 | - $fqcn = $namespace . '\\' . $className; |
|
| 603 | + $fqcn = $namespace.'\\'.$className; |
|
| 604 | 604 | |
| 605 | 605 | if (class_exists($fqcn)) { |
| 606 | 606 | $expression->className = $fqcn; |
@@ -608,13 +608,13 @@ discard block |
||
| 608 | 608 | } |
| 609 | 609 | } |
| 610 | 610 | |
| 611 | - if (! class_exists($className)) { |
|
| 611 | + if ( ! class_exists($className)) { |
|
| 612 | 612 | $this->semanticalError(sprintf('Class "%s" is not defined.', $className), $token); |
| 613 | 613 | } |
| 614 | 614 | |
| 615 | 615 | $class = new \ReflectionClass($className); |
| 616 | 616 | |
| 617 | - if (! $class->isInstantiable()) { |
|
| 617 | + if ( ! $class->isInstantiable()) { |
|
| 618 | 618 | $this->semanticalError(sprintf('Class "%s" can not be instantiated.', $className), $token); |
| 619 | 619 | } |
| 620 | 620 | |
@@ -671,7 +671,7 @@ discard block |
||
| 671 | 671 | $resultVariable = $deferredItem['expression']; |
| 672 | 672 | |
| 673 | 673 | // Check if ResultVariable exists in queryComponents |
| 674 | - if (! isset($this->queryComponents[$resultVariable])) { |
|
| 674 | + if ( ! isset($this->queryComponents[$resultVariable])) { |
|
| 675 | 675 | $this->semanticalError( |
| 676 | 676 | sprintf("'%s' is not defined.", $resultVariable), |
| 677 | 677 | $deferredItem['token'] |
@@ -681,7 +681,7 @@ discard block |
||
| 681 | 681 | $qComp = $this->queryComponents[$resultVariable]; |
| 682 | 682 | |
| 683 | 683 | // Check if queryComponent points to an AbstractSchemaName or a ResultVariable |
| 684 | - if (! isset($qComp['resultVariable'])) { |
|
| 684 | + if ( ! isset($qComp['resultVariable'])) { |
|
| 685 | 685 | $this->semanticalError( |
| 686 | 686 | sprintf("'%s' does not point to a ResultVariable.", $resultVariable), |
| 687 | 687 | $deferredItem['token'] |
@@ -723,9 +723,9 @@ discard block |
||
| 723 | 723 | $property = $class->getProperty($field); |
| 724 | 724 | |
| 725 | 725 | // Check if field or association exists |
| 726 | - if (! $property) { |
|
| 726 | + if ( ! $property) { |
|
| 727 | 727 | $this->semanticalError( |
| 728 | - 'Class ' . $class->getClassName() . ' has no field or association named ' . $field, |
|
| 728 | + 'Class '.$class->getClassName().' has no field or association named '.$field, |
|
| 729 | 729 | $deferredItem['token'] |
| 730 | 730 | ); |
| 731 | 731 | } |
@@ -742,7 +742,7 @@ discard block |
||
| 742 | 742 | // Validate if PathExpression is one of the expected types |
| 743 | 743 | $expectedType = $pathExpression->expectedType; |
| 744 | 744 | |
| 745 | - if (! ($expectedType & $fieldType)) { |
|
| 745 | + if ( ! ($expectedType & $fieldType)) { |
|
| 746 | 746 | // We need to recognize which was expected type(s) |
| 747 | 747 | $expectedStringTypes = []; |
| 748 | 748 | |
@@ -764,8 +764,8 @@ discard block |
||
| 764 | 764 | // Build the error message |
| 765 | 765 | $semanticalError = 'Invalid PathExpression. '; |
| 766 | 766 | $semanticalError .= \count($expectedStringTypes) === 1 |
| 767 | - ? 'Must be a ' . $expectedStringTypes[0] . '.' |
|
| 768 | - : implode(' or ', $expectedStringTypes) . ' expected.'; |
|
| 767 | + ? 'Must be a '.$expectedStringTypes[0].'.' |
|
| 768 | + : implode(' or ', $expectedStringTypes).' expected.'; |
|
| 769 | 769 | |
| 770 | 770 | $this->semanticalError($semanticalError, $deferredItem['token']); |
| 771 | 771 | } |
@@ -777,7 +777,7 @@ discard block |
||
| 777 | 777 | |
| 778 | 778 | private function processRootEntityAliasSelected() |
| 779 | 779 | { |
| 780 | - if (! $this->identVariableExpressions) { |
|
| 780 | + if ( ! $this->identVariableExpressions) { |
|
| 781 | 781 | return; |
| 782 | 782 | } |
| 783 | 783 | |
@@ -1007,9 +1007,9 @@ discard block |
||
| 1007 | 1007 | { |
| 1008 | 1008 | $identVariable = $this->IdentificationVariable(); |
| 1009 | 1009 | |
| 1010 | - if (! isset($this->queryComponents[$identVariable])) { |
|
| 1010 | + if ( ! isset($this->queryComponents[$identVariable])) { |
|
| 1011 | 1011 | $this->semanticalError( |
| 1012 | - 'Identification Variable ' . $identVariable . ' used in join path expression but was not defined before.' |
|
| 1012 | + 'Identification Variable '.$identVariable.' used in join path expression but was not defined before.' |
|
| 1013 | 1013 | ); |
| 1014 | 1014 | } |
| 1015 | 1015 | |
@@ -1023,8 +1023,8 @@ discard block |
||
| 1023 | 1023 | $class = $qComp['metadata']; |
| 1024 | 1024 | $property = $class->getProperty($field); |
| 1025 | 1025 | |
| 1026 | - if (! ($property !== null && $property instanceof AssociationMetadata)) { |
|
| 1027 | - $this->semanticalError('Class ' . $class->getClassName() . ' has no association named ' . $field); |
|
| 1026 | + if ( ! ($property !== null && $property instanceof AssociationMetadata)) { |
|
| 1027 | + $this->semanticalError('Class '.$class->getClassName().' has no association named '.$field); |
|
| 1028 | 1028 | } |
| 1029 | 1029 | |
| 1030 | 1030 | return new AST\JoinAssociationPathExpression($identVariable, $field); |
@@ -1054,7 +1054,7 @@ discard block |
||
| 1054 | 1054 | while ($this->lexer->isNextToken(Lexer::T_DOT)) { |
| 1055 | 1055 | $this->match(Lexer::T_DOT); |
| 1056 | 1056 | $this->match(Lexer::T_IDENTIFIER); |
| 1057 | - $field .= '.' . $this->lexer->token['value']; |
|
| 1057 | + $field .= '.'.$this->lexer->token['value']; |
|
| 1058 | 1058 | } |
| 1059 | 1059 | } |
| 1060 | 1060 | |
@@ -1436,7 +1436,7 @@ discard block |
||
| 1436 | 1436 | // Still need to decide between IdentificationVariable or ResultVariable |
| 1437 | 1437 | $lookaheadValue = $this->lexer->lookahead['value']; |
| 1438 | 1438 | |
| 1439 | - if (! isset($this->queryComponents[$lookaheadValue])) { |
|
| 1439 | + if ( ! isset($this->queryComponents[$lookaheadValue])) { |
|
| 1440 | 1440 | $this->semanticalError('Cannot group by undefined identification or result variable.'); |
| 1441 | 1441 | } |
| 1442 | 1442 | |
@@ -1785,7 +1785,7 @@ discard block |
||
| 1785 | 1785 | while ($this->lexer->isNextToken(Lexer::T_DOT)) { |
| 1786 | 1786 | $this->match(Lexer::T_DOT); |
| 1787 | 1787 | $this->match(Lexer::T_IDENTIFIER); |
| 1788 | - $field .= '.' . $this->lexer->token['value']; |
|
| 1788 | + $field .= '.'.$this->lexer->token['value']; |
|
| 1789 | 1789 | } |
| 1790 | 1790 | |
| 1791 | 1791 | $partialFieldSet[] = $field; |
@@ -1799,7 +1799,7 @@ discard block |
||
| 1799 | 1799 | while ($this->lexer->isNextToken(Lexer::T_DOT)) { |
| 1800 | 1800 | $this->match(Lexer::T_DOT); |
| 1801 | 1801 | $this->match(Lexer::T_IDENTIFIER); |
| 1802 | - $field .= '.' . $this->lexer->token['value']; |
|
| 1802 | + $field .= '.'.$this->lexer->token['value']; |
|
| 1803 | 1803 | } |
| 1804 | 1804 | |
| 1805 | 1805 | $partialFieldSet[] = $field; |
@@ -2420,7 +2420,7 @@ discard block |
||
| 2420 | 2420 | |
| 2421 | 2421 | // Phase 1 AST optimization: Prevent AST\ConditionalFactor |
| 2422 | 2422 | // if only one AST\ConditionalPrimary is defined |
| 2423 | - if (! $not) { |
|
| 2423 | + if ( ! $not) { |
|
| 2424 | 2424 | return $conditionalPrimary; |
| 2425 | 2425 | } |
| 2426 | 2426 | |
@@ -2439,7 +2439,7 @@ discard block |
||
| 2439 | 2439 | { |
| 2440 | 2440 | $condPrimary = new AST\ConditionalPrimary; |
| 2441 | 2441 | |
| 2442 | - if (! $this->lexer->isNextToken(Lexer::T_OPEN_PARENTHESIS)) { |
|
| 2442 | + if ( ! $this->lexer->isNextToken(Lexer::T_OPEN_PARENTHESIS)) { |
|
| 2443 | 2443 | $condPrimary->simpleConditionalExpression = $this->SimpleConditionalExpression(); |
| 2444 | 2444 | |
| 2445 | 2445 | return $condPrimary; |
@@ -2607,7 +2607,7 @@ discard block |
||
| 2607 | 2607 | $this->match(Lexer::T_OF); |
| 2608 | 2608 | } |
| 2609 | 2609 | |
| 2610 | - $collMemberExpr = new AST\CollectionMemberExpression( |
|
| 2610 | + $collMemberExpr = new AST\CollectionMemberExpression( |
|
| 2611 | 2611 | $entityExpr, |
| 2612 | 2612 | $this->CollectionValuedPathExpression() |
| 2613 | 2613 | ); |
@@ -2944,7 +2944,7 @@ discard block |
||
| 2944 | 2944 | $lookaheadType = $this->lexer->lookahead['type']; |
| 2945 | 2945 | $isDistinct = false; |
| 2946 | 2946 | |
| 2947 | - if (! in_array($lookaheadType, [Lexer::T_COUNT, Lexer::T_AVG, Lexer::T_MAX, Lexer::T_MIN, Lexer::T_SUM])) { |
|
| 2947 | + if ( ! in_array($lookaheadType, [Lexer::T_COUNT, Lexer::T_AVG, Lexer::T_MAX, Lexer::T_MIN, Lexer::T_SUM])) { |
|
| 2948 | 2948 | $this->syntaxError('One of: MAX, MIN, AVG, SUM, COUNT'); |
| 2949 | 2949 | } |
| 2950 | 2950 | |
@@ -2974,7 +2974,7 @@ discard block |
||
| 2974 | 2974 | $lookaheadType = $this->lexer->lookahead['type']; |
| 2975 | 2975 | $value = $this->lexer->lookahead['value']; |
| 2976 | 2976 | |
| 2977 | - if (! in_array($lookaheadType, [Lexer::T_ALL, Lexer::T_ANY, Lexer::T_SOME])) { |
|
| 2977 | + if ( ! in_array($lookaheadType, [Lexer::T_ALL, Lexer::T_ANY, Lexer::T_SOME])) { |
|
| 2978 | 2978 | $this->syntaxError('ALL, ANY or SOME'); |
| 2979 | 2979 | } |
| 2980 | 2980 | |
@@ -3212,7 +3212,7 @@ discard block |
||
| 3212 | 3212 | $lookaheadValue = $this->lexer->lookahead['value']; |
| 3213 | 3213 | |
| 3214 | 3214 | // Validate existing component |
| 3215 | - if (! isset($this->queryComponents[$lookaheadValue])) { |
|
| 3215 | + if ( ! isset($this->queryComponents[$lookaheadValue])) { |
|
| 3216 | 3216 | $this->semanticalError('Cannot add having condition on undefined result variable.'); |
| 3217 | 3217 | } |
| 3218 | 3218 | |
@@ -3223,7 +3223,7 @@ discard block |
||
| 3223 | 3223 | } |
| 3224 | 3224 | |
| 3225 | 3225 | // Validating ResultVariable |
| 3226 | - if (! isset($this->queryComponents[$lookaheadValue]['resultVariable'])) { |
|
| 3226 | + if ( ! isset($this->queryComponents[$lookaheadValue]['resultVariable'])) { |
|
| 3227 | 3227 | $this->semanticalError('Cannot add having condition on a non result variable.'); |
| 3228 | 3228 | } |
| 3229 | 3229 | |
@@ -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 | |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | public function getParameter($key) |
| 294 | 294 | { |
| 295 | 295 | $filteredParameters = $this->parameters->filter( |
| 296 | - function (Query\Parameter $parameter) use ($key) : bool { |
|
| 296 | + function(Query\Parameter $parameter) use ($key) : bool { |
|
| 297 | 297 | $parameterName = $parameter->getName(); |
| 298 | 298 | |
| 299 | 299 | return $key === $parameterName || (string) $key === (string) $parameterName; |
@@ -712,7 +712,7 @@ discard block |
||
| 712 | 712 | return null; |
| 713 | 713 | } |
| 714 | 714 | |
| 715 | - if (! is_array($result)) { |
|
| 715 | + if ( ! is_array($result)) { |
|
| 716 | 716 | return $result; |
| 717 | 717 | } |
| 718 | 718 | |
@@ -746,7 +746,7 @@ discard block |
||
| 746 | 746 | throw new NoResultException; |
| 747 | 747 | } |
| 748 | 748 | |
| 749 | - if (! is_array($result)) { |
|
| 749 | + if ( ! is_array($result)) { |
|
| 750 | 750 | return $result; |
| 751 | 751 | } |
| 752 | 752 | |
@@ -835,7 +835,7 @@ discard block |
||
| 835 | 835 | $this->setHydrationMode($hydrationMode); |
| 836 | 836 | } |
| 837 | 837 | |
| 838 | - if (! empty($parameters)) { |
|
| 838 | + if ( ! empty($parameters)) { |
|
| 839 | 839 | $this->setParameters($parameters); |
| 840 | 840 | } |
| 841 | 841 | |
@@ -876,11 +876,11 @@ discard block |
||
| 876 | 876 | $this->setHydrationMode($hydrationMode); |
| 877 | 877 | } |
| 878 | 878 | |
| 879 | - if (! empty($parameters)) { |
|
| 879 | + if ( ! empty($parameters)) { |
|
| 880 | 880 | $this->setParameters($parameters); |
| 881 | 881 | } |
| 882 | 882 | |
| 883 | - $setCacheEntry = function () { |
|
| 883 | + $setCacheEntry = function() { |
|
| 884 | 884 | }; |
| 885 | 885 | |
| 886 | 886 | if ($this->hydrationCacheProfile !== null) { |
@@ -894,11 +894,11 @@ discard block |
||
| 894 | 894 | return $result[$realCacheKey]; |
| 895 | 895 | } |
| 896 | 896 | |
| 897 | - if (! $result) { |
|
| 897 | + if ( ! $result) { |
|
| 898 | 898 | $result = []; |
| 899 | 899 | } |
| 900 | 900 | |
| 901 | - $setCacheEntry = function ($data) use ($cache, $result, $cacheKey, $realCacheKey, $queryCacheProfile) { |
|
| 901 | + $setCacheEntry = function($data) use ($cache, $result, $cacheKey, $realCacheKey, $queryCacheProfile) { |
|
| 902 | 902 | $result[$realCacheKey] = $data; |
| 903 | 903 | |
| 904 | 904 | $cache->save($cacheKey, $result, $queryCacheProfile->getLifetime()); |
@@ -1060,7 +1060,7 @@ discard block |
||
| 1060 | 1060 | { |
| 1061 | 1061 | $query = $this->getSQL(); |
| 1062 | 1062 | $hints = $this->getHints(); |
| 1063 | - $params = array_map(function (Parameter $parameter) { |
|
| 1063 | + $params = array_map(function(Parameter $parameter) { |
|
| 1064 | 1064 | $value = $parameter->getValue(); |
| 1065 | 1065 | |
| 1066 | 1066 | // Small optimization |
@@ -1074,6 +1074,6 @@ discard block |
||
| 1074 | 1074 | |
| 1075 | 1075 | ksort($hints); |
| 1076 | 1076 | |
| 1077 | - return sha1($query . '-' . serialize($params) . '-' . serialize($hints)); |
|
| 1077 | + return sha1($query.'-'.serialize($params).'-'.serialize($hints)); |
|
| 1078 | 1078 | } |
| 1079 | 1079 | } |
@@ -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 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | string $className, |
| 81 | 81 | ClassMetadataBuildingContext $metadataBuildingContext |
| 82 | 82 | ) : ?ClassMetadata { |
| 83 | - if (! $this->evm->hasListeners(Events::onClassMetadataNotFound)) { |
|
| 83 | + if ( ! $this->evm->hasListeners(Events::onClassMetadataNotFound)) { |
|
| 84 | 84 | return null; |
| 85 | 85 | } |
| 86 | 86 | |
@@ -141,20 +141,20 @@ discard block |
||
| 141 | 141 | $classMetadata->setCache(clone $parent->getCache()); |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | - if (! empty($parent->namedNativeQueries)) { |
|
| 144 | + if ( ! empty($parent->namedNativeQueries)) { |
|
| 145 | 145 | $this->addInheritedNamedNativeQueries($classMetadata, $parent); |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | - if (! empty($parent->sqlResultSetMappings)) { |
|
| 148 | + if ( ! empty($parent->sqlResultSetMappings)) { |
|
| 149 | 149 | $this->addInheritedSqlResultSetMappings($classMetadata, $parent); |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | - if (! empty($parent->entityListeners) && empty($classMetadata->entityListeners)) { |
|
| 152 | + if ( ! empty($parent->entityListeners) && empty($classMetadata->entityListeners)) { |
|
| 153 | 153 | $classMetadata->entityListeners = $parent->entityListeners; |
| 154 | 154 | } |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | - if (! $classMetadata->discriminatorMap && $classMetadata->inheritanceType !== InheritanceType::NONE && $classMetadata->isRootEntity()) { |
|
| 157 | + if ( ! $classMetadata->discriminatorMap && $classMetadata->inheritanceType !== InheritanceType::NONE && $classMetadata->isRootEntity()) { |
|
| 158 | 158 | $this->addDefaultDiscriminatorMap($classMetadata); |
| 159 | 159 | } |
| 160 | 160 | |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | |
| 175 | 175 | protected function completeRuntimeMetadata(ClassMetadata $class, ?ClassMetadata $parent = null) : void |
| 176 | 176 | { |
| 177 | - if (! $parent || ! $parent->isMappedSuperclass) { |
|
| 177 | + if ( ! $parent || ! $parent->isMappedSuperclass) { |
|
| 178 | 178 | return; |
| 179 | 179 | } |
| 180 | 180 | |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | continue; |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | - if (! ($property instanceof ToOneAssociationMetadata)) { |
|
| 195 | + if ( ! ($property instanceof ToOneAssociationMetadata)) { |
|
| 196 | 196 | continue; |
| 197 | 197 | } |
| 198 | 198 | |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | */ |
| 212 | 212 | protected function validateRuntimeMetadata(ClassMetadata $class, ?ClassMetadata $parent = null) : void |
| 213 | 213 | { |
| 214 | - if (! $class->getReflectionClass()) { |
|
| 214 | + if ( ! $class->getReflectionClass()) { |
|
| 215 | 215 | // only validate if there is a reflection class instance |
| 216 | 216 | return; |
| 217 | 217 | } |
@@ -221,13 +221,13 @@ discard block |
||
| 221 | 221 | $class->validateLifecycleCallbacks($this->getReflectionService()); |
| 222 | 222 | |
| 223 | 223 | // verify inheritance |
| 224 | - if (! $class->isMappedSuperclass && $class->inheritanceType !== InheritanceType::NONE) { |
|
| 225 | - if (! $parent) { |
|
| 226 | - if (! $class->discriminatorMap) { |
|
| 224 | + if ( ! $class->isMappedSuperclass && $class->inheritanceType !== InheritanceType::NONE) { |
|
| 225 | + if ( ! $parent) { |
|
| 226 | + if ( ! $class->discriminatorMap) { |
|
| 227 | 227 | throw MappingException::missingDiscriminatorMap($class->getClassName()); |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | - if (! $class->discriminatorColumn) { |
|
| 230 | + if ( ! $class->discriminatorColumn) { |
|
| 231 | 231 | throw MappingException::missingDiscriminatorColumn($class->getClassName()); |
| 232 | 232 | } |
| 233 | 233 | } |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | private function completeIdentifierGeneratorMappings(ClassMetadata $class) : void |
| 438 | 438 | { |
| 439 | 439 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
| 440 | - if (! $property instanceof FieldMetadata /*&& ! $property instanceof AssocationMetadata*/) { |
|
| 440 | + if ( ! $property instanceof FieldMetadata /*&& ! $property instanceof AssocationMetadata*/) { |
|
| 441 | 441 | continue; |
| 442 | 442 | } |
| 443 | 443 | |
@@ -447,7 +447,7 @@ discard block |
||
| 447 | 447 | |
| 448 | 448 | private function completeFieldIdentifierGeneratorMapping(FieldMetadata $field) |
| 449 | 449 | { |
| 450 | - if (! $field->hasValueGenerator()) { |
|
| 450 | + if ( ! $field->hasValueGenerator()) { |
|
| 451 | 451 | return; |
| 452 | 452 | } |
| 453 | 453 | |
@@ -499,10 +499,10 @@ discard block |
||
| 499 | 499 | |
| 500 | 500 | case GeneratorType::CUSTOM: |
| 501 | 501 | $definition = $generator->getDefinition(); |
| 502 | - if (! isset($definition['class'])) { |
|
| 502 | + if ( ! isset($definition['class'])) { |
|
| 503 | 503 | throw new ORMException(sprintf('Cannot instantiate custom generator, no class has been defined')); |
| 504 | 504 | } |
| 505 | - if (! class_exists($definition['class'])) { |
|
| 505 | + if ( ! class_exists($definition['class'])) { |
|
| 506 | 506 | throw new ORMException(sprintf('Cannot instantiate custom generator : %s', var_export($definition, true))); //$definition['class'])); |
| 507 | 507 | } |
| 508 | 508 | |
@@ -514,7 +514,7 @@ discard block |
||
| 514 | 514 | break; |
| 515 | 515 | |
| 516 | 516 | default: |
| 517 | - throw new ORMException('Unknown generator type: ' . $generator->getType()); |
|
| 517 | + throw new ORMException('Unknown generator type: '.$generator->getType()); |
|
| 518 | 518 | } |
| 519 | 519 | } |
| 520 | 520 | |
@@ -536,7 +536,7 @@ discard block |
||
| 536 | 536 | |
| 537 | 537 | private function getTargetPlatform() : Platforms\AbstractPlatform |
| 538 | 538 | { |
| 539 | - if (! $this->targetPlatform) { |
|
| 539 | + if ( ! $this->targetPlatform) { |
|
| 540 | 540 | $this->targetPlatform = $this->em->getConnection()->getDatabasePlatform(); |
| 541 | 541 | } |
| 542 | 542 | |
@@ -549,7 +549,7 @@ discard block |
||
| 549 | 549 | $generatedProperties = []; |
| 550 | 550 | |
| 551 | 551 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
| 552 | - if (! ($property instanceof LocalColumnMetadata && $property->hasValueGenerator())) { |
|
| 552 | + if ( ! ($property instanceof LocalColumnMetadata && $property->hasValueGenerator())) { |
|
| 553 | 553 | continue; |
| 554 | 554 | } |
| 555 | 555 | |
@@ -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 | |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | */ |
| 200 | 200 | public function newDefaultAnnotationDriver(array $paths = []) : AnnotationDriver |
| 201 | 201 | { |
| 202 | - AnnotationRegistry::registerFile(__DIR__ . '/Annotation/DoctrineAnnotations.php'); |
|
| 202 | + AnnotationRegistry::registerFile(__DIR__.'/Annotation/DoctrineAnnotations.php'); |
|
| 203 | 203 | |
| 204 | 204 | $reader = new CachedReader(new AnnotationReader(), new ArrayCache()); |
| 205 | 205 | |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | */ |
| 278 | 278 | public function getNamedQuery(string $queryName) : string |
| 279 | 279 | { |
| 280 | - if (! isset($this->namedQueries[$queryName])) { |
|
| 280 | + if ( ! isset($this->namedQueries[$queryName])) { |
|
| 281 | 281 | throw ORMException::namedQueryNotFound($queryName); |
| 282 | 282 | } |
| 283 | 283 | |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | */ |
| 302 | 302 | public function getNamedNativeQuery(string $queryName) : array |
| 303 | 303 | { |
| 304 | - if (! isset($this->namedNativeQueries[$queryName])) { |
|
| 304 | + if ( ! isset($this->namedNativeQueries[$queryName])) { |
|
| 305 | 305 | throw ORMException::namedNativeQueryNotFound($queryName); |
| 306 | 306 | } |
| 307 | 307 | |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | { |
| 320 | 320 | $queryCacheImpl = $this->getQueryCacheImpl(); |
| 321 | 321 | |
| 322 | - if (! $queryCacheImpl) { |
|
| 322 | + if ( ! $queryCacheImpl) { |
|
| 323 | 323 | throw ORMException::queryCacheNotConfigured(); |
| 324 | 324 | } |
| 325 | 325 | |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | |
| 330 | 330 | $metadataCacheImpl = $this->getMetadataCacheImpl(); |
| 331 | 331 | |
| 332 | - if (! $metadataCacheImpl) { |
|
| 332 | + if ( ! $metadataCacheImpl) { |
|
| 333 | 333 | throw ORMException::metadataCacheNotConfigured(); |
| 334 | 334 | } |
| 335 | 335 | |
@@ -537,7 +537,7 @@ discard block |
||
| 537 | 537 | { |
| 538 | 538 | $reflectionClass = new \ReflectionClass($repositoryClassName); |
| 539 | 539 | |
| 540 | - if (! $reflectionClass->implementsInterface(ObjectRepository::class)) { |
|
| 540 | + if ( ! $reflectionClass->implementsInterface(ObjectRepository::class)) { |
|
| 541 | 541 | throw ORMException::invalidEntityRepository($repositoryClassName); |
| 542 | 542 | } |
| 543 | 543 | |