@@ -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 | |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | $message = "The mapping of field '{$field}' is invalid: The option '{$expectedOption}' is required."; |
| 275 | 275 | |
| 276 | 276 | if ( ! empty($hint)) { |
| 277 | - $message .= ' (Hint: ' . $hint . ')'; |
|
| 277 | + $message .= ' (Hint: '.$hint.')'; |
|
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | return new self($message); |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | */ |
| 305 | 305 | public static function reflectionFailure($entity, \ReflectionException $previousException) |
| 306 | 306 | { |
| 307 | - return new self('An error occurred in ' . $entity, 0, $previousException); |
|
| 307 | + return new self('An error occurred in '.$entity, 0, $previousException); |
|
| 308 | 308 | } |
| 309 | 309 | |
| 310 | 310 | /** |
@@ -315,8 +315,8 @@ discard block |
||
| 315 | 315 | */ |
| 316 | 316 | public static function joinColumnMustPointToMappedField($className, $joinColumn) |
| 317 | 317 | { |
| 318 | - return new self('The column ' . $joinColumn . ' must be mapped to a field in class ' |
|
| 319 | - . $className . ' since it is referenced by a join column of another class.'); |
|
| 318 | + return new self('The column '.$joinColumn.' must be mapped to a field in class ' |
|
| 319 | + . $className.' since it is referenced by a join column of another class.'); |
|
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | /** |
@@ -415,7 +415,7 @@ discard block |
||
| 415 | 415 | */ |
| 416 | 416 | public static function noIdDefined($entity) |
| 417 | 417 | { |
| 418 | - return new self('No ID defined for entity ' . $entity); |
|
| 418 | + return new self('No ID defined for entity '.$entity); |
|
| 419 | 419 | } |
| 420 | 420 | |
| 421 | 421 | /** |
@@ -436,12 +436,12 @@ discard block |
||
| 436 | 436 | public static function fileMappingDriversRequireConfiguredDirectoryPath($path = null) |
| 437 | 437 | { |
| 438 | 438 | if ( ! empty($path)) { |
| 439 | - $path = '[' . $path . ']'; |
|
| 439 | + $path = '['.$path.']'; |
|
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | return new self( |
| 443 | - 'File mapping drivers must have a valid directory path, ' . |
|
| 444 | - 'however the given path ' . $path . ' seems to be incorrect!' |
|
| 443 | + 'File mapping drivers must have a valid directory path, '. |
|
| 444 | + 'however the given path '.$path.' seems to be incorrect!' |
|
| 445 | 445 | ); |
| 446 | 446 | } |
| 447 | 447 | |
@@ -472,11 +472,11 @@ discard block |
||
| 472 | 472 | public static function duplicateDiscriminatorEntry($className, array $entries, array $map) |
| 473 | 473 | { |
| 474 | 474 | return new self( |
| 475 | - "The entries " . implode(', ', $entries) . " in discriminator map of class '" . $className . "' is duplicated. " . |
|
| 476 | - "If the discriminator map is automatically generated you have to convert it to an explicit discriminator map now. " . |
|
| 477 | - "The entries of the current map are: @DiscriminatorMap({" . implode(', ', array_map( |
|
| 475 | + "The entries ".implode(', ', $entries)." in discriminator map of class '".$className."' is duplicated. ". |
|
| 476 | + "If the discriminator map is automatically generated you have to convert it to an explicit discriminator map now. ". |
|
| 477 | + "The entries of the current map are: @DiscriminatorMap({".implode(', ', array_map( |
|
| 478 | 478 | function($a, $b) { return "'$a': '$b'"; }, array_keys($map), array_values($map) |
| 479 | - )) . "})" |
|
| 479 | + ))."})" |
|
| 480 | 480 | ); |
| 481 | 481 | } |
| 482 | 482 | |
@@ -540,7 +540,7 @@ discard block |
||
| 540 | 540 | public static function sqlConversionNotAllowedForPrimaryKeyProperties($className, Property $property) |
| 541 | 541 | { |
| 542 | 542 | return new self(sprintf( |
| 543 | - 'It is not possible to set id field "%s" to type "%s" in entity class "%s". ' . |
|
| 543 | + 'It is not possible to set id field "%s" to type "%s" in entity class "%s". '. |
|
| 544 | 544 | 'The type "%s" requires conversion SQL which is not allowed for identifiers.', |
| 545 | 545 | $property->getName(), |
| 546 | 546 | $property->getTypeName(), |
@@ -640,7 +640,7 @@ discard block |
||
| 640 | 640 | public static function illegalOrphanRemoval($className, $field) |
| 641 | 641 | { |
| 642 | 642 | return new self("Orphan removal is only allowed on one-to-one and one-to-many ". |
| 643 | - "associations, but " . $className."#" .$field . " is not."); |
|
| 643 | + "associations, but ".$className."#".$field." is not."); |
|
| 644 | 644 | } |
| 645 | 645 | |
| 646 | 646 | /** |
@@ -672,7 +672,7 @@ discard block |
||
| 672 | 672 | */ |
| 673 | 673 | public static function noInheritanceOnMappedSuperClass($className) |
| 674 | 674 | { |
| 675 | - return new self("It is not supported to define inheritance information on a mapped superclass '" . $className . "'."); |
|
| 675 | + return new self("It is not supported to define inheritance information on a mapped superclass '".$className."'."); |
|
| 676 | 676 | } |
| 677 | 677 | |
| 678 | 678 | /** |
@@ -684,8 +684,8 @@ discard block |
||
| 684 | 684 | public static function mappedClassNotPartOfDiscriminatorMap($className, $rootClassName) |
| 685 | 685 | { |
| 686 | 686 | return new self( |
| 687 | - "Entity '" . $className . "' has to be part of the discriminator map of '" . $rootClassName . "' " . |
|
| 688 | - "to be properly mapped in the inheritance hierarchy. Alternatively you can make '".$className."' an abstract class " . |
|
| 687 | + "Entity '".$className."' has to be part of the discriminator map of '".$rootClassName."' ". |
|
| 688 | + "to be properly mapped in the inheritance hierarchy. Alternatively you can make '".$className."' an abstract class ". |
|
| 689 | 689 | "to avoid this exception from occurring." |
| 690 | 690 | ); |
| 691 | 691 | } |
@@ -698,7 +698,7 @@ discard block |
||
| 698 | 698 | */ |
| 699 | 699 | public static function lifecycleCallbackMethodNotFound($className, $methodName) |
| 700 | 700 | { |
| 701 | - return new self("Entity '" . $className . "' has no method '" . $methodName . "' to be registered as lifecycle callback."); |
|
| 701 | + return new self("Entity '".$className."' has no method '".$methodName."' to be registered as lifecycle callback."); |
|
| 702 | 702 | } |
| 703 | 703 | |
| 704 | 704 | /** |
@@ -744,7 +744,7 @@ discard block |
||
| 744 | 744 | */ |
| 745 | 745 | public static function invalidFetchMode($className, $annotation) |
| 746 | 746 | { |
| 747 | - return new self("Entity '" . $className . "' has a mapping with invalid fetch mode '" . $annotation . "'"); |
|
| 747 | + return new self("Entity '".$className."' has a mapping with invalid fetch mode '".$annotation."'"); |
|
| 748 | 748 | } |
| 749 | 749 | |
| 750 | 750 | /** |
@@ -754,7 +754,7 @@ discard block |
||
| 754 | 754 | */ |
| 755 | 755 | public static function compositeKeyAssignedIdGeneratorRequired($className) |
| 756 | 756 | { |
| 757 | - return new self("Entity '". $className . "' has a composite identifier but uses an ID generator other than manually assigning (Identity, Sequence). This is not supported."); |
|
| 757 | + return new self("Entity '".$className."' has a composite identifier but uses an ID generator other than manually assigning (Identity, Sequence). This is not supported."); |
|
| 758 | 758 | } |
| 759 | 759 | |
| 760 | 760 | /** |
@@ -766,7 +766,7 @@ discard block |
||
| 766 | 766 | */ |
| 767 | 767 | public static function invalidTargetEntityClass($targetEntity, $sourceEntity, $associationName) |
| 768 | 768 | { |
| 769 | - return new self("The target-entity '" . $targetEntity . "' cannot be found in '" . $sourceEntity."#".$associationName."'."); |
|
| 769 | + return new self("The target-entity '".$targetEntity."' cannot be found in '".$sourceEntity."#".$associationName."'."); |
|
| 770 | 770 | } |
| 771 | 771 | |
| 772 | 772 | /** |
@@ -778,7 +778,7 @@ discard block |
||
| 778 | 778 | */ |
| 779 | 779 | public static function invalidCascadeOption(array $cascades, $className, $propertyName) |
| 780 | 780 | { |
| 781 | - $cascades = implode(", ", array_map(function ($e) { return "'" . $e . "'"; }, $cascades)); |
|
| 781 | + $cascades = implode(", ", array_map(function($e) { return "'".$e."'"; }, $cascades)); |
|
| 782 | 782 | |
| 783 | 783 | return new self(sprintf( |
| 784 | 784 | "You have specified invalid cascade options for %s::$%s: %s; available options: 'remove', 'persist', and 'refresh'", |
@@ -810,7 +810,7 @@ discard block |
||
| 810 | 810 | { |
| 811 | 811 | return new self( |
| 812 | 812 | sprintf( |
| 813 | - 'Infinite nesting detected for embedded property %s::%s. ' . |
|
| 813 | + 'Infinite nesting detected for embedded property %s::%s. '. |
|
| 814 | 814 | 'You cannot embed an embeddable from the same type inside an embeddable.', |
| 815 | 815 | $className, |
| 816 | 816 | $propertyName |
@@ -823,7 +823,7 @@ discard block |
||
| 823 | 823 | */ |
| 824 | 824 | public static function fromLibXmlErrors(array $errors) : self |
| 825 | 825 | { |
| 826 | - return new self(implode(PHP_EOL, array_map(function (\LibXMLError $error) : string { |
|
| 826 | + return new self(implode(PHP_EOL, array_map(function(\LibXMLError $error) : string { |
|
| 827 | 827 | return sprintf( |
| 828 | 828 | 'libxml error: %s%s:%d', |
| 829 | 829 | $error->message, |
@@ -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\Driver; |
| 6 | 6 | |
@@ -481,7 +481,7 @@ discard block |
||
| 481 | 481 | |
| 482 | 482 | if (isset($manyToOneElement['fetch'])) { |
| 483 | 483 | $association->setFetchMode( |
| 484 | - constant('Doctrine\ORM\Mapping\FetchMode::' . (string) $manyToOneElement['fetch']) |
|
| 484 | + constant('Doctrine\ORM\Mapping\FetchMode::'.(string) $manyToOneElement['fetch']) |
|
| 485 | 485 | ); |
| 486 | 486 | } |
| 487 | 487 | |
@@ -633,7 +633,7 @@ discard block |
||
| 633 | 633 | $fieldName = (string) $overrideElement['name']; |
| 634 | 634 | $property = $metadata->getProperty($fieldName); |
| 635 | 635 | |
| 636 | - if (! $property) { |
|
| 636 | + if ( ! $property) { |
|
| 637 | 637 | throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName); |
| 638 | 638 | } |
| 639 | 639 | |
@@ -691,7 +691,7 @@ discard block |
||
| 691 | 691 | // Check for fetch |
| 692 | 692 | if (isset($overrideElement['fetch'])) { |
| 693 | 693 | $override->setFetchMode( |
| 694 | - constant('Doctrine\ORM\Mapping\FetchMode::' . (string) $overrideElement['fetch']) |
|
| 694 | + constant('Doctrine\ORM\Mapping\FetchMode::'.(string) $overrideElement['fetch']) |
|
| 695 | 695 | ); |
| 696 | 696 | } |
| 697 | 697 | |
@@ -702,7 +702,7 @@ discard block |
||
| 702 | 702 | // Evaluate <lifecycle-callbacks...> |
| 703 | 703 | if (isset($xmlRoot->{'lifecycle-callbacks'})) { |
| 704 | 704 | foreach ($xmlRoot->{'lifecycle-callbacks'}->{'lifecycle-callback'} as $lifecycleCallback) { |
| 705 | - $eventName = constant(Events::class . '::' . (string) $lifecycleCallback['type']); |
|
| 705 | + $eventName = constant(Events::class.'::'.(string) $lifecycleCallback['type']); |
|
| 706 | 706 | $methodName = (string) $lifecycleCallback['method']; |
| 707 | 707 | |
| 708 | 708 | $metadata->addLifecycleCallback($methodName, $eventName); |
@@ -714,7 +714,7 @@ discard block |
||
| 714 | 714 | foreach ($xmlRoot->{'entity-listeners'}->{'entity-listener'} as $listenerElement) { |
| 715 | 715 | $listenerClassName = $metadata->fullyQualifiedClassName((string) $listenerElement['class']); |
| 716 | 716 | |
| 717 | - if (! class_exists($listenerClassName)) { |
|
| 717 | + if ( ! class_exists($listenerClassName)) { |
|
| 718 | 718 | throw Mapping\MappingException::entityListenerClassNotFound( |
| 719 | 719 | $listenerClassName, |
| 720 | 720 | $metadata->getClassName() |
@@ -889,7 +889,7 @@ discard block |
||
| 889 | 889 | ) |
| 890 | 890 | { |
| 891 | 891 | $baseRegion = strtolower(str_replace('\\', '_', $metadata->getRootClassName())); |
| 892 | - $defaultRegion = $baseRegion . ($fieldName ? '__' . $fieldName : ''); |
|
| 892 | + $defaultRegion = $baseRegion.($fieldName ? '__'.$fieldName : ''); |
|
| 893 | 893 | |
| 894 | 894 | $region = isset($cacheMapping['region']) ? (string) $cacheMapping['region'] : $defaultRegion; |
| 895 | 895 | $usage = isset($cacheMapping['usage']) |
@@ -920,7 +920,7 @@ discard block |
||
| 920 | 920 | Events::preFlush, |
| 921 | 921 | ]; |
| 922 | 922 | |
| 923 | - return array_filter($events, function ($eventName) use ($method) { |
|
| 923 | + return array_filter($events, function($eventName) use ($method) { |
|
| 924 | 924 | return $eventName === $method->getName(); |
| 925 | 925 | }); |
| 926 | 926 | } |
@@ -984,7 +984,7 @@ discard block |
||
| 984 | 984 | $document = new \DOMDocument(); |
| 985 | 985 | $document->load($file); |
| 986 | 986 | try { |
| 987 | - if ( ! $document->schemaValidate(__DIR__ . '/../../../../../doctrine-mapping.xsd')) { |
|
| 987 | + if ( ! $document->schemaValidate(__DIR__.'/../../../../../doctrine-mapping.xsd')) { |
|
| 988 | 988 | $errors = libxml_get_errors(); |
| 989 | 989 | throw MappingException::fromLibXmlErrors($errors); |
| 990 | 990 | } |