@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | */ |
263 | 263 | public function __toString() |
264 | 264 | { |
265 | - return self::class . '@' . spl_object_id($this); |
|
265 | + return self::class.'@'.spl_object_id($this); |
|
266 | 266 | } |
267 | 267 | |
268 | 268 | /** |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | // Restore ReflectionClass and properties |
350 | 350 | $this->reflectionClass = $reflectionService->getClass($this->className); |
351 | 351 | |
352 | - if (! $this->reflectionClass) { |
|
352 | + if ( ! $this->reflectionClass) { |
|
353 | 353 | return; |
354 | 354 | } |
355 | 355 | |
@@ -373,11 +373,11 @@ discard block |
||
373 | 373 | } |
374 | 374 | |
375 | 375 | // Verify & complete identifier mapping |
376 | - if (! $this->identifier) { |
|
376 | + if ( ! $this->identifier) { |
|
377 | 377 | throw MappingException::identifierRequired($this->className); |
378 | 378 | } |
379 | 379 | |
380 | - $explicitlyGeneratedProperties = array_filter($this->declaredProperties, static function (Property $property) : bool { |
|
380 | + $explicitlyGeneratedProperties = array_filter($this->declaredProperties, static function(Property $property) : bool { |
|
381 | 381 | return $property instanceof FieldMetadata |
382 | 382 | && $property->isPrimaryKey() |
383 | 383 | && $property->hasValueGenerator(); |
@@ -396,14 +396,14 @@ discard block |
||
396 | 396 | public function validateAssociations() : void |
397 | 397 | { |
398 | 398 | array_map( |
399 | - function (Property $property) { |
|
400 | - if (! ($property instanceof AssociationMetadata)) { |
|
399 | + function(Property $property) { |
|
400 | + if ( ! ($property instanceof AssociationMetadata)) { |
|
401 | 401 | return; |
402 | 402 | } |
403 | 403 | |
404 | 404 | $targetEntity = $property->getTargetEntity(); |
405 | 405 | |
406 | - if (! class_exists($targetEntity)) { |
|
406 | + if ( ! class_exists($targetEntity)) { |
|
407 | 407 | throw MappingException::invalidTargetEntityClass($targetEntity, $this->className, $property->getName()); |
408 | 408 | } |
409 | 409 | }, |
@@ -421,7 +421,7 @@ discard block |
||
421 | 421 | foreach ($this->lifecycleCallbacks as $callbacks) { |
422 | 422 | /** @var array $callbacks */ |
423 | 423 | foreach ($callbacks as $callbackFuncName) { |
424 | - if (! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) { |
|
424 | + if ( ! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) { |
|
425 | 425 | throw MappingException::lifecycleCallbackMethodNotFound($this->className, $callbackFuncName); |
426 | 426 | } |
427 | 427 | } |
@@ -445,11 +445,11 @@ discard block |
||
445 | 445 | */ |
446 | 446 | public function isIdentifier(string $fieldName) : bool |
447 | 447 | { |
448 | - if (! $this->identifier) { |
|
448 | + if ( ! $this->identifier) { |
|
449 | 449 | return false; |
450 | 450 | } |
451 | 451 | |
452 | - if (! $this->isIdentifierComposite()) { |
|
452 | + if ( ! $this->isIdentifierComposite()) { |
|
453 | 453 | return $fieldName === $this->identifier[0]; |
454 | 454 | } |
455 | 455 | |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | $property->setColumnName($columnName); |
478 | 478 | } |
479 | 479 | |
480 | - if (! $this->isMappedSuperclass) { |
|
480 | + if ( ! $this->isMappedSuperclass) { |
|
481 | 481 | $property->setTableName($this->getTableName()); |
482 | 482 | } |
483 | 483 | |
@@ -497,7 +497,7 @@ discard block |
||
497 | 497 | throw MappingException::sqlConversionNotAllowedForPrimaryKeyProperties($this->className, $property); |
498 | 498 | } |
499 | 499 | |
500 | - if (! in_array($fieldName, $this->identifier, true)) { |
|
500 | + if ( ! in_array($fieldName, $this->identifier, true)) { |
|
501 | 501 | $this->identifier[] = $fieldName; |
502 | 502 | } |
503 | 503 | } |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | $fieldName = $property->getName(); |
548 | 548 | $targetEntity = $property->getTargetEntity(); |
549 | 549 | |
550 | - if (! $targetEntity) { |
|
550 | + if ( ! $targetEntity) { |
|
551 | 551 | throw MappingException::missingTargetEntity($fieldName); |
552 | 552 | } |
553 | 553 | |
@@ -560,7 +560,7 @@ discard block |
||
560 | 560 | throw MappingException::illegalOrphanRemovalOnIdentifierAssociation($this->className, $fieldName); |
561 | 561 | } |
562 | 562 | |
563 | - if (! in_array($property->getName(), $this->identifier, true)) { |
|
563 | + if ( ! in_array($property->getName(), $this->identifier, true)) { |
|
564 | 564 | if ($property instanceof ToOneAssociationMetadata && count($property->getJoinColumns()) >= 2) { |
565 | 565 | throw MappingException::cannotMapCompositePrimaryKeyEntitiesAsForeignId( |
566 | 566 | $property->getTargetEntity(), |
@@ -622,7 +622,7 @@ discard block |
||
622 | 622 | /** @var JoinColumnMetadata $joinColumn */ |
623 | 623 | if ($property instanceof OneToOneAssociationMetadata && $this->inheritanceType !== InheritanceType::SINGLE_TABLE) { |
624 | 624 | if (count($property->getJoinColumns()) === 1) { |
625 | - if (! $property->isPrimaryKey()) { |
|
625 | + if ( ! $property->isPrimaryKey()) { |
|
626 | 626 | $joinColumn->setUnique(true); |
627 | 627 | } |
628 | 628 | } else { |
@@ -630,13 +630,13 @@ discard block |
||
630 | 630 | } |
631 | 631 | } |
632 | 632 | |
633 | - $joinColumn->setTableName(! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
633 | + $joinColumn->setTableName( ! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
634 | 634 | |
635 | - if (! $joinColumn->getColumnName()) { |
|
635 | + if ( ! $joinColumn->getColumnName()) { |
|
636 | 636 | $joinColumn->setColumnName($this->namingStrategy->joinColumnName($fieldName, $this->className)); |
637 | 637 | } |
638 | 638 | |
639 | - if (! $joinColumn->getReferencedColumnName()) { |
|
639 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
640 | 640 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
641 | 641 | } |
642 | 642 | |
@@ -644,7 +644,7 @@ discard block |
||
644 | 644 | } |
645 | 645 | |
646 | 646 | if ($uniqueConstraintColumns) { |
647 | - if (! $this->table) { |
|
647 | + if ( ! $this->table) { |
|
648 | 648 | throw new RuntimeException( |
649 | 649 | 'ClassMetadata::setTable() has to be called before defining a one to one relationship.' |
650 | 650 | ); |
@@ -664,7 +664,7 @@ discard block |
||
664 | 664 | if ($property->isOrphanRemoval()) { |
665 | 665 | $cascades = $property->getCascade(); |
666 | 666 | |
667 | - if (! in_array('remove', $cascades, true)) { |
|
667 | + if ( ! in_array('remove', $cascades, true)) { |
|
668 | 668 | $cascades[] = 'remove'; |
669 | 669 | |
670 | 670 | $property->setCascade($cascades); |
@@ -727,14 +727,14 @@ discard block |
||
727 | 727 | protected function validateAndCompleteOneToManyMapping(OneToManyAssociationMetadata $property) |
728 | 728 | { |
729 | 729 | // OneToMany MUST have mappedBy |
730 | - if (! $property->getMappedBy()) { |
|
730 | + if ( ! $property->getMappedBy()) { |
|
731 | 731 | throw MappingException::oneToManyRequiresMappedBy($property->getName()); |
732 | 732 | } |
733 | 733 | |
734 | 734 | if ($property->isOrphanRemoval()) { |
735 | 735 | $cascades = $property->getCascade(); |
736 | 736 | |
737 | - if (! in_array('remove', $cascades, true)) { |
|
737 | + if ( ! in_array('remove', $cascades, true)) { |
|
738 | 738 | $cascades[] = 'remove'; |
739 | 739 | |
740 | 740 | $property->setCascade($cascades); |
@@ -757,7 +757,7 @@ discard block |
||
757 | 757 | |
758 | 758 | $property->setJoinTable($joinTable); |
759 | 759 | |
760 | - if (! $joinTable->getName()) { |
|
760 | + if ( ! $joinTable->getName()) { |
|
761 | 761 | $joinTableName = $this->namingStrategy->joinTableName( |
762 | 762 | $property->getSourceEntity(), |
763 | 763 | $property->getTargetEntity(), |
@@ -769,7 +769,7 @@ discard block |
||
769 | 769 | |
770 | 770 | $selfReferencingEntityWithoutJoinColumns = $property->getSourceEntity() === $property->getTargetEntity() && ! $joinTable->hasColumns(); |
771 | 771 | |
772 | - if (! $joinTable->getJoinColumns()) { |
|
772 | + if ( ! $joinTable->getJoinColumns()) { |
|
773 | 773 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
774 | 774 | $sourceReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'source' : $referencedColumnName; |
775 | 775 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getSourceEntity(), $sourceReferenceName); |
@@ -782,7 +782,7 @@ discard block |
||
782 | 782 | $joinTable->addJoinColumn($joinColumn); |
783 | 783 | } |
784 | 784 | |
785 | - if (! $joinTable->getInverseJoinColumns()) { |
|
785 | + if ( ! $joinTable->getInverseJoinColumns()) { |
|
786 | 786 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
787 | 787 | $targetReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'target' : $referencedColumnName; |
788 | 788 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getTargetEntity(), $targetReferenceName); |
@@ -797,13 +797,13 @@ discard block |
||
797 | 797 | |
798 | 798 | foreach ($joinTable->getJoinColumns() as $joinColumn) { |
799 | 799 | /** @var JoinColumnMetadata $joinColumn */ |
800 | - if (! $joinColumn->getReferencedColumnName()) { |
|
800 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
801 | 801 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
802 | 802 | } |
803 | 803 | |
804 | 804 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
805 | 805 | |
806 | - if (! $joinColumn->getColumnName()) { |
|
806 | + if ( ! $joinColumn->getColumnName()) { |
|
807 | 807 | $columnName = $this->namingStrategy->joinKeyColumnName( |
808 | 808 | $property->getSourceEntity(), |
809 | 809 | $referencedColumnName |
@@ -815,13 +815,13 @@ discard block |
||
815 | 815 | |
816 | 816 | foreach ($joinTable->getInverseJoinColumns() as $inverseJoinColumn) { |
817 | 817 | /** @var JoinColumnMetadata $inverseJoinColumn */ |
818 | - if (! $inverseJoinColumn->getReferencedColumnName()) { |
|
818 | + if ( ! $inverseJoinColumn->getReferencedColumnName()) { |
|
819 | 819 | $inverseJoinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
820 | 820 | } |
821 | 821 | |
822 | 822 | $referencedColumnName = $inverseJoinColumn->getReferencedColumnName(); |
823 | 823 | |
824 | - if (! $inverseJoinColumn->getColumnName()) { |
|
824 | + if ( ! $inverseJoinColumn->getColumnName()) { |
|
825 | 825 | $columnName = $this->namingStrategy->joinKeyColumnName( |
826 | 826 | $property->getTargetEntity(), |
827 | 827 | $referencedColumnName |
@@ -855,7 +855,7 @@ discard block |
||
855 | 855 | throw MappingException::singleIdNotAllowedOnCompositePrimaryKey($this->className); |
856 | 856 | } |
857 | 857 | |
858 | - if (! isset($this->identifier[0])) { |
|
858 | + if ( ! isset($this->identifier[0])) { |
|
859 | 859 | throw MappingException::noIdDefined($this->className); |
860 | 860 | } |
861 | 861 | |
@@ -914,7 +914,7 @@ discard block |
||
914 | 914 | // Association defined as Id field |
915 | 915 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
916 | 916 | |
917 | - if (! $property->isOwningSide()) { |
|
917 | + if ( ! $property->isOwningSide()) { |
|
918 | 918 | $property = $targetClass->getProperty($property->getMappedBy()); |
919 | 919 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
920 | 920 | } |
@@ -928,7 +928,7 @@ discard block |
||
928 | 928 | $columnName = $joinColumn->getColumnName(); |
929 | 929 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
930 | 930 | |
931 | - if (! $joinColumn->getType()) { |
|
931 | + if ( ! $joinColumn->getType()) { |
|
932 | 932 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $em)); |
933 | 933 | } |
934 | 934 | |
@@ -962,10 +962,10 @@ discard block |
||
962 | 962 | { |
963 | 963 | $schema = $this->getSchemaName() === null |
964 | 964 | ? '' |
965 | - : $this->getSchemaName() . '_'; |
|
965 | + : $this->getSchemaName().'_'; |
|
966 | 966 | |
967 | 967 | // replace dots with underscores because PostgreSQL creates temporary tables in a special schema |
968 | - return $schema . $this->getTableName() . '_id_tmp'; |
|
968 | + return $schema.$this->getTableName().'_id_tmp'; |
|
969 | 969 | } |
970 | 970 | |
971 | 971 | /** |
@@ -999,7 +999,7 @@ discard block |
||
999 | 999 | */ |
1000 | 1000 | public function setInheritanceType($type) : void |
1001 | 1001 | { |
1002 | - if (! $this->isInheritanceType($type)) { |
|
1002 | + if ( ! $this->isInheritanceType($type)) { |
|
1003 | 1003 | throw MappingException::invalidInheritanceType($this->className, $type); |
1004 | 1004 | } |
1005 | 1005 | |
@@ -1017,7 +1017,7 @@ discard block |
||
1017 | 1017 | { |
1018 | 1018 | $fieldName = $property->getName(); |
1019 | 1019 | |
1020 | - if (! isset($this->declaredProperties[$fieldName])) { |
|
1020 | + if ( ! isset($this->declaredProperties[$fieldName])) { |
|
1021 | 1021 | throw MappingException::invalidOverrideFieldName($this->className, $fieldName); |
1022 | 1022 | } |
1023 | 1023 | |
@@ -1214,7 +1214,7 @@ discard block |
||
1214 | 1214 | $declaringClass = $property->getDeclaringClass(); |
1215 | 1215 | |
1216 | 1216 | if ($inheritedProperty instanceof FieldMetadata) { |
1217 | - if (! $declaringClass->isMappedSuperclass) { |
|
1217 | + if ( ! $declaringClass->isMappedSuperclass) { |
|
1218 | 1218 | $inheritedProperty->setTableName($property->getTableName()); |
1219 | 1219 | } |
1220 | 1220 | |
@@ -1325,11 +1325,11 @@ discard block |
||
1325 | 1325 | 'method' => $method, |
1326 | 1326 | ]; |
1327 | 1327 | |
1328 | - if (! class_exists($class)) { |
|
1328 | + if ( ! class_exists($class)) { |
|
1329 | 1329 | throw MappingException::entityListenerClassNotFound($class, $this->className); |
1330 | 1330 | } |
1331 | 1331 | |
1332 | - if (! method_exists($class, $method)) { |
|
1332 | + if ( ! method_exists($class, $method)) { |
|
1333 | 1333 | throw MappingException::entityListenerMethodNotFound($class, $method, $this->className); |
1334 | 1334 | } |
1335 | 1335 | |
@@ -1396,7 +1396,7 @@ discard block |
||
1396 | 1396 | return; |
1397 | 1397 | } |
1398 | 1398 | |
1399 | - if (! (class_exists($className) || interface_exists($className))) { |
|
1399 | + if ( ! (class_exists($className) || interface_exists($className))) { |
|
1400 | 1400 | throw MappingException::invalidClassInDiscriminatorMap($className, $this->className); |
1401 | 1401 | } |
1402 | 1402 |
@@ -74,13 +74,13 @@ |
||
74 | 74 | |
75 | 75 | switch ($expr->getType()) { |
76 | 76 | case CompositeExpression::TYPE_AND: |
77 | - return '(' . implode(' AND ', $expressionList) . ')'; |
|
77 | + return '('.implode(' AND ', $expressionList).')'; |
|
78 | 78 | |
79 | 79 | case CompositeExpression::TYPE_OR: |
80 | - return '(' . implode(' OR ', $expressionList) . ')'; |
|
80 | + return '('.implode(' OR ', $expressionList).')'; |
|
81 | 81 | |
82 | 82 | default: |
83 | - throw new RuntimeException('Unknown composite ' . $expr->getType()); |
|
83 | + throw new RuntimeException('Unknown composite '.$expr->getType()); |
|
84 | 84 | } |
85 | 85 | } |
86 | 86 |
@@ -162,7 +162,7 @@ |
||
162 | 162 | |
163 | 163 | // Recognize identifiers, aliased or qualified names |
164 | 164 | case ctype_alpha($value[0]) || $value[0] === '_' || $value[0] === '\\': |
165 | - $name = 'Doctrine\ORM\Query\Lexer::T_' . strtoupper($value); |
|
165 | + $name = 'Doctrine\ORM\Query\Lexer::T_'.strtoupper($value); |
|
166 | 166 | |
167 | 167 | if (defined($name)) { |
168 | 168 | $type = constant($name); |
@@ -63,12 +63,12 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function add($arg) |
65 | 65 | { |
66 | - if ($arg !== null && (! $arg instanceof self || $arg->count() > 0)) { |
|
66 | + if ($arg !== null && ( ! $arg instanceof self || $arg->count() > 0)) { |
|
67 | 67 | // If we decide to keep Expr\Base instances, we can use this check |
68 | - if (! is_string($arg)) { |
|
68 | + if ( ! is_string($arg)) { |
|
69 | 69 | $class = get_class($arg); |
70 | 70 | |
71 | - if (! in_array($class, $this->allowedClasses, true)) { |
|
71 | + if ( ! in_array($class, $this->allowedClasses, true)) { |
|
72 | 72 | throw new InvalidArgumentException( |
73 | 73 | sprintf("Expression of type '%s' not allowed in this context.", $class) |
74 | 74 | ); |
@@ -98,6 +98,6 @@ discard block |
||
98 | 98 | return (string) $this->parts[0]; |
99 | 99 | } |
100 | 100 | |
101 | - return $this->preSeparator . implode($this->separator, $this->parts) . $this->postSeparator; |
|
101 | + return $this->preSeparator.implode($this->separator, $this->parts).$this->postSeparator; |
|
102 | 102 | } |
103 | 103 | } |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | } |
398 | 398 | |
399 | 399 | foreach ($this->queryComponents as $dqlAlias => $qComp) { |
400 | - if (! isset($this->identVariableExpressions[$dqlAlias])) { |
|
400 | + if ( ! isset($this->identVariableExpressions[$dqlAlias])) { |
|
401 | 401 | continue; |
402 | 402 | } |
403 | 403 | |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | $tokenStr = substr($dql, (int) $token['position'], $length); |
462 | 462 | |
463 | 463 | // Building informative message |
464 | - $message = 'line 0, col ' . $tokenPos . " near '" . $tokenStr . "': Error: " . $message; |
|
464 | + $message = 'line 0, col '.$tokenPos." near '".$tokenStr."': Error: ".$message; |
|
465 | 465 | |
466 | 466 | throw QueryException::semanticalError( |
467 | 467 | $message, |
@@ -564,7 +564,7 @@ discard block |
||
564 | 564 | $identVariable = $deferredItem['expression']; |
565 | 565 | |
566 | 566 | // Check if IdentificationVariable exists in queryComponents |
567 | - if (! isset($this->queryComponents[$identVariable])) { |
|
567 | + if ( ! isset($this->queryComponents[$identVariable])) { |
|
568 | 568 | $this->semanticalError( |
569 | 569 | sprintf("'%s' is not defined.", $identVariable), |
570 | 570 | $deferredItem['token'] |
@@ -574,7 +574,7 @@ discard block |
||
574 | 574 | $qComp = $this->queryComponents[$identVariable]; |
575 | 575 | |
576 | 576 | // Check if queryComponent points to an AbstractSchemaName or a ResultVariable |
577 | - if (! isset($qComp['metadata'])) { |
|
577 | + if ( ! isset($qComp['metadata'])) { |
|
578 | 578 | $this->semanticalError( |
579 | 579 | sprintf("'%s' does not point to a Class.", $identVariable), |
580 | 580 | $deferredItem['token'] |
@@ -608,7 +608,7 @@ discard block |
||
608 | 608 | // If the namespace is not given then assumes the first FROM entity namespace |
609 | 609 | if (strpos($className, '\\') === false && ! class_exists($className) && strpos($fromClassName, '\\') !== false) { |
610 | 610 | $namespace = substr($fromClassName, 0, strrpos($fromClassName, '\\')); |
611 | - $fqcn = $namespace . '\\' . $className; |
|
611 | + $fqcn = $namespace.'\\'.$className; |
|
612 | 612 | |
613 | 613 | if (class_exists($fqcn)) { |
614 | 614 | $expression->className = $fqcn; |
@@ -616,13 +616,13 @@ discard block |
||
616 | 616 | } |
617 | 617 | } |
618 | 618 | |
619 | - if (! class_exists($className)) { |
|
619 | + if ( ! class_exists($className)) { |
|
620 | 620 | $this->semanticalError(sprintf('Class "%s" is not defined.', $className), $token); |
621 | 621 | } |
622 | 622 | |
623 | 623 | $class = new ReflectionClass($className); |
624 | 624 | |
625 | - if (! $class->isInstantiable()) { |
|
625 | + if ( ! $class->isInstantiable()) { |
|
626 | 626 | $this->semanticalError(sprintf('Class "%s" can not be instantiated.', $className), $token); |
627 | 627 | } |
628 | 628 | |
@@ -679,7 +679,7 @@ discard block |
||
679 | 679 | $resultVariable = $deferredItem['expression']; |
680 | 680 | |
681 | 681 | // Check if ResultVariable exists in queryComponents |
682 | - if (! isset($this->queryComponents[$resultVariable])) { |
|
682 | + if ( ! isset($this->queryComponents[$resultVariable])) { |
|
683 | 683 | $this->semanticalError( |
684 | 684 | sprintf("'%s' is not defined.", $resultVariable), |
685 | 685 | $deferredItem['token'] |
@@ -689,7 +689,7 @@ discard block |
||
689 | 689 | $qComp = $this->queryComponents[$resultVariable]; |
690 | 690 | |
691 | 691 | // Check if queryComponent points to an AbstractSchemaName or a ResultVariable |
692 | - if (! isset($qComp['resultVariable'])) { |
|
692 | + if ( ! isset($qComp['resultVariable'])) { |
|
693 | 693 | $this->semanticalError( |
694 | 694 | sprintf("'%s' does not point to a ResultVariable.", $resultVariable), |
695 | 695 | $deferredItem['token'] |
@@ -731,9 +731,9 @@ discard block |
||
731 | 731 | $property = $class->getProperty($field); |
732 | 732 | |
733 | 733 | // Check if field or association exists |
734 | - if (! $property) { |
|
734 | + if ( ! $property) { |
|
735 | 735 | $this->semanticalError( |
736 | - 'Class ' . $class->getClassName() . ' has no field or association named ' . $field, |
|
736 | + 'Class '.$class->getClassName().' has no field or association named '.$field, |
|
737 | 737 | $deferredItem['token'] |
738 | 738 | ); |
739 | 739 | } |
@@ -749,7 +749,7 @@ discard block |
||
749 | 749 | // Validate if PathExpression is one of the expected types |
750 | 750 | $expectedType = $pathExpression->expectedType; |
751 | 751 | |
752 | - if (! ($expectedType & $fieldType)) { |
|
752 | + if ( ! ($expectedType & $fieldType)) { |
|
753 | 753 | // We need to recognize which was expected type(s) |
754 | 754 | $expectedStringTypes = []; |
755 | 755 | |
@@ -771,8 +771,8 @@ discard block |
||
771 | 771 | // Build the error message |
772 | 772 | $semanticalError = 'Invalid PathExpression. '; |
773 | 773 | $semanticalError .= count($expectedStringTypes) === 1 |
774 | - ? 'Must be a ' . $expectedStringTypes[0] . '.' |
|
775 | - : implode(' or ', $expectedStringTypes) . ' expected.'; |
|
774 | + ? 'Must be a '.$expectedStringTypes[0].'.' |
|
775 | + : implode(' or ', $expectedStringTypes).' expected.'; |
|
776 | 776 | |
777 | 777 | $this->semanticalError($semanticalError, $deferredItem['token']); |
778 | 778 | } |
@@ -784,7 +784,7 @@ discard block |
||
784 | 784 | |
785 | 785 | private function processRootEntityAliasSelected() |
786 | 786 | { |
787 | - if (! $this->identVariableExpressions) { |
|
787 | + if ( ! $this->identVariableExpressions) { |
|
788 | 788 | return; |
789 | 789 | } |
790 | 790 | |
@@ -941,7 +941,7 @@ discard block |
||
941 | 941 | |
942 | 942 | [$namespaceAlias, $simpleClassName] = explode(':', $this->lexer->token['value']); |
943 | 943 | |
944 | - return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName; |
|
944 | + return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias).'\\'.$simpleClassName; |
|
945 | 945 | } |
946 | 946 | |
947 | 947 | /** |
@@ -1020,9 +1020,9 @@ discard block |
||
1020 | 1020 | { |
1021 | 1021 | $identVariable = $this->IdentificationVariable(); |
1022 | 1022 | |
1023 | - if (! isset($this->queryComponents[$identVariable])) { |
|
1023 | + if ( ! isset($this->queryComponents[$identVariable])) { |
|
1024 | 1024 | $this->semanticalError( |
1025 | - 'Identification Variable ' . $identVariable . ' used in join path expression but was not defined before.' |
|
1025 | + 'Identification Variable '.$identVariable.' used in join path expression but was not defined before.' |
|
1026 | 1026 | ); |
1027 | 1027 | } |
1028 | 1028 | |
@@ -1036,8 +1036,8 @@ discard block |
||
1036 | 1036 | $class = $qComp['metadata']; |
1037 | 1037 | $property = $class->getProperty($field); |
1038 | 1038 | |
1039 | - if (! ($property !== null && $property instanceof AssociationMetadata)) { |
|
1040 | - $this->semanticalError('Class ' . $class->getClassName() . ' has no association named ' . $field); |
|
1039 | + if ( ! ($property !== null && $property instanceof AssociationMetadata)) { |
|
1040 | + $this->semanticalError('Class '.$class->getClassName().' has no association named '.$field); |
|
1041 | 1041 | } |
1042 | 1042 | |
1043 | 1043 | return new AST\JoinAssociationPathExpression($identVariable, $field); |
@@ -1067,7 +1067,7 @@ discard block |
||
1067 | 1067 | while ($this->lexer->isNextToken(Lexer::T_DOT)) { |
1068 | 1068 | $this->match(Lexer::T_DOT); |
1069 | 1069 | $this->match(Lexer::T_IDENTIFIER); |
1070 | - $field .= '.' . $this->lexer->token['value']; |
|
1070 | + $field .= '.'.$this->lexer->token['value']; |
|
1071 | 1071 | } |
1072 | 1072 | } |
1073 | 1073 | |
@@ -1449,7 +1449,7 @@ discard block |
||
1449 | 1449 | // Still need to decide between IdentificationVariable or ResultVariable |
1450 | 1450 | $lookaheadValue = $this->lexer->lookahead['value']; |
1451 | 1451 | |
1452 | - if (! isset($this->queryComponents[$lookaheadValue])) { |
|
1452 | + if ( ! isset($this->queryComponents[$lookaheadValue])) { |
|
1453 | 1453 | $this->semanticalError('Cannot group by undefined identification or result variable.'); |
1454 | 1454 | } |
1455 | 1455 | |
@@ -1797,7 +1797,7 @@ discard block |
||
1797 | 1797 | while ($this->lexer->isNextToken(Lexer::T_DOT)) { |
1798 | 1798 | $this->match(Lexer::T_DOT); |
1799 | 1799 | $this->match(Lexer::T_IDENTIFIER); |
1800 | - $field .= '.' . $this->lexer->token['value']; |
|
1800 | + $field .= '.'.$this->lexer->token['value']; |
|
1801 | 1801 | } |
1802 | 1802 | |
1803 | 1803 | $partialFieldSet[] = $field; |
@@ -1811,7 +1811,7 @@ discard block |
||
1811 | 1811 | while ($this->lexer->isNextToken(Lexer::T_DOT)) { |
1812 | 1812 | $this->match(Lexer::T_DOT); |
1813 | 1813 | $this->match(Lexer::T_IDENTIFIER); |
1814 | - $field .= '.' . $this->lexer->token['value']; |
|
1814 | + $field .= '.'.$this->lexer->token['value']; |
|
1815 | 1815 | } |
1816 | 1816 | |
1817 | 1817 | $partialFieldSet[] = $field; |
@@ -2432,7 +2432,7 @@ discard block |
||
2432 | 2432 | |
2433 | 2433 | // Phase 1 AST optimization: Prevent AST\ConditionalFactor |
2434 | 2434 | // if only one AST\ConditionalPrimary is defined |
2435 | - if (! $not) { |
|
2435 | + if ( ! $not) { |
|
2436 | 2436 | return $conditionalPrimary; |
2437 | 2437 | } |
2438 | 2438 | |
@@ -2451,7 +2451,7 @@ discard block |
||
2451 | 2451 | { |
2452 | 2452 | $condPrimary = new AST\ConditionalPrimary(); |
2453 | 2453 | |
2454 | - if (! $this->lexer->isNextToken(Lexer::T_OPEN_PARENTHESIS)) { |
|
2454 | + if ( ! $this->lexer->isNextToken(Lexer::T_OPEN_PARENTHESIS)) { |
|
2455 | 2455 | $condPrimary->simpleConditionalExpression = $this->SimpleConditionalExpression(); |
2456 | 2456 | |
2457 | 2457 | return $condPrimary; |
@@ -2619,7 +2619,7 @@ discard block |
||
2619 | 2619 | $this->match(Lexer::T_OF); |
2620 | 2620 | } |
2621 | 2621 | |
2622 | - $collMemberExpr = new AST\CollectionMemberExpression( |
|
2622 | + $collMemberExpr = new AST\CollectionMemberExpression( |
|
2623 | 2623 | $entityExpr, |
2624 | 2624 | $this->CollectionValuedPathExpression() |
2625 | 2625 | ); |
@@ -2958,7 +2958,7 @@ discard block |
||
2958 | 2958 | $lookaheadType = $this->lexer->lookahead['type']; |
2959 | 2959 | $isDistinct = false; |
2960 | 2960 | |
2961 | - if (! in_array($lookaheadType, [Lexer::T_COUNT, Lexer::T_AVG, Lexer::T_MAX, Lexer::T_MIN, Lexer::T_SUM], true)) { |
|
2961 | + if ( ! in_array($lookaheadType, [Lexer::T_COUNT, Lexer::T_AVG, Lexer::T_MAX, Lexer::T_MIN, Lexer::T_SUM], true)) { |
|
2962 | 2962 | $this->syntaxError('One of: MAX, MIN, AVG, SUM, COUNT'); |
2963 | 2963 | } |
2964 | 2964 | |
@@ -2988,7 +2988,7 @@ discard block |
||
2988 | 2988 | $lookaheadType = $this->lexer->lookahead['type']; |
2989 | 2989 | $value = $this->lexer->lookahead['value']; |
2990 | 2990 | |
2991 | - if (! in_array($lookaheadType, [Lexer::T_ALL, Lexer::T_ANY, Lexer::T_SOME], true)) { |
|
2991 | + if ( ! in_array($lookaheadType, [Lexer::T_ALL, Lexer::T_ANY, Lexer::T_SOME], true)) { |
|
2992 | 2992 | $this->syntaxError('ALL, ANY or SOME'); |
2993 | 2993 | } |
2994 | 2994 | |
@@ -3226,7 +3226,7 @@ discard block |
||
3226 | 3226 | $lookaheadValue = $this->lexer->lookahead['value']; |
3227 | 3227 | |
3228 | 3228 | // Validate existing component |
3229 | - if (! isset($this->queryComponents[$lookaheadValue])) { |
|
3229 | + if ( ! isset($this->queryComponents[$lookaheadValue])) { |
|
3230 | 3230 | $this->semanticalError('Cannot add having condition on undefined result variable.'); |
3231 | 3231 | } |
3232 | 3232 | |
@@ -3237,7 +3237,7 @@ discard block |
||
3237 | 3237 | } |
3238 | 3238 | |
3239 | 3239 | // Validating ResultVariable |
3240 | - if (! isset($this->queryComponents[$lookaheadValue]['resultVariable'])) { |
|
3240 | + if ( ! isset($this->queryComponents[$lookaheadValue]['resultVariable'])) { |
|
3241 | 3241 | $this->semanticalError('Cannot add having condition on a non result variable.'); |
3242 | 3242 | } |
3243 | 3243 |
@@ -81,11 +81,11 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function enable($name) |
83 | 83 | { |
84 | - if (! $this->has($name)) { |
|
85 | - throw new InvalidArgumentException("Filter '" . $name . "' does not exist."); |
|
84 | + if ( ! $this->has($name)) { |
|
85 | + throw new InvalidArgumentException("Filter '".$name."' does not exist."); |
|
86 | 86 | } |
87 | 87 | |
88 | - if (! $this->isEnabled($name)) { |
|
88 | + if ( ! $this->isEnabled($name)) { |
|
89 | 89 | $filterClass = $this->config->getFilterClassName($name); |
90 | 90 | |
91 | 91 | $this->enabledFilters[$name] = new $filterClass($this->em); |
@@ -133,8 +133,8 @@ discard block |
||
133 | 133 | */ |
134 | 134 | public function getFilter($name) |
135 | 135 | { |
136 | - if (! $this->isEnabled($name)) { |
|
137 | - throw new InvalidArgumentException("Filter '" . $name . "' is not enabled."); |
|
136 | + if ( ! $this->isEnabled($name)) { |
|
137 | + throw new InvalidArgumentException("Filter '".$name."' is not enabled."); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | return $this->enabledFilters[$name]; |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | $filterHash = ''; |
188 | 188 | |
189 | 189 | foreach ($this->enabledFilters as $name => $filter) { |
190 | - $filterHash .= $name . $filter; |
|
190 | + $filterHash .= $name.$filter; |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | return $filterHash; |
@@ -83,8 +83,8 @@ |
||
83 | 83 | */ |
84 | 84 | final public function getParameter($name) |
85 | 85 | { |
86 | - if (! isset($this->parameters[$name])) { |
|
87 | - throw new InvalidArgumentException("Parameter '" . $name . "' does not exist."); |
|
86 | + if ( ! isset($this->parameters[$name])) { |
|
87 | + throw new InvalidArgumentException("Parameter '".$name."' does not exist."); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | return $this->em->getConnection()->quote($this->parameters[$name]['value'], $this->parameters[$name]['type']); |
@@ -57,8 +57,8 @@ discard block |
||
57 | 57 | // 1. Create an INSERT INTO temptable ... SELECT identifiers WHERE $AST->getWhereClause() |
58 | 58 | $sqlWalker->setSQLTableAlias($primaryClass->getTableName(), 'i0', $primaryDqlAlias); |
59 | 59 | |
60 | - $this->insertSql = 'INSERT INTO ' . $tempTable . ' (' . $idColumnNameList . ')' |
|
61 | - . ' SELECT i0.' . implode(', i0.', array_keys($idColumns)); |
|
60 | + $this->insertSql = 'INSERT INTO '.$tempTable.' ('.$idColumnNameList.')' |
|
61 | + . ' SELECT i0.'.implode(', i0.', array_keys($idColumns)); |
|
62 | 62 | |
63 | 63 | $rangeDecl = new AST\RangeVariableDeclaration($primaryClass->getClassName(), $primaryDqlAlias); |
64 | 64 | $fromClause = new AST\FromClause([new AST\IdentificationVariableDeclaration($rangeDecl, null, [])]); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | // 3. Create and store DELETE statements |
81 | 81 | $hierarchyClasses = array_merge( |
82 | 82 | array_map( |
83 | - static function ($className) use ($em) { |
|
83 | + static function($className) use ($em) { |
|
84 | 84 | return $em->getClassMetadata($className); |
85 | 85 | }, |
86 | 86 | array_reverse($primaryClass->getSubClasses()) |
@@ -103,8 +103,8 @@ discard block |
||
103 | 103 | ]; |
104 | 104 | } |
105 | 105 | |
106 | - $this->createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable . ' (' |
|
107 | - . $platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; |
|
106 | + $this->createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable.' (' |
|
107 | + . $platform->getColumnDeclarationListSQL($columnDefinitions).')'; |
|
108 | 108 | |
109 | 109 | $this->dropTempTableSql = $platform->getDropTemporaryTableSQL($tempTable); |
110 | 110 | } |
@@ -67,8 +67,8 @@ discard block |
||
67 | 67 | // 1. Create an INSERT INTO temptable ... SELECT identifiers WHERE $AST->getWhereClause() |
68 | 68 | $sqlWalker->setSQLTableAlias($primaryClass->getTableName(), 'i0', $updateClause->aliasIdentificationVariable); |
69 | 69 | |
70 | - $this->insertSql = 'INSERT INTO ' . $tempTable . ' (' . $idColumnNameList . ')' |
|
71 | - . ' SELECT i0.' . implode(', i0.', array_keys($idColumns)); |
|
70 | + $this->insertSql = 'INSERT INTO '.$tempTable.' ('.$idColumnNameList.')' |
|
71 | + . ' SELECT i0.'.implode(', i0.', array_keys($idColumns)); |
|
72 | 72 | |
73 | 73 | $rangeDecl = new AST\RangeVariableDeclaration($primaryClass->getClassName(), $updateClause->aliasIdentificationVariable); |
74 | 74 | $fromClause = new AST\FromClause([new AST\IdentificationVariableDeclaration($rangeDecl, null, [])]); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | // 3. Create and store UPDATE statements |
87 | 87 | $hierarchyClasses = array_merge( |
88 | 88 | array_map( |
89 | - static function ($className) use ($em) { |
|
89 | + static function($className) use ($em) { |
|
90 | 90 | return $em->getClassMetadata($className); |
91 | 91 | }, |
92 | 92 | array_reverse($primaryClass->getSubClasses()) |
@@ -142,8 +142,8 @@ discard block |
||
142 | 142 | ]; |
143 | 143 | } |
144 | 144 | |
145 | - $this->createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable . ' (' |
|
146 | - . $platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; |
|
145 | + $this->createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable.' (' |
|
146 | + . $platform->getColumnDeclarationListSQL($columnDefinitions).')'; |
|
147 | 147 | |
148 | 148 | $this->dropTempTableSql = $platform->getDropTemporaryTableSQL($tempTable); |
149 | 149 | } |