@@ -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 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | // If $value is not a Collection then use an ArrayCollection. |
64 | - if (! $collection instanceof Collection) { |
|
64 | + if ( ! $collection instanceof Collection) { |
|
65 | 65 | // @todo guilhermeblanco Conceptually, support to custom collections by replacing ArrayCollection creation. |
66 | 66 | $collection = new ArrayCollection((array) $collection); |
67 | 67 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $collection = new PersistentCollection($entityManager, $targetClass, $collection); |
72 | 72 | |
73 | 73 | $collection->setOwner($owner, $this); |
74 | - $collection->setDirty(! $collection->isEmpty()); |
|
74 | + $collection->setDirty( ! $collection->isEmpty()); |
|
75 | 75 | $collection->setInitialized(true); |
76 | 76 | |
77 | 77 | return $collection; |
@@ -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 | |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | */ |
288 | 288 | public function __toString() |
289 | 289 | { |
290 | - return __CLASS__ . '@' . spl_object_id($this); |
|
290 | + return __CLASS__.'@'.spl_object_id($this); |
|
291 | 291 | } |
292 | 292 | |
293 | 293 | /** |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | // Restore ReflectionClass and properties |
387 | 387 | $this->reflectionClass = $reflectionService->getClass($this->className); |
388 | 388 | |
389 | - if (! $this->reflectionClass) { |
|
389 | + if ( ! $this->reflectionClass) { |
|
390 | 390 | return; |
391 | 391 | } |
392 | 392 | |
@@ -410,11 +410,11 @@ discard block |
||
410 | 410 | } |
411 | 411 | |
412 | 412 | // Verify & complete identifier mapping |
413 | - if (! $this->identifier) { |
|
413 | + if ( ! $this->identifier) { |
|
414 | 414 | throw MappingException::identifierRequired($this->className); |
415 | 415 | } |
416 | 416 | |
417 | - $explicitlyGeneratedProperties = array_filter($this->declaredProperties, function (Property $property) : bool { |
|
417 | + $explicitlyGeneratedProperties = array_filter($this->declaredProperties, function(Property $property) : bool { |
|
418 | 418 | return $property instanceof FieldMetadata |
419 | 419 | && $property->isPrimaryKey() |
420 | 420 | && $property->hasValueGenerator(); |
@@ -433,14 +433,14 @@ discard block |
||
433 | 433 | public function validateAssociations() : void |
434 | 434 | { |
435 | 435 | array_map( |
436 | - function (Property $property) { |
|
437 | - if (! ($property instanceof AssociationMetadata)) { |
|
436 | + function(Property $property) { |
|
437 | + if ( ! ($property instanceof AssociationMetadata)) { |
|
438 | 438 | return; |
439 | 439 | } |
440 | 440 | |
441 | 441 | $targetEntity = $property->getTargetEntity(); |
442 | 442 | |
443 | - if (! class_exists($targetEntity)) { |
|
443 | + if ( ! class_exists($targetEntity)) { |
|
444 | 444 | throw MappingException::invalidTargetEntityClass($targetEntity, $this->className, $property->getName()); |
445 | 445 | } |
446 | 446 | }, |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | foreach ($this->lifecycleCallbacks as $callbacks) { |
459 | 459 | /** @var array $callbacks */ |
460 | 460 | foreach ($callbacks as $callbackFuncName) { |
461 | - if (! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) { |
|
461 | + if ( ! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) { |
|
462 | 462 | throw MappingException::lifecycleCallbackMethodNotFound($this->className, $callbackFuncName); |
463 | 463 | } |
464 | 464 | } |
@@ -482,11 +482,11 @@ discard block |
||
482 | 482 | */ |
483 | 483 | public function isIdentifier(string $fieldName) : bool |
484 | 484 | { |
485 | - if (! $this->identifier) { |
|
485 | + if ( ! $this->identifier) { |
|
486 | 486 | return false; |
487 | 487 | } |
488 | 488 | |
489 | - if (! $this->isIdentifierComposite()) { |
|
489 | + if ( ! $this->isIdentifierComposite()) { |
|
490 | 490 | return $fieldName === $this->identifier[0]; |
491 | 491 | } |
492 | 492 | |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | */ |
510 | 510 | public function getNamedQuery($queryName) : string |
511 | 511 | { |
512 | - if (! isset($this->namedQueries[$queryName])) { |
|
512 | + if ( ! isset($this->namedQueries[$queryName])) { |
|
513 | 513 | throw MappingException::queryNotFound($this->className, $queryName); |
514 | 514 | } |
515 | 515 | |
@@ -539,7 +539,7 @@ discard block |
||
539 | 539 | */ |
540 | 540 | public function getNamedNativeQuery($queryName) : array |
541 | 541 | { |
542 | - if (! isset($this->namedNativeQueries[$queryName])) { |
|
542 | + if ( ! isset($this->namedNativeQueries[$queryName])) { |
|
543 | 543 | throw MappingException::queryNotFound($this->className, $queryName); |
544 | 544 | } |
545 | 545 | |
@@ -569,7 +569,7 @@ discard block |
||
569 | 569 | */ |
570 | 570 | public function getSqlResultSetMapping($name) |
571 | 571 | { |
572 | - if (! isset($this->sqlResultSetMappings[$name])) { |
|
572 | + if ( ! isset($this->sqlResultSetMappings[$name])) { |
|
573 | 573 | throw MappingException::resultMappingNotFound($this->className, $name); |
574 | 574 | } |
575 | 575 | |
@@ -602,7 +602,7 @@ discard block |
||
602 | 602 | $property->setColumnName($columnName); |
603 | 603 | } |
604 | 604 | |
605 | - if (! $this->isMappedSuperclass) { |
|
605 | + if ( ! $this->isMappedSuperclass) { |
|
606 | 606 | $property->setTableName($this->getTableName()); |
607 | 607 | } |
608 | 608 | |
@@ -622,7 +622,7 @@ discard block |
||
622 | 622 | throw MappingException::sqlConversionNotAllowedForPrimaryKeyProperties($property); |
623 | 623 | } |
624 | 624 | |
625 | - if (! in_array($fieldName, $this->identifier)) { |
|
625 | + if ( ! in_array($fieldName, $this->identifier)) { |
|
626 | 626 | $this->identifier[] = $fieldName; |
627 | 627 | } |
628 | 628 | } |
@@ -672,7 +672,7 @@ discard block |
||
672 | 672 | $fieldName = $property->getName(); |
673 | 673 | $targetEntity = $property->getTargetEntity(); |
674 | 674 | |
675 | - if (! $targetEntity) { |
|
675 | + if ( ! $targetEntity) { |
|
676 | 676 | throw MappingException::missingTargetEntity($fieldName); |
677 | 677 | } |
678 | 678 | |
@@ -686,7 +686,7 @@ discard block |
||
686 | 686 | throw MappingException::illegalOrphanRemovalOnIdentifierAssociation($this->className, $fieldName); |
687 | 687 | } |
688 | 688 | |
689 | - if (! in_array($property->getName(), $this->identifier)) { |
|
689 | + if ( ! in_array($property->getName(), $this->identifier)) { |
|
690 | 690 | if ($property instanceof ToOneAssociationMetadata && count($property->getJoinColumns()) >= 2) { |
691 | 691 | throw MappingException::cannotMapCompositePrimaryKeyEntitiesAsForeignId( |
692 | 692 | $property->getTargetEntity(), |
@@ -752,7 +752,7 @@ discard block |
||
752 | 752 | /** @var JoinColumnMetadata $joinColumn */ |
753 | 753 | if ($property instanceof OneToOneAssociationMetadata && $this->inheritanceType !== InheritanceType::SINGLE_TABLE) { |
754 | 754 | if (count($property->getJoinColumns()) === 1) { |
755 | - if (! $property->isPrimaryKey()) { |
|
755 | + if ( ! $property->isPrimaryKey()) { |
|
756 | 756 | $joinColumn->setUnique(true); |
757 | 757 | } |
758 | 758 | } else { |
@@ -760,13 +760,13 @@ discard block |
||
760 | 760 | } |
761 | 761 | } |
762 | 762 | |
763 | - $joinColumn->setTableName(! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
763 | + $joinColumn->setTableName( ! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
764 | 764 | |
765 | - if (! $joinColumn->getColumnName()) { |
|
765 | + if ( ! $joinColumn->getColumnName()) { |
|
766 | 766 | $joinColumn->setColumnName($this->namingStrategy->joinColumnName($fieldName, $this->className)); |
767 | 767 | } |
768 | 768 | |
769 | - if (! $joinColumn->getReferencedColumnName()) { |
|
769 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
770 | 770 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
771 | 771 | } |
772 | 772 | |
@@ -774,7 +774,7 @@ discard block |
||
774 | 774 | } |
775 | 775 | |
776 | 776 | if ($uniqueConstraintColumns) { |
777 | - if (! $this->table) { |
|
777 | + if ( ! $this->table) { |
|
778 | 778 | throw new \RuntimeException( |
779 | 779 | 'ClassMetadata::setTable() has to be called before defining a one to one relationship.' |
780 | 780 | ); |
@@ -794,7 +794,7 @@ discard block |
||
794 | 794 | if ($property->isOrphanRemoval()) { |
795 | 795 | $cascades = $property->getCascade(); |
796 | 796 | |
797 | - if (! in_array('remove', $cascades)) { |
|
797 | + if ( ! in_array('remove', $cascades)) { |
|
798 | 798 | $cascades[] = 'remove'; |
799 | 799 | |
800 | 800 | $property->setCascade($cascades); |
@@ -860,14 +860,14 @@ discard block |
||
860 | 860 | $property->setOwningSide(false); |
861 | 861 | |
862 | 862 | // OneToMany MUST have mappedBy |
863 | - if (! $property->getMappedBy()) { |
|
863 | + if ( ! $property->getMappedBy()) { |
|
864 | 864 | throw MappingException::oneToManyRequiresMappedBy($property->getName()); |
865 | 865 | } |
866 | 866 | |
867 | 867 | if ($property->isOrphanRemoval()) { |
868 | 868 | $cascades = $property->getCascade(); |
869 | 869 | |
870 | - if (! in_array('remove', $cascades)) { |
|
870 | + if ( ! in_array('remove', $cascades)) { |
|
871 | 871 | $cascades[] = 'remove'; |
872 | 872 | |
873 | 873 | $property->setCascade($cascades); |
@@ -890,7 +890,7 @@ discard block |
||
890 | 890 | |
891 | 891 | $property->setJoinTable($joinTable); |
892 | 892 | |
893 | - if (! $joinTable->getName()) { |
|
893 | + if ( ! $joinTable->getName()) { |
|
894 | 894 | $joinTableName = $this->namingStrategy->joinTableName( |
895 | 895 | $property->getSourceEntity(), |
896 | 896 | $property->getTargetEntity(), |
@@ -902,7 +902,7 @@ discard block |
||
902 | 902 | |
903 | 903 | $selfReferencingEntityWithoutJoinColumns = $property->getSourceEntity() === $property->getTargetEntity() && ! $joinTable->hasColumns(); |
904 | 904 | |
905 | - if (! $joinTable->getJoinColumns()) { |
|
905 | + if ( ! $joinTable->getJoinColumns()) { |
|
906 | 906 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
907 | 907 | $sourceReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'source' : $referencedColumnName; |
908 | 908 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getSourceEntity(), $sourceReferenceName); |
@@ -915,7 +915,7 @@ discard block |
||
915 | 915 | $joinTable->addJoinColumn($joinColumn); |
916 | 916 | } |
917 | 917 | |
918 | - if (! $joinTable->getInverseJoinColumns()) { |
|
918 | + if ( ! $joinTable->getInverseJoinColumns()) { |
|
919 | 919 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
920 | 920 | $targetReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'target' : $referencedColumnName; |
921 | 921 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getTargetEntity(), $targetReferenceName); |
@@ -930,13 +930,13 @@ discard block |
||
930 | 930 | |
931 | 931 | foreach ($joinTable->getJoinColumns() as $joinColumn) { |
932 | 932 | /** @var JoinColumnMetadata $joinColumn */ |
933 | - if (! $joinColumn->getReferencedColumnName()) { |
|
933 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
934 | 934 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
935 | 935 | } |
936 | 936 | |
937 | 937 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
938 | 938 | |
939 | - if (! $joinColumn->getColumnName()) { |
|
939 | + if ( ! $joinColumn->getColumnName()) { |
|
940 | 940 | $columnName = $this->namingStrategy->joinKeyColumnName( |
941 | 941 | $property->getSourceEntity(), |
942 | 942 | $referencedColumnName |
@@ -948,13 +948,13 @@ discard block |
||
948 | 948 | |
949 | 949 | foreach ($joinTable->getInverseJoinColumns() as $inverseJoinColumn) { |
950 | 950 | /** @var JoinColumnMetadata $inverseJoinColumn */ |
951 | - if (! $inverseJoinColumn->getReferencedColumnName()) { |
|
951 | + if ( ! $inverseJoinColumn->getReferencedColumnName()) { |
|
952 | 952 | $inverseJoinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
953 | 953 | } |
954 | 954 | |
955 | 955 | $referencedColumnName = $inverseJoinColumn->getReferencedColumnName(); |
956 | 956 | |
957 | - if (! $inverseJoinColumn->getColumnName()) { |
|
957 | + if ( ! $inverseJoinColumn->getColumnName()) { |
|
958 | 958 | $columnName = $this->namingStrategy->joinKeyColumnName( |
959 | 959 | $property->getTargetEntity(), |
960 | 960 | $referencedColumnName |
@@ -988,7 +988,7 @@ discard block |
||
988 | 988 | throw MappingException::singleIdNotAllowedOnCompositePrimaryKey($this->className); |
989 | 989 | } |
990 | 990 | |
991 | - if (! isset($this->identifier[0])) { |
|
991 | + if ( ! isset($this->identifier[0])) { |
|
992 | 992 | throw MappingException::noIdDefined($this->className); |
993 | 993 | } |
994 | 994 | |
@@ -1047,7 +1047,7 @@ discard block |
||
1047 | 1047 | // Association defined as Id field |
1048 | 1048 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
1049 | 1049 | |
1050 | - if (! $property->isOwningSide()) { |
|
1050 | + if ( ! $property->isOwningSide()) { |
|
1051 | 1051 | $property = $targetClass->getProperty($property->getMappedBy()); |
1052 | 1052 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
1053 | 1053 | } |
@@ -1062,7 +1062,7 @@ discard block |
||
1062 | 1062 | $columnName = $joinColumn->getColumnName(); |
1063 | 1063 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
1064 | 1064 | |
1065 | - if (! $joinColumn->getType()) { |
|
1065 | + if ( ! $joinColumn->getType()) { |
|
1066 | 1066 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $em)); |
1067 | 1067 | } |
1068 | 1068 | |
@@ -1096,11 +1096,11 @@ discard block |
||
1096 | 1096 | { |
1097 | 1097 | $schema = $this->getSchemaName() === null |
1098 | 1098 | ? '' |
1099 | - : $this->getSchemaName() . '_' |
|
1099 | + : $this->getSchemaName().'_' |
|
1100 | 1100 | ; |
1101 | 1101 | |
1102 | 1102 | // replace dots with underscores because PostgreSQL creates temporary tables in a special schema |
1103 | - return $schema . $this->getTableName() . '_id_tmp'; |
|
1103 | + return $schema.$this->getTableName().'_id_tmp'; |
|
1104 | 1104 | } |
1105 | 1105 | |
1106 | 1106 | /** |
@@ -1134,7 +1134,7 @@ discard block |
||
1134 | 1134 | */ |
1135 | 1135 | public function setInheritanceType($type) : void |
1136 | 1136 | { |
1137 | - if (! $this->isInheritanceType($type)) { |
|
1137 | + if ( ! $this->isInheritanceType($type)) { |
|
1138 | 1138 | throw MappingException::invalidInheritanceType($this->className, $type); |
1139 | 1139 | } |
1140 | 1140 | |
@@ -1152,7 +1152,7 @@ discard block |
||
1152 | 1152 | { |
1153 | 1153 | $fieldName = $property->getName(); |
1154 | 1154 | |
1155 | - if (! isset($this->declaredProperties[$fieldName])) { |
|
1155 | + if ( ! isset($this->declaredProperties[$fieldName])) { |
|
1156 | 1156 | throw MappingException::invalidOverrideFieldName($this->className, $fieldName); |
1157 | 1157 | } |
1158 | 1158 | |
@@ -1349,7 +1349,7 @@ discard block |
||
1349 | 1349 | $declaringClass = $property->getDeclaringClass(); |
1350 | 1350 | |
1351 | 1351 | if ($inheritedProperty instanceof FieldMetadata) { |
1352 | - if (! $declaringClass->isMappedSuperclass) { |
|
1352 | + if ( ! $declaringClass->isMappedSuperclass) { |
|
1353 | 1353 | $inheritedProperty->setTableName($property->getTableName()); |
1354 | 1354 | } |
1355 | 1355 | |
@@ -1408,7 +1408,7 @@ discard block |
||
1408 | 1408 | throw MappingException::duplicateQueryMapping($this->className, $name); |
1409 | 1409 | } |
1410 | 1410 | |
1411 | - if (! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) { |
|
1411 | + if ( ! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) { |
|
1412 | 1412 | throw MappingException::missingQueryMapping($this->className, $name); |
1413 | 1413 | } |
1414 | 1414 | |
@@ -1425,7 +1425,7 @@ discard block |
||
1425 | 1425 | */ |
1426 | 1426 | public function addSqlResultSetMapping(array $resultMapping) |
1427 | 1427 | { |
1428 | - if (! isset($resultMapping['name'])) { |
|
1428 | + if ( ! isset($resultMapping['name'])) { |
|
1429 | 1429 | throw MappingException::nameIsMandatoryForSqlResultSetMapping($this->className); |
1430 | 1430 | } |
1431 | 1431 | |
@@ -1435,7 +1435,7 @@ discard block |
||
1435 | 1435 | |
1436 | 1436 | if (isset($resultMapping['entities'])) { |
1437 | 1437 | foreach ($resultMapping['entities'] as $key => $entityResult) { |
1438 | - if (! isset($entityResult['entityClass'])) { |
|
1438 | + if ( ! isset($entityResult['entityClass'])) { |
|
1439 | 1439 | throw MappingException::missingResultSetMappingEntity($this->className, $resultMapping['name']); |
1440 | 1440 | } |
1441 | 1441 | |
@@ -1444,11 +1444,11 @@ discard block |
||
1444 | 1444 | |
1445 | 1445 | if (isset($entityResult['fields'])) { |
1446 | 1446 | foreach ($entityResult['fields'] as $k => $field) { |
1447 | - if (! isset($field['name'])) { |
|
1447 | + if ( ! isset($field['name'])) { |
|
1448 | 1448 | throw MappingException::missingResultSetMappingFieldName($this->className, $resultMapping['name']); |
1449 | 1449 | } |
1450 | 1450 | |
1451 | - if (! isset($field['column'])) { |
|
1451 | + if ( ! isset($field['column'])) { |
|
1452 | 1452 | $fieldName = $field['name']; |
1453 | 1453 | |
1454 | 1454 | if (strpos($fieldName, '.')) { |
@@ -1546,11 +1546,11 @@ discard block |
||
1546 | 1546 | 'method' => $method, |
1547 | 1547 | ]; |
1548 | 1548 | |
1549 | - if (! class_exists($class)) { |
|
1549 | + if ( ! class_exists($class)) { |
|
1550 | 1550 | throw MappingException::entityListenerClassNotFound($class, $this->className); |
1551 | 1551 | } |
1552 | 1552 | |
1553 | - if (! method_exists($class, $method)) { |
|
1553 | + if ( ! method_exists($class, $method)) { |
|
1554 | 1554 | throw MappingException::entityListenerMethodNotFound($class, $method, $this->className); |
1555 | 1555 | } |
1556 | 1556 | |
@@ -1617,7 +1617,7 @@ discard block |
||
1617 | 1617 | return; |
1618 | 1618 | } |
1619 | 1619 | |
1620 | - if (! (class_exists($className) || interface_exists($className))) { |
|
1620 | + if ( ! (class_exists($className) || interface_exists($className))) { |
|
1621 | 1621 | throw MappingException::invalidClassInDiscriminatorMap($className, $this->className); |
1622 | 1622 | } |
1623 | 1623 |
@@ -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 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | */ |
132 | 132 | public function getAllMetadata() : array |
133 | 133 | { |
134 | - if (! $this->initialized) { |
|
134 | + if ( ! $this->initialized) { |
|
135 | 135 | $this->initialize(); |
136 | 136 | } |
137 | 137 | |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | |
173 | 173 | try { |
174 | 174 | if ($this->cacheDriver) { |
175 | - $cached = $this->cacheDriver->fetch($realClassName . $this->cacheSalt); |
|
175 | + $cached = $this->cacheDriver->fetch($realClassName.$this->cacheSalt); |
|
176 | 176 | |
177 | 177 | if ($cached instanceof ClassMetadata) { |
178 | 178 | $this->loadedMetadata[$realClassName] = $cached; |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | foreach ($this->loadMetadata($realClassName, $metadataBuildingContext) as $loadedClass) { |
183 | 183 | $loadedClassName = $loadedClass->getClassName(); |
184 | 184 | |
185 | - $this->cacheDriver->save($loadedClassName . $this->cacheSalt, $loadedClass, null); |
|
185 | + $this->cacheDriver->save($loadedClassName.$this->cacheSalt, $loadedClass, null); |
|
186 | 186 | } |
187 | 187 | } |
188 | 188 | } else { |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | } catch (CommonMappingException $loadingException) { |
192 | 192 | $fallbackMetadataResponse = $this->onNotFoundMetadata($realClassName, $metadataBuildingContext); |
193 | 193 | |
194 | - if (! $fallbackMetadataResponse) { |
|
194 | + if ( ! $fallbackMetadataResponse) { |
|
195 | 195 | throw $loadingException; |
196 | 196 | } |
197 | 197 | |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | */ |
228 | 228 | protected function loadMetadata(string $name, ClassMetadataBuildingContext $metadataBuildingContext) : array |
229 | 229 | { |
230 | - if (! $this->initialized) { |
|
230 | + if ( ! $this->initialized) { |
|
231 | 231 | $this->initialize(); |
232 | 232 | } |
233 | 233 | |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | */ |
264 | 264 | public function isTransient($className) : bool |
265 | 265 | { |
266 | - if (! $this->initialized) { |
|
266 | + if ( ! $this->initialized) { |
|
267 | 267 | $this->initialize(); |
268 | 268 | } |
269 | 269 | |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | $parentClasses = []; |
286 | 286 | |
287 | 287 | foreach (array_reverse($this->getReflectionService()->getParentClasses($name)) as $parentClass) { |
288 | - if (! $this->getDriver()->isTransient($parentClass)) { |
|
288 | + if ( ! $this->getDriver()->isTransient($parentClass)) { |
|
289 | 289 | $parentClasses[] = $parentClass; |
290 | 290 | } |
291 | 291 | } |
@@ -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 | |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | */ |
17 | 17 | public static function pathRequired() |
18 | 18 | { |
19 | - return new self('Specifying the paths to your entities is required ' . |
|
19 | + return new self('Specifying the paths to your entities is required '. |
|
20 | 20 | 'in the AnnotationDriver to retrieve all class names.'); |
21 | 21 | } |
22 | 22 | |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | */ |
207 | 207 | public static function missingQueryMapping($entity, $queryName) |
208 | 208 | { |
209 | - return new self('Query named "' . $queryName . '" in "' . $entity . ' requires a result class or result set mapping.'); |
|
209 | + return new self('Query named "'.$queryName.'" in "'.$entity.' requires a result class or result set mapping.'); |
|
210 | 210 | } |
211 | 211 | |
212 | 212 | /** |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | */ |
218 | 218 | public static function missingResultSetMappingEntity($entity, $resultName) |
219 | 219 | { |
220 | - return new self('Result set mapping named "' . $resultName . '" in "' . $entity . ' requires a entity class name.'); |
|
220 | + return new self('Result set mapping named "'.$resultName.'" in "'.$entity.' requires a entity class name.'); |
|
221 | 221 | } |
222 | 222 | |
223 | 223 | /** |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | */ |
229 | 229 | public static function missingResultSetMappingFieldName($entity, $resultName) |
230 | 230 | { |
231 | - return new self('Result set mapping named "' . $resultName . '" in "' . $entity . ' requires a field name.'); |
|
231 | + return new self('Result set mapping named "'.$resultName.'" in "'.$entity.' requires a field name.'); |
|
232 | 232 | } |
233 | 233 | |
234 | 234 | /** |
@@ -275,8 +275,8 @@ discard block |
||
275 | 275 | { |
276 | 276 | $message = sprintf("The mapping of field '%s' is invalid: The option '%s' is required.", $field, $expectedOption); |
277 | 277 | |
278 | - if (! empty($hint)) { |
|
279 | - $message .= ' (Hint: ' . $hint . ')'; |
|
278 | + if ( ! empty($hint)) { |
|
279 | + $message .= ' (Hint: '.$hint.')'; |
|
280 | 280 | } |
281 | 281 | |
282 | 282 | return new self($message); |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | */ |
306 | 306 | public static function reflectionFailure($entity, \ReflectionException $previousException) |
307 | 307 | { |
308 | - return new self('An error occurred in ' . $entity, 0, $previousException); |
|
308 | + return new self('An error occurred in '.$entity, 0, $previousException); |
|
309 | 309 | } |
310 | 310 | |
311 | 311 | /** |
@@ -316,8 +316,8 @@ discard block |
||
316 | 316 | */ |
317 | 317 | public static function joinColumnMustPointToMappedField($className, $joinColumn) |
318 | 318 | { |
319 | - return new self('The column ' . $joinColumn . ' must be mapped to a field in class ' |
|
320 | - . $className . ' since it is referenced by a join column of another class.'); |
|
319 | + return new self('The column '.$joinColumn.' must be mapped to a field in class ' |
|
320 | + . $className.' since it is referenced by a join column of another class.'); |
|
321 | 321 | } |
322 | 322 | |
323 | 323 | /** |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | */ |
352 | 352 | public static function propertyTypeIsRequired($className, $propertyName) |
353 | 353 | { |
354 | - return new self("The attribute 'type' is required for the column description of property " . $className . '::$' . $propertyName . '.'); |
|
354 | + return new self("The attribute 'type' is required for the column description of property ".$className.'::$'.$propertyName.'.'); |
|
355 | 355 | } |
356 | 356 | |
357 | 357 | /** |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | */ |
362 | 362 | public static function tableIdGeneratorNotImplemented($className) |
363 | 363 | { |
364 | - return new self('TableIdGenerator is not yet implemented for use with class ' . $className); |
|
364 | + return new self('TableIdGenerator is not yet implemented for use with class '.$className); |
|
365 | 365 | } |
366 | 366 | |
367 | 367 | /** |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | */ |
388 | 388 | public static function duplicateQueryMapping($entity, $queryName) |
389 | 389 | { |
390 | - return new self('Query named "' . $queryName . '" in "' . $entity . '" was already declared, but it must be declared only once'); |
|
390 | + return new self('Query named "'.$queryName.'" in "'.$entity.'" was already declared, but it must be declared only once'); |
|
391 | 391 | } |
392 | 392 | |
393 | 393 | /** |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | */ |
399 | 399 | public static function duplicateResultSetMapping($entity, $resultName) |
400 | 400 | { |
401 | - return new self('Result set mapping named "' . $resultName . '" in "' . $entity . '" was already declared, but it must be declared only once'); |
|
401 | + return new self('Result set mapping named "'.$resultName.'" in "'.$entity.'" was already declared, but it must be declared only once'); |
|
402 | 402 | } |
403 | 403 | |
404 | 404 | /** |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | */ |
409 | 409 | public static function singleIdNotAllowedOnCompositePrimaryKey($entity) |
410 | 410 | { |
411 | - return new self('Single id is not allowed on composite primary key in entity ' . $entity); |
|
411 | + return new self('Single id is not allowed on composite primary key in entity '.$entity); |
|
412 | 412 | } |
413 | 413 | |
414 | 414 | /** |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | */ |
419 | 419 | public static function noIdDefined($entity) |
420 | 420 | { |
421 | - return new self('No ID defined for entity ' . $entity); |
|
421 | + return new self('No ID defined for entity '.$entity); |
|
422 | 422 | } |
423 | 423 | |
424 | 424 | /** |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | */ |
429 | 429 | public static function unsupportedOptimisticLockingType($unsupportedType) |
430 | 430 | { |
431 | - return new self('Locking type "' . $unsupportedType . '" is not supported by Doctrine.'); |
|
431 | + return new self('Locking type "'.$unsupportedType.'" is not supported by Doctrine.'); |
|
432 | 432 | } |
433 | 433 | |
434 | 434 | /** |
@@ -438,13 +438,13 @@ discard block |
||
438 | 438 | */ |
439 | 439 | public static function fileMappingDriversRequireConfiguredDirectoryPath($path = null) |
440 | 440 | { |
441 | - if (! empty($path)) { |
|
442 | - $path = '[' . $path . ']'; |
|
441 | + if ( ! empty($path)) { |
|
442 | + $path = '['.$path.']'; |
|
443 | 443 | } |
444 | 444 | |
445 | 445 | return new self( |
446 | - 'File mapping drivers must have a valid directory path, ' . |
|
447 | - 'however the given path ' . $path . ' seems to be incorrect!' |
|
446 | + 'File mapping drivers must have a valid directory path, '. |
|
447 | + 'however the given path '.$path.' seems to be incorrect!' |
|
448 | 448 | ); |
449 | 449 | } |
450 | 450 | |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | public static function invalidClassInDiscriminatorMap($className, $owningClass) |
461 | 461 | { |
462 | 462 | return new self(sprintf( |
463 | - "Entity class '%s' used in the discriminator map of class '%s' " . |
|
463 | + "Entity class '%s' used in the discriminator map of class '%s' ". |
|
464 | 464 | 'does not exist.', |
465 | 465 | $className, |
466 | 466 | $owningClass |
@@ -477,15 +477,15 @@ discard block |
||
477 | 477 | public static function duplicateDiscriminatorEntry($className, array $entries, array $map) |
478 | 478 | { |
479 | 479 | return new self( |
480 | - 'The entries ' . implode(', ', $entries) . " in discriminator map of class '" . $className . "' is duplicated. " . |
|
481 | - 'If the discriminator map is automatically generated you have to convert it to an explicit discriminator map now. ' . |
|
482 | - 'The entries of the current map are: @DiscriminatorMap({' . implode(', ', array_map( |
|
483 | - function ($a, $b) { |
|
480 | + 'The entries '.implode(', ', $entries)." in discriminator map of class '".$className."' is duplicated. ". |
|
481 | + 'If the discriminator map is automatically generated you have to convert it to an explicit discriminator map now. '. |
|
482 | + 'The entries of the current map are: @DiscriminatorMap({'.implode(', ', array_map( |
|
483 | + function($a, $b) { |
|
484 | 484 | return sprintf("'%s': '%s'", $a, $b); |
485 | 485 | }, |
486 | 486 | array_keys($map), |
487 | 487 | array_values($map) |
488 | - )) . '})' |
|
488 | + )).'})' |
|
489 | 489 | ); |
490 | 490 | } |
491 | 491 | |
@@ -548,7 +548,7 @@ discard block |
||
548 | 548 | public static function sqlConversionNotAllowedForPrimaryKeyProperties($className, Property $property) |
549 | 549 | { |
550 | 550 | return new self(sprintf( |
551 | - 'It is not possible to set id field "%s" to type "%s" in entity class "%s". ' . |
|
551 | + 'It is not possible to set id field "%s" to type "%s" in entity class "%s". '. |
|
552 | 552 | 'The type "%s" requires conversion SQL which is not allowed for identifiers.', |
553 | 553 | $property->getName(), |
554 | 554 | $property->getTypeName(), |
@@ -584,7 +584,7 @@ discard block |
||
584 | 584 | */ |
585 | 585 | public static function duplicateColumnName($className, $columnName) |
586 | 586 | { |
587 | - return new self("Duplicate definition of column '" . $columnName . "' on entity '" . $className . "' in a field or discriminator column mapping."); |
|
587 | + return new self("Duplicate definition of column '".$columnName."' on entity '".$className."' in a field or discriminator column mapping."); |
|
588 | 588 | } |
589 | 589 | |
590 | 590 | /** |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | */ |
596 | 596 | public static function illegalToManyAssociationOnMappedSuperclass($className, $field) |
597 | 597 | { |
598 | - return new self("It is illegal to put an inverse side one-to-many or many-to-many association on mapped superclass '" . $className . '#' . $field . "'."); |
|
598 | + return new self("It is illegal to put an inverse side one-to-many or many-to-many association on mapped superclass '".$className.'#'.$field."'."); |
|
599 | 599 | } |
600 | 600 | |
601 | 601 | /** |
@@ -607,8 +607,8 @@ discard block |
||
607 | 607 | */ |
608 | 608 | public static function cannotMapCompositePrimaryKeyEntitiesAsForeignId($className, $targetEntity, $targetField) |
609 | 609 | { |
610 | - return new self("It is not possible to map entity '" . $className . "' with a composite primary key " . |
|
611 | - "as part of the primary key of another entity '" . $targetEntity . '#' . $targetField . "'."); |
|
610 | + return new self("It is not possible to map entity '".$className."' with a composite primary key ". |
|
611 | + "as part of the primary key of another entity '".$targetEntity.'#'.$targetField."'."); |
|
612 | 612 | } |
613 | 613 | |
614 | 614 | /** |
@@ -662,8 +662,8 @@ discard block |
||
662 | 662 | */ |
663 | 663 | public static function illegalOrphanRemoval($className, $field) |
664 | 664 | { |
665 | - return new self('Orphan removal is only allowed on one-to-one and one-to-many ' . |
|
666 | - 'associations, but ' . $className . '#' . $field . ' is not.'); |
|
665 | + return new self('Orphan removal is only allowed on one-to-one and one-to-many '. |
|
666 | + 'associations, but '.$className.'#'.$field.' is not.'); |
|
667 | 667 | } |
668 | 668 | |
669 | 669 | /** |
@@ -695,7 +695,7 @@ discard block |
||
695 | 695 | */ |
696 | 696 | public static function noInheritanceOnMappedSuperClass($className) |
697 | 697 | { |
698 | - return new self("It is not supported to define inheritance information on a mapped superclass '" . $className . "'."); |
|
698 | + return new self("It is not supported to define inheritance information on a mapped superclass '".$className."'."); |
|
699 | 699 | } |
700 | 700 | |
701 | 701 | /** |
@@ -707,8 +707,8 @@ discard block |
||
707 | 707 | public static function mappedClassNotPartOfDiscriminatorMap($className, $rootClassName) |
708 | 708 | { |
709 | 709 | return new self( |
710 | - "Entity '" . $className . "' has to be part of the discriminator map of '" . $rootClassName . "' " . |
|
711 | - "to be properly mapped in the inheritance hierarchy. Alternatively you can make '" . $className . "' an abstract class " . |
|
710 | + "Entity '".$className."' has to be part of the discriminator map of '".$rootClassName."' ". |
|
711 | + "to be properly mapped in the inheritance hierarchy. Alternatively you can make '".$className."' an abstract class ". |
|
712 | 712 | 'to avoid this exception from occurring.' |
713 | 713 | ); |
714 | 714 | } |
@@ -721,7 +721,7 @@ discard block |
||
721 | 721 | */ |
722 | 722 | public static function lifecycleCallbackMethodNotFound($className, $methodName) |
723 | 723 | { |
724 | - return new self("Entity '" . $className . "' has no method '" . $methodName . "' to be registered as lifecycle callback."); |
|
724 | + return new self("Entity '".$className."' has no method '".$methodName."' to be registered as lifecycle callback."); |
|
725 | 725 | } |
726 | 726 | |
727 | 727 | /** |
@@ -767,7 +767,7 @@ discard block |
||
767 | 767 | */ |
768 | 768 | public static function invalidFetchMode($className, $annotation) |
769 | 769 | { |
770 | - return new self("Entity '" . $className . "' has a mapping with invalid fetch mode '" . $annotation . "'"); |
|
770 | + return new self("Entity '".$className."' has a mapping with invalid fetch mode '".$annotation."'"); |
|
771 | 771 | } |
772 | 772 | |
773 | 773 | /** |
@@ -777,7 +777,7 @@ discard block |
||
777 | 777 | */ |
778 | 778 | public static function compositeKeyAssignedIdGeneratorRequired($className) |
779 | 779 | { |
780 | - return new self("Entity '" . $className . "' has a composite identifier but uses an ID generator other than manually assigning (Identity, Sequence). This is not supported."); |
|
780 | + return new self("Entity '".$className."' has a composite identifier but uses an ID generator other than manually assigning (Identity, Sequence). This is not supported."); |
|
781 | 781 | } |
782 | 782 | |
783 | 783 | /** |
@@ -789,7 +789,7 @@ discard block |
||
789 | 789 | */ |
790 | 790 | public static function invalidTargetEntityClass($targetEntity, $sourceEntity, $associationName) |
791 | 791 | { |
792 | - return new self("The target-entity '" . $targetEntity . "' cannot be found in '" . $sourceEntity . '#' . $associationName . "'."); |
|
792 | + return new self("The target-entity '".$targetEntity."' cannot be found in '".$sourceEntity.'#'.$associationName."'."); |
|
793 | 793 | } |
794 | 794 | |
795 | 795 | /** |
@@ -801,8 +801,8 @@ discard block |
||
801 | 801 | */ |
802 | 802 | public static function invalidCascadeOption(array $cascades, $className, $propertyName) |
803 | 803 | { |
804 | - $cascades = implode(', ', array_map(function ($e) { |
|
805 | - return "'" . $e . "'"; |
|
804 | + $cascades = implode(', ', array_map(function($e) { |
|
805 | + return "'".$e."'"; |
|
806 | 806 | }, $cascades)); |
807 | 807 | |
808 | 808 | return new self(sprintf( |
@@ -835,7 +835,7 @@ discard block |
||
835 | 835 | { |
836 | 836 | return new self( |
837 | 837 | sprintf( |
838 | - 'Infinite nesting detected for embedded property %s::%s. ' . |
|
838 | + 'Infinite nesting detected for embedded property %s::%s. '. |
|
839 | 839 | 'You cannot embed an embeddable from the same type inside an embeddable.', |
840 | 840 | $className, |
841 | 841 | $propertyName |
@@ -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\Expr; |
6 | 6 | |
@@ -65,12 +65,12 @@ discard block |
||
65 | 65 | */ |
66 | 66 | public function add($arg) |
67 | 67 | { |
68 | - if ($arg !== null && (! $arg instanceof self || $arg->count() > 0)) { |
|
68 | + if ($arg !== null && ( ! $arg instanceof self || $arg->count() > 0)) { |
|
69 | 69 | // If we decide to keep Expr\Base instances, we can use this check |
70 | - if (! is_string($arg)) { |
|
70 | + if ( ! is_string($arg)) { |
|
71 | 71 | $class = get_class($arg); |
72 | 72 | |
73 | - if (! in_array($class, $this->allowedClasses)) { |
|
73 | + if ( ! in_array($class, $this->allowedClasses)) { |
|
74 | 74 | throw new \InvalidArgumentException( |
75 | 75 | sprintf("Expression of type '%s' not allowed in this context.", $class) |
76 | 76 | ); |
@@ -100,6 +100,6 @@ discard block |
||
100 | 100 | return (string) $this->parts[0]; |
101 | 101 | } |
102 | 102 | |
103 | - return $this->preSeparator . implode($this->separator, $this->parts) . $this->postSeparator; |
|
103 | + return $this->preSeparator.implode($this->separator, $this->parts).$this->postSeparator; |
|
104 | 104 | } |
105 | 105 | } |
@@ -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\Expr; |
6 | 6 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | public function add($sort, $order = null) |
53 | 53 | { |
54 | 54 | $order = ! $order ? 'ASC' : $order; |
55 | - $this->parts[] = $sort . ' ' . $order; |
|
55 | + $this->parts[] = $sort.' '.$order; |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -76,6 +76,6 @@ discard block |
||
76 | 76 | */ |
77 | 77 | public function __toString() |
78 | 78 | { |
79 | - return $this->preSeparator . implode($this->separator, $this->parts) . $this->postSeparator; |
|
79 | + return $this->preSeparator.implode($this->separator, $this->parts).$this->postSeparator; |
|
80 | 80 | } |
81 | 81 | } |
@@ -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 | |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | */ |
245 | 245 | public function countDistinct($x) |
246 | 246 | { |
247 | - return 'COUNT(DISTINCT ' . implode(', ', func_get_args()) . ')'; |
|
247 | + return 'COUNT(DISTINCT '.implode(', ', func_get_args()).')'; |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | /** |
@@ -420,13 +420,13 @@ discard block |
||
420 | 420 | { |
421 | 421 | if (is_array($y)) { |
422 | 422 | foreach ($y as &$literal) { |
423 | - if (! ($literal instanceof Expr\Literal)) { |
|
423 | + if ( ! ($literal instanceof Expr\Literal)) { |
|
424 | 424 | $literal = $this->quoteLiteral($literal); |
425 | 425 | } |
426 | 426 | } |
427 | 427 | } |
428 | 428 | |
429 | - return new Expr\Func($x . ' IN', (array) $y); |
|
429 | + return new Expr\Func($x.' IN', (array) $y); |
|
430 | 430 | } |
431 | 431 | |
432 | 432 | /** |
@@ -441,13 +441,13 @@ discard block |
||
441 | 441 | { |
442 | 442 | if (is_array($y)) { |
443 | 443 | foreach ($y as &$literal) { |
444 | - if (! ($literal instanceof Expr\Literal)) { |
|
444 | + if ( ! ($literal instanceof Expr\Literal)) { |
|
445 | 445 | $literal = $this->quoteLiteral($literal); |
446 | 446 | } |
447 | 447 | } |
448 | 448 | } |
449 | 449 | |
450 | - return new Expr\Func($x . ' NOT IN', (array) $y); |
|
450 | + return new Expr\Func($x.' NOT IN', (array) $y); |
|
451 | 451 | } |
452 | 452 | |
453 | 453 | /** |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | */ |
460 | 460 | public function isNull($x) |
461 | 461 | { |
462 | - return $x . ' IS NULL'; |
|
462 | + return $x.' IS NULL'; |
|
463 | 463 | } |
464 | 464 | |
465 | 465 | /** |
@@ -471,7 +471,7 @@ discard block |
||
471 | 471 | */ |
472 | 472 | public function isNotNull($x) |
473 | 473 | { |
474 | - return $x . ' IS NOT NULL'; |
|
474 | + return $x.' IS NOT NULL'; |
|
475 | 475 | } |
476 | 476 | |
477 | 477 | /** |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | return $literal ? 'true' : 'false'; |
596 | 596 | } |
597 | 597 | |
598 | - return "'" . str_replace("'", "''", $literal) . "'"; |
|
598 | + return "'".str_replace("'", "''", $literal)."'"; |
|
599 | 599 | } |
600 | 600 | |
601 | 601 | /** |
@@ -609,7 +609,7 @@ discard block |
||
609 | 609 | */ |
610 | 610 | public function between($val, $x, $y) |
611 | 611 | { |
612 | - return $val . ' BETWEEN ' . $x . ' AND ' . $y; |
|
612 | + return $val.' BETWEEN '.$x.' AND '.$y; |
|
613 | 613 | } |
614 | 614 | |
615 | 615 | /** |
@@ -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 | |
@@ -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; |
@@ -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 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | return new Expr\Orx($expressionList); |
102 | 102 | |
103 | 103 | default: |
104 | - throw new \RuntimeException('Unknown composite ' . $expr->getType()); |
|
104 | + throw new \RuntimeException('Unknown composite '.$expr->getType()); |
|
105 | 105 | } |
106 | 106 | } |
107 | 107 | |
@@ -110,14 +110,14 @@ discard block |
||
110 | 110 | */ |
111 | 111 | public function walkComparison(Comparison $comparison) |
112 | 112 | { |
113 | - if (! isset($this->queryAliases[0])) { |
|
113 | + if ( ! isset($this->queryAliases[0])) { |
|
114 | 114 | throw new QueryException('No aliases are set before invoking walkComparison().'); |
115 | 115 | } |
116 | 116 | |
117 | - $field = $this->queryAliases[0] . '.' . $comparison->getField(); |
|
117 | + $field = $this->queryAliases[0].'.'.$comparison->getField(); |
|
118 | 118 | |
119 | 119 | foreach ($this->queryAliases as $alias) { |
120 | - if (strpos($comparison->getField() . '.', $alias . '.') === 0) { |
|
120 | + if (strpos($comparison->getField().'.', $alias.'.') === 0) { |
|
121 | 121 | $field = $comparison->getField(); |
122 | 122 | break; |
123 | 123 | } |
@@ -128,13 +128,13 @@ discard block |
||
128 | 128 | |
129 | 129 | foreach ($this->parameters as $parameter) { |
130 | 130 | if ($parameter->getName() === $parameterName) { |
131 | - $parameterName .= '_' . $parameterCount; |
|
131 | + $parameterName .= '_'.$parameterCount; |
|
132 | 132 | break; |
133 | 133 | } |
134 | 134 | } |
135 | 135 | |
136 | 136 | $parameter = new Parameter($parameterName, $this->walkValue($comparison->getValue())); |
137 | - $placeholder = ':' . $parameterName; |
|
137 | + $placeholder = ':'.$parameterName; |
|
138 | 138 | |
139 | 139 | switch ($comparison->getOperator()) { |
140 | 140 | case Comparison::IN: |
@@ -161,17 +161,17 @@ discard block |
||
161 | 161 | |
162 | 162 | return $this->expr->neq($field, $placeholder); |
163 | 163 | case Comparison::CONTAINS: |
164 | - $parameter->setValue('%' . $parameter->getValue() . '%', $parameter->getType()); |
|
164 | + $parameter->setValue('%'.$parameter->getValue().'%', $parameter->getType()); |
|
165 | 165 | $this->parameters[] = $parameter; |
166 | 166 | |
167 | 167 | return $this->expr->like($field, $placeholder); |
168 | 168 | case Comparison::STARTS_WITH: |
169 | - $parameter->setValue($parameter->getValue() . '%', $parameter->getType()); |
|
169 | + $parameter->setValue($parameter->getValue().'%', $parameter->getType()); |
|
170 | 170 | $this->parameters[] = $parameter; |
171 | 171 | |
172 | 172 | return $this->expr->like($field, $placeholder); |
173 | 173 | case Comparison::ENDS_WITH: |
174 | - $parameter->setValue('%' . $parameter->getValue(), $parameter->getType()); |
|
174 | + $parameter->setValue('%'.$parameter->getValue(), $parameter->getType()); |
|
175 | 175 | $this->parameters[] = $parameter; |
176 | 176 | |
177 | 177 | return $this->expr->like($field, $placeholder); |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | ); |
188 | 188 | } |
189 | 189 | |
190 | - throw new \RuntimeException('Unknown comparison operator: ' . $comparison->getOperator()); |
|
190 | + throw new \RuntimeException('Unknown comparison operator: '.$comparison->getOperator()); |
|
191 | 191 | } |
192 | 192 | } |
193 | 193 |