@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Persisters; |
6 | 6 |
@@ -5,17 +5,13 @@ |
||
5 | 5 | |
6 | 6 | namespace Doctrine\ORM\Cache; |
7 | 7 | |
8 | -use Doctrine\Common\Collections\ArrayCollection; |
|
9 | -use Doctrine\Common\Proxy\Proxy; |
|
10 | 8 | use Doctrine\ORM\Cache; |
11 | 9 | use Doctrine\ORM\Cache\FeatureNotImplemented; |
12 | 10 | use Doctrine\ORM\Cache\NonCacheableEntity; |
13 | 11 | use Doctrine\ORM\Cache\Persister\CachedPersister; |
14 | 12 | use Doctrine\ORM\EntityManagerInterface; |
15 | 13 | use Doctrine\ORM\Mapping\AssociationMetadata; |
16 | -use Doctrine\ORM\Mapping\ClassMetadata; |
|
17 | 14 | use Doctrine\ORM\Mapping\ToOneAssociationMetadata; |
18 | -use Doctrine\ORM\PersistentCollection; |
|
19 | 15 | use Doctrine\ORM\Query; |
20 | 16 | use Doctrine\ORM\Query\ResultSetMapping; |
21 | 17 | use ProxyManager\Proxy\GhostObjectInterface; |
@@ -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 | |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | public function getParameter($key) |
307 | 307 | { |
308 | 308 | $filteredParameters = $this->parameters->filter( |
309 | - function ($parameter) use ($key) |
|
309 | + function($parameter) use ($key) |
|
310 | 310 | { |
311 | 311 | // Must not be identical because of string to integer conversion |
312 | 312 | return ($key == $parameter->getName()); |
@@ -355,14 +355,14 @@ discard block |
||
355 | 355 | public function setParameter($key, $value, $type = null) |
356 | 356 | { |
357 | 357 | $filteredParameters = $this->parameters->filter( |
358 | - function ($parameter) use ($key) |
|
358 | + function($parameter) use ($key) |
|
359 | 359 | { |
360 | 360 | // Must not be identical because of string to integer conversion |
361 | 361 | return ($key == $parameter->getName()); |
362 | 362 | } |
363 | 363 | ); |
364 | 364 | |
365 | - if (! $filteredParameters->isEmpty()) { |
|
365 | + if ( ! $filteredParameters->isEmpty()) { |
|
366 | 366 | $parameter = $filteredParameters->first(); |
367 | 367 | $parameter->setValue($value, $type); |
368 | 368 | |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | */ |
452 | 452 | private function translateNamespaces(Query\ResultSetMapping $rsm) |
453 | 453 | { |
454 | - $translate = function ($alias) { |
|
454 | + $translate = function($alias) { |
|
455 | 455 | return $this->em->getClassMetadata($alias)->getClassName(); |
456 | 456 | }; |
457 | 457 | |
@@ -513,7 +513,7 @@ discard block |
||
513 | 513 | */ |
514 | 514 | public function setResultCacheProfile(QueryCacheProfile $profile = null) |
515 | 515 | { |
516 | - if (! $profile->getResultCacheDriver()) { |
|
516 | + if ( ! $profile->getResultCacheDriver()) { |
|
517 | 517 | $resultCacheDriver = $this->em->getConfiguration()->getResultCacheImpl(); |
518 | 518 | $profile = $profile->setResultCacheDriver($resultCacheDriver); |
519 | 519 | } |
@@ -981,7 +981,7 @@ discard block |
||
981 | 981 | $this->getTimestampKey() |
982 | 982 | ); |
983 | 983 | |
984 | - $result = $queryCache->get($queryKey, $rsm, $this->hints); |
|
984 | + $result = $queryCache->get($queryKey, $rsm, $this->hints); |
|
985 | 985 | |
986 | 986 | if ($result !== null) { |
987 | 987 | if ($this->cacheLogger) { |
@@ -1115,6 +1115,6 @@ discard block |
||
1115 | 1115 | |
1116 | 1116 | ksort($hints); |
1117 | 1117 | |
1118 | - return sha1($query . '-' . serialize($params) . '-' . serialize($hints)); |
|
1118 | + return sha1($query.'-'.serialize($params).'-'.serialize($hints)); |
|
1119 | 1119 | } |
1120 | 1120 | } |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -declare(strict_types=1); |
|
4 | +declare(strict_types = 1); |
|
5 | 5 | |
6 | 6 | namespace Doctrine\ORM\Mapping; |
7 | 7 | |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | */ |
310 | 310 | public function __toString() |
311 | 311 | { |
312 | - return __CLASS__ . '@' . spl_object_hash($this); |
|
312 | + return __CLASS__.'@'.spl_object_hash($this); |
|
313 | 313 | } |
314 | 314 | |
315 | 315 | /** |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | // Restore ReflectionClass and properties |
413 | 413 | $this->reflectionClass = $reflectionService->getClass($this->className); |
414 | 414 | |
415 | - if (! $this->reflectionClass) { |
|
415 | + if ( ! $this->reflectionClass) { |
|
416 | 416 | return; |
417 | 417 | } |
418 | 418 | |
@@ -438,11 +438,11 @@ discard block |
||
438 | 438 | } |
439 | 439 | |
440 | 440 | // Verify & complete identifier mapping |
441 | - if (! $this->identifier) { |
|
441 | + if ( ! $this->identifier) { |
|
442 | 442 | throw MappingException::identifierRequired($this->className); |
443 | 443 | } |
444 | 444 | |
445 | - $explicitlyGeneratedProperties = array_filter($this->declaredProperties, function (Property $property) : bool { |
|
445 | + $explicitlyGeneratedProperties = array_filter($this->declaredProperties, function(Property $property) : bool { |
|
446 | 446 | return $property instanceof FieldMetadata |
447 | 447 | && $property->isPrimaryKey() |
448 | 448 | && $property->hasValueGenerator(); |
@@ -463,14 +463,14 @@ discard block |
||
463 | 463 | public function validateAssociations() : void |
464 | 464 | { |
465 | 465 | array_map( |
466 | - function (Property $property) { |
|
467 | - if (! ($property instanceof AssociationMetadata)) { |
|
466 | + function(Property $property) { |
|
467 | + if ( ! ($property instanceof AssociationMetadata)) { |
|
468 | 468 | return; |
469 | 469 | } |
470 | 470 | |
471 | 471 | $targetEntity = $property->getTargetEntity(); |
472 | 472 | |
473 | - if (! class_exists($targetEntity)) { |
|
473 | + if ( ! class_exists($targetEntity)) { |
|
474 | 474 | throw MappingException::invalidTargetEntityClass($targetEntity, $this->className, $property->getName()); |
475 | 475 | } |
476 | 476 | }, |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | foreach ($this->lifecycleCallbacks as $callbacks) { |
493 | 493 | /** @var array $callbacks */ |
494 | 494 | foreach ($callbacks as $callbackFuncName) { |
495 | - if (! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) { |
|
495 | + if ( ! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) { |
|
496 | 496 | throw MappingException::lifecycleCallbackMethodNotFound($this->className, $callbackFuncName); |
497 | 497 | } |
498 | 498 | } |
@@ -520,11 +520,11 @@ discard block |
||
520 | 520 | */ |
521 | 521 | public function isIdentifier(string $fieldName) : bool |
522 | 522 | { |
523 | - if (! $this->identifier) { |
|
523 | + if ( ! $this->identifier) { |
|
524 | 524 | return false; |
525 | 525 | } |
526 | 526 | |
527 | - if (! $this->isIdentifierComposite()) { |
|
527 | + if ( ! $this->isIdentifierComposite()) { |
|
528 | 528 | return $fieldName === $this->identifier[0]; |
529 | 529 | } |
530 | 530 | |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | */ |
553 | 553 | public function getNamedQuery($queryName) : string |
554 | 554 | { |
555 | - if (! isset($this->namedQueries[$queryName])) { |
|
555 | + if ( ! isset($this->namedQueries[$queryName])) { |
|
556 | 556 | throw MappingException::queryNotFound($this->className, $queryName); |
557 | 557 | } |
558 | 558 | |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | */ |
613 | 613 | public function getSqlResultSetMapping($name) |
614 | 614 | { |
615 | - if (! isset($this->sqlResultSetMappings[$name])) { |
|
615 | + if ( ! isset($this->sqlResultSetMappings[$name])) { |
|
616 | 616 | throw MappingException::resultMappingNotFound($this->className, $name); |
617 | 617 | } |
618 | 618 | |
@@ -647,7 +647,7 @@ discard block |
||
647 | 647 | $property->setColumnName($columnName); |
648 | 648 | } |
649 | 649 | |
650 | - if (! $this->isMappedSuperclass) { |
|
650 | + if ( ! $this->isMappedSuperclass) { |
|
651 | 651 | $property->setTableName($this->getTableName()); |
652 | 652 | } |
653 | 653 | |
@@ -667,7 +667,7 @@ discard block |
||
667 | 667 | throw MappingException::sqlConversionNotAllowedForPrimaryKeyProperties($property); |
668 | 668 | }; |
669 | 669 | |
670 | - if (! in_array($fieldName, $this->identifier)) { |
|
670 | + if ( ! in_array($fieldName, $this->identifier)) { |
|
671 | 671 | $this->identifier[] = $fieldName; |
672 | 672 | } |
673 | 673 | } |
@@ -721,7 +721,7 @@ discard block |
||
721 | 721 | $fieldName = $property->getName(); |
722 | 722 | $targetEntity = $property->getTargetEntity(); |
723 | 723 | |
724 | - if (! $targetEntity) { |
|
724 | + if ( ! $targetEntity) { |
|
725 | 725 | throw MappingException::missingTargetEntity($fieldName); |
726 | 726 | } |
727 | 727 | |
@@ -747,7 +747,7 @@ discard block |
||
747 | 747 | $this->identifier[] = $property->getName(); |
748 | 748 | } |
749 | 749 | |
750 | - if ($this->cache && !$property->getCache()) { |
|
750 | + if ($this->cache && ! $property->getCache()) { |
|
751 | 751 | throw NonCacheableEntityAssociation::fromEntityAndField($this->className, $fieldName); |
752 | 752 | } |
753 | 753 | |
@@ -801,7 +801,7 @@ discard block |
||
801 | 801 | /** @var JoinColumnMetadata $joinColumn */ |
802 | 802 | if ($property instanceof OneToOneAssociationMetadata && $this->inheritanceType !== InheritanceType::SINGLE_TABLE) { |
803 | 803 | if (1 === count($property->getJoinColumns())) { |
804 | - if (! $property->isPrimaryKey()) { |
|
804 | + if ( ! $property->isPrimaryKey()) { |
|
805 | 805 | $joinColumn->setUnique(true); |
806 | 806 | } |
807 | 807 | } else { |
@@ -809,13 +809,13 @@ discard block |
||
809 | 809 | } |
810 | 810 | } |
811 | 811 | |
812 | - $joinColumn->setTableName(! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
812 | + $joinColumn->setTableName( ! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
813 | 813 | |
814 | - if (! $joinColumn->getColumnName()) { |
|
814 | + if ( ! $joinColumn->getColumnName()) { |
|
815 | 815 | $joinColumn->setColumnName($this->namingStrategy->joinColumnName($fieldName, $this->className)); |
816 | 816 | } |
817 | 817 | |
818 | - if (! $joinColumn->getReferencedColumnName()) { |
|
818 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
819 | 819 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
820 | 820 | } |
821 | 821 | |
@@ -843,7 +843,7 @@ discard block |
||
843 | 843 | if ($property->isOrphanRemoval()) { |
844 | 844 | $cascades = $property->getCascade(); |
845 | 845 | |
846 | - if (! in_array('remove', $cascades)) { |
|
846 | + if ( ! in_array('remove', $cascades)) { |
|
847 | 847 | $cascades[] = 'remove'; |
848 | 848 | |
849 | 849 | $property->setCascade($cascades); |
@@ -909,14 +909,14 @@ discard block |
||
909 | 909 | $property->setOwningSide(false); |
910 | 910 | |
911 | 911 | // OneToMany MUST have mappedBy |
912 | - if (! $property->getMappedBy()) { |
|
912 | + if ( ! $property->getMappedBy()) { |
|
913 | 913 | throw MappingException::oneToManyRequiresMappedBy($property->getName()); |
914 | 914 | } |
915 | 915 | |
916 | 916 | if ($property->isOrphanRemoval()) { |
917 | 917 | $cascades = $property->getCascade(); |
918 | 918 | |
919 | - if (! in_array('remove', $cascades)) { |
|
919 | + if ( ! in_array('remove', $cascades)) { |
|
920 | 920 | $cascades[] = 'remove'; |
921 | 921 | |
922 | 922 | $property->setCascade($cascades); |
@@ -939,7 +939,7 @@ discard block |
||
939 | 939 | |
940 | 940 | $property->setJoinTable($joinTable); |
941 | 941 | |
942 | - if (! $joinTable->getName()) { |
|
942 | + if ( ! $joinTable->getName()) { |
|
943 | 943 | $joinTableName = $this->namingStrategy->joinTableName( |
944 | 944 | $property->getSourceEntity(), |
945 | 945 | $property->getTargetEntity(), |
@@ -951,7 +951,7 @@ discard block |
||
951 | 951 | |
952 | 952 | $selfReferencingEntityWithoutJoinColumns = $property->getSourceEntity() == $property->getTargetEntity() && ! $joinTable->hasColumns(); |
953 | 953 | |
954 | - if (! $joinTable->getJoinColumns()) { |
|
954 | + if ( ! $joinTable->getJoinColumns()) { |
|
955 | 955 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
956 | 956 | $sourceReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'source' : $referencedColumnName; |
957 | 957 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getSourceEntity(), $sourceReferenceName); |
@@ -964,7 +964,7 @@ discard block |
||
964 | 964 | $joinTable->addJoinColumn($joinColumn); |
965 | 965 | } |
966 | 966 | |
967 | - if (! $joinTable->getInverseJoinColumns()) { |
|
967 | + if ( ! $joinTable->getInverseJoinColumns()) { |
|
968 | 968 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
969 | 969 | $targetReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'target' : $referencedColumnName; |
970 | 970 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getTargetEntity(), $targetReferenceName); |
@@ -979,13 +979,13 @@ discard block |
||
979 | 979 | |
980 | 980 | foreach ($joinTable->getJoinColumns() as $joinColumn) { |
981 | 981 | /** @var JoinColumnMetadata $joinColumn */ |
982 | - if (! $joinColumn->getReferencedColumnName()) { |
|
982 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
983 | 983 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
984 | 984 | } |
985 | 985 | |
986 | 986 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
987 | 987 | |
988 | - if (! $joinColumn->getColumnName()) { |
|
988 | + if ( ! $joinColumn->getColumnName()) { |
|
989 | 989 | $columnName = $this->namingStrategy->joinKeyColumnName( |
990 | 990 | $property->getSourceEntity(), |
991 | 991 | $referencedColumnName |
@@ -997,13 +997,13 @@ discard block |
||
997 | 997 | |
998 | 998 | foreach ($joinTable->getInverseJoinColumns() as $inverseJoinColumn) { |
999 | 999 | /** @var JoinColumnMetadata $inverseJoinColumn */ |
1000 | - if (! $inverseJoinColumn->getReferencedColumnName()) { |
|
1000 | + if ( ! $inverseJoinColumn->getReferencedColumnName()) { |
|
1001 | 1001 | $inverseJoinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
1002 | 1002 | } |
1003 | 1003 | |
1004 | 1004 | $referencedColumnName = $inverseJoinColumn->getReferencedColumnName(); |
1005 | 1005 | |
1006 | - if (! $inverseJoinColumn->getColumnName()) { |
|
1006 | + if ( ! $inverseJoinColumn->getColumnName()) { |
|
1007 | 1007 | $columnName = $this->namingStrategy->joinKeyColumnName( |
1008 | 1008 | $property->getTargetEntity(), |
1009 | 1009 | $referencedColumnName |
@@ -1100,7 +1100,7 @@ discard block |
||
1100 | 1100 | // Association defined as Id field |
1101 | 1101 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
1102 | 1102 | |
1103 | - if (! $property->isOwningSide()) { |
|
1103 | + if ( ! $property->isOwningSide()) { |
|
1104 | 1104 | $property = $targetClass->getProperty($property->getMappedBy()); |
1105 | 1105 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
1106 | 1106 | } |
@@ -1115,7 +1115,7 @@ discard block |
||
1115 | 1115 | $columnName = $joinColumn->getColumnName(); |
1116 | 1116 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
1117 | 1117 | |
1118 | - if (! $joinColumn->getType()) { |
|
1118 | + if ( ! $joinColumn->getType()) { |
|
1119 | 1119 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $em)); |
1120 | 1120 | } |
1121 | 1121 | |
@@ -1155,11 +1155,11 @@ discard block |
||
1155 | 1155 | { |
1156 | 1156 | $schema = null === $this->getSchemaName() |
1157 | 1157 | ? '' |
1158 | - : $this->getSchemaName() . '_' |
|
1158 | + : $this->getSchemaName().'_' |
|
1159 | 1159 | ; |
1160 | 1160 | |
1161 | 1161 | // replace dots with underscores because PostgreSQL creates temporary tables in a special schema |
1162 | - return $schema . $this->getTableName() . '_id_tmp'; |
|
1162 | + return $schema.$this->getTableName().'_id_tmp'; |
|
1163 | 1163 | } |
1164 | 1164 | |
1165 | 1165 | /** |
@@ -1219,7 +1219,7 @@ discard block |
||
1219 | 1219 | { |
1220 | 1220 | $fieldName = $property->getName(); |
1221 | 1221 | |
1222 | - if (! isset($this->declaredProperties[$fieldName])) { |
|
1222 | + if ( ! isset($this->declaredProperties[$fieldName])) { |
|
1223 | 1223 | throw MappingException::invalidOverrideFieldName($this->className, $fieldName); |
1224 | 1224 | } |
1225 | 1225 | |
@@ -1427,7 +1427,7 @@ discard block |
||
1427 | 1427 | $declaringClass = $property->getDeclaringClass(); |
1428 | 1428 | |
1429 | 1429 | if ($inheritedProperty instanceof FieldMetadata) { |
1430 | - if (! $declaringClass->isMappedSuperclass) { |
|
1430 | + if ( ! $declaringClass->isMappedSuperclass) { |
|
1431 | 1431 | $inheritedProperty->setTableName($property->getTableName()); |
1432 | 1432 | } |
1433 | 1433 | |
@@ -1495,7 +1495,7 @@ discard block |
||
1495 | 1495 | throw MappingException::duplicateQueryMapping($this->className, $name); |
1496 | 1496 | } |
1497 | 1497 | |
1498 | - if (! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) { |
|
1498 | + if ( ! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) { |
|
1499 | 1499 | throw MappingException::missingQueryMapping($this->className, $name); |
1500 | 1500 | } |
1501 | 1501 | |
@@ -1518,7 +1518,7 @@ discard block |
||
1518 | 1518 | */ |
1519 | 1519 | public function addSqlResultSetMapping(array $resultMapping) |
1520 | 1520 | { |
1521 | - if (!isset($resultMapping['name'])) { |
|
1521 | + if ( ! isset($resultMapping['name'])) { |
|
1522 | 1522 | throw MappingException::nameIsMandatoryForSqlResultSetMapping($this->className); |
1523 | 1523 | } |
1524 | 1524 | |
@@ -1528,7 +1528,7 @@ discard block |
||
1528 | 1528 | |
1529 | 1529 | if (isset($resultMapping['entities'])) { |
1530 | 1530 | foreach ($resultMapping['entities'] as $key => $entityResult) { |
1531 | - if (! isset($entityResult['entityClass'])) { |
|
1531 | + if ( ! isset($entityResult['entityClass'])) { |
|
1532 | 1532 | throw MappingException::missingResultSetMappingEntity($this->className, $resultMapping['name']); |
1533 | 1533 | } |
1534 | 1534 | |
@@ -1541,11 +1541,11 @@ discard block |
||
1541 | 1541 | |
1542 | 1542 | if (isset($entityResult['fields'])) { |
1543 | 1543 | foreach ($entityResult['fields'] as $k => $field) { |
1544 | - if (! isset($field['name'])) { |
|
1544 | + if ( ! isset($field['name'])) { |
|
1545 | 1545 | throw MappingException::missingResultSetMappingFieldName($this->className, $resultMapping['name']); |
1546 | 1546 | } |
1547 | 1547 | |
1548 | - if (! isset($field['column'])) { |
|
1548 | + if ( ! isset($field['column'])) { |
|
1549 | 1549 | $fieldName = $field['name']; |
1550 | 1550 | |
1551 | 1551 | if (strpos($fieldName, '.')) { |
@@ -1654,11 +1654,11 @@ discard block |
||
1654 | 1654 | 'method' => $method, |
1655 | 1655 | ]; |
1656 | 1656 | |
1657 | - if (! class_exists($class)) { |
|
1657 | + if ( ! class_exists($class)) { |
|
1658 | 1658 | throw MappingException::entityListenerClassNotFound($class, $this->className); |
1659 | 1659 | } |
1660 | 1660 | |
1661 | - if (! method_exists($class, $method)) { |
|
1661 | + if ( ! method_exists($class, $method)) { |
|
1662 | 1662 | throw MappingException::entityListenerMethodNotFound($class, $method, $this->className); |
1663 | 1663 | } |
1664 | 1664 | |
@@ -1734,7 +1734,7 @@ discard block |
||
1734 | 1734 | return; |
1735 | 1735 | } |
1736 | 1736 | |
1737 | - if (! (class_exists($className) || interface_exists($className))) { |
|
1737 | + if ( ! (class_exists($className) || interface_exists($className))) { |
|
1738 | 1738 | throw MappingException::invalidClassInDiscriminatorMap($className, $this->className); |
1739 | 1739 | } |
1740 | 1740 |
@@ -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\Cache; |
6 | 6 | |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | public static function fromDriver(Cache $cache) : self |
12 | 12 | { |
13 | 13 | return new self( |
14 | - 'Metadata Cache uses a non-persistent cache driver, ' . get_class($cache) . '.' |
|
14 | + 'Metadata Cache uses a non-persistent cache driver, '.get_class($cache).'.' |
|
15 | 15 | ); |
16 | 16 | } |
17 | 17 | } |
@@ -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\Cache; |
6 | 6 | |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | public static function fromDriver(Cache $cache) : self |
12 | 12 | { |
13 | 13 | return new self( |
14 | - 'Query Cache uses a non-persistent cache driver, ' . get_class($cache) . '.' |
|
14 | + 'Query Cache uses a non-persistent cache driver, '.get_class($cache).'.' |
|
15 | 15 | ); |
16 | 16 | } |
17 | 17 | } |
@@ -9,7 +9,6 @@ |
||
9 | 9 | use Doctrine\ORM\Event\LoadClassMetadataEventArgs; |
10 | 10 | use Doctrine\ORM\Event\OnClassMetadataNotFoundEventArgs; |
11 | 11 | use Doctrine\ORM\Events; |
12 | -use Doctrine\ORM\NotImplementedYet; |
|
13 | 12 | use Doctrine\ORM\ORMException; |
14 | 13 | use Doctrine\ORM\Sequencing; |
15 | 14 | use Doctrine\ORM\Sequencing\Planning\ColumnValueGeneratorExecutor; |
@@ -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 | |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | ClassMetadataBuildingContext $metadataBuildingContext |
92 | 92 | ) : ?ClassMetadata |
93 | 93 | { |
94 | - if (! $this->evm->hasListeners(Events::onClassMetadataNotFound)) { |
|
94 | + if ( ! $this->evm->hasListeners(Events::onClassMetadataNotFound)) { |
|
95 | 95 | return null; |
96 | 96 | } |
97 | 97 | |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | } |
167 | 167 | } |
168 | 168 | |
169 | - if (! $classMetadata->discriminatorMap && $classMetadata->inheritanceType !== InheritanceType::NONE && $classMetadata->isRootEntity()) { |
|
169 | + if ( ! $classMetadata->discriminatorMap && $classMetadata->inheritanceType !== InheritanceType::NONE && $classMetadata->isRootEntity()) { |
|
170 | 170 | $this->addDefaultDiscriminatorMap($classMetadata); |
171 | 171 | } |
172 | 172 | |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | */ |
193 | 193 | protected function completeRuntimeMetadata(ClassMetadata $class, ClassMetadata $parent = null) : void |
194 | 194 | { |
195 | - if (! $parent || ! $parent->isMappedSuperclass) { |
|
195 | + if ( ! $parent || ! $parent->isMappedSuperclass) { |
|
196 | 196 | return; |
197 | 197 | } |
198 | 198 | |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | continue; |
211 | 211 | } |
212 | 212 | |
213 | - if (! ($property instanceof ToOneAssociationMetadata)) { |
|
213 | + if ( ! ($property instanceof ToOneAssociationMetadata)) { |
|
214 | 214 | continue; |
215 | 215 | } |
216 | 216 | |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | */ |
235 | 235 | protected function validateRuntimeMetadata(ClassMetadata $class, ClassMetadata $parent = null) : void |
236 | 236 | { |
237 | - if (! $class->getReflectionClass()) { |
|
237 | + if ( ! $class->getReflectionClass()) { |
|
238 | 238 | // only validate if there is a reflection class instance |
239 | 239 | return; |
240 | 240 | } |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | // verify inheritance |
247 | 247 | if ( ! $class->isMappedSuperclass && $class->inheritanceType !== InheritanceType::NONE) { |
248 | 248 | if ( ! $parent) { |
249 | - if (! $class->discriminatorMap) { |
|
249 | + if ( ! $class->discriminatorMap) { |
|
250 | 250 | throw MappingException::missingDiscriminatorMap($class->getClassName()); |
251 | 251 | } |
252 | 252 | |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | |
509 | 509 | private function completeFieldIdentifierGeneratorMapping(FieldMetadata $field) |
510 | 510 | { |
511 | - if (!$field->hasValueGenerator()) { |
|
511 | + if ( ! $field->hasValueGenerator()) { |
|
512 | 512 | return; |
513 | 513 | } |
514 | 514 | |
@@ -584,7 +584,7 @@ discard block |
||
584 | 584 | */ |
585 | 585 | protected function getFqcnFromAlias($namespaceAlias, $simpleClassName) : string |
586 | 586 | { |
587 | - return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName; |
|
587 | + return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias).'\\'.$simpleClassName; |
|
588 | 588 | } |
589 | 589 | |
590 | 590 | /** |
@@ -608,7 +608,7 @@ discard block |
||
608 | 608 | */ |
609 | 609 | private function getTargetPlatform() : Platforms\AbstractPlatform |
610 | 610 | { |
611 | - if (!$this->targetPlatform) { |
|
611 | + if ( ! $this->targetPlatform) { |
|
612 | 612 | $this->targetPlatform = $this->em->getConnection()->getDatabasePlatform(); |
613 | 613 | } |
614 | 614 | |
@@ -626,7 +626,7 @@ discard block |
||
626 | 626 | $generatedProperties = []; |
627 | 627 | |
628 | 628 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
629 | - if (! ($property instanceof LocalColumnMetadata && $property->hasValueGenerator())) { |
|
629 | + if ( ! ($property instanceof LocalColumnMetadata && $property->hasValueGenerator())) { |
|
630 | 630 | continue; |
631 | 631 | } |
632 | 632 |
@@ -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 | |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public static function syntaxError($message, $previous = null) |
40 | 40 | { |
41 | - return new self('[Syntax Error] ' . $message, 0, $previous); |
|
41 | + return new self('[Syntax Error] '.$message, 0, $previous); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public static function semanticalError($message, $previous = null) |
51 | 51 | { |
52 | - return new self('[Semantical Error] ' . $message, 0, $previous); |
|
52 | + return new self('[Semantical Error] '.$message, 0, $previous); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | */ |
69 | 69 | public static function invalidParameterType($expected, $received) |
70 | 70 | { |
71 | - return new self('Invalid parameter type, ' . $received . ' given, but ' . $expected . ' expected.'); |
|
71 | + return new self('Invalid parameter type, '.$received.' given, but '.$expected.' expected.'); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | /** |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public static function invalidParameterPosition($pos) |
80 | 80 | { |
81 | - return new self('Invalid parameter position: ' . $pos); |
|
81 | + return new self('Invalid parameter position: '.$pos); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | */ |
90 | 90 | public static function tooManyParameters($expected, $received) |
91 | 91 | { |
92 | - return new self('Too many parameters: the query defines ' . $expected . ' parameters and you bound ' . $received); |
|
92 | + return new self('Too many parameters: the query defines '.$expected.' parameters and you bound '.$received); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | /** |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | */ |
101 | 101 | public static function tooFewParameters($expected, $received) |
102 | 102 | { |
103 | - return new self('Too few parameters: the query defines ' . $expected . ' parameters but you only bound ' . $received); |
|
103 | + return new self('Too few parameters: the query defines '.$expected.' parameters but you only bound '.$received); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | public static function invalidPathExpression($pathExpr) |
140 | 140 | { |
141 | 141 | return new self( |
142 | - "Invalid PathExpression '" . $pathExpr->identificationVariable . "." . $pathExpr->field . "'." |
|
142 | + "Invalid PathExpression '".$pathExpr->identificationVariable.".".$pathExpr->field."'." |
|
143 | 143 | ); |
144 | 144 | } |
145 | 145 | |
@@ -172,8 +172,8 @@ discard block |
||
172 | 172 | public static function partialObjectsAreDangerous() |
173 | 173 | { |
174 | 174 | return new self( |
175 | - "Loading partial objects is dangerous. Fetch full objects or consider " . |
|
176 | - "using a different fetch mode. If you really want partial objects, " . |
|
175 | + "Loading partial objects is dangerous. Fetch full objects or consider ". |
|
176 | + "using a different fetch mode. If you really want partial objects, ". |
|
177 | 177 | "set the doctrine.forcePartialLoad query hint to TRUE." |
178 | 178 | ); |
179 | 179 | } |
@@ -200,8 +200,8 @@ discard block |
||
200 | 200 | public static function associationPathInverseSideNotSupported(PathExpression $pathExpr) |
201 | 201 | { |
202 | 202 | return new self( |
203 | - 'A single-valued association path expression to an inverse side is not supported in DQL queries. ' . |
|
204 | - 'Instead of "' . $pathExpr->identificationVariable . '.' . $pathExpr->field . '" use an explicit join.' |
|
203 | + 'A single-valued association path expression to an inverse side is not supported in DQL queries. '. |
|
204 | + 'Instead of "'.$pathExpr->identificationVariable.'.'.$pathExpr->field.'" use an explicit join.' |
|
205 | 205 | ); |
206 | 206 | } |
207 | 207 | |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | */ |
242 | 242 | public static function instanceOfUnrelatedClass($className, $rootClass) |
243 | 243 | { |
244 | - return new self("Cannot check if a child of '" . $rootClass . "' is instanceof '" . $className . "', " . |
|
244 | + return new self("Cannot check if a child of '".$rootClass."' is instanceof '".$className."', ". |
|
245 | 245 | "inheritance hierarchy does not exists between these two classes."); |
246 | 246 | } |
247 | 247 | |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | public static function invalidQueryComponent($dqlAlias) |
254 | 254 | { |
255 | 255 | return new self( |
256 | - "Invalid query component given for DQL alias '" . $dqlAlias . "', ". |
|
256 | + "Invalid query component given for DQL alias '".$dqlAlias."', ". |
|
257 | 257 | "requires 'metadata', 'parent', 'relation', 'map', 'nestingLevel' and 'token' keys." |
258 | 258 | ); |
259 | 259 | } |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -declare(strict_types=1); |
|
4 | +declare(strict_types = 1); |
|
5 | 5 | |
6 | 6 | namespace Doctrine\ORM\Mapping; |
7 | 7 |