@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | |
165 | 165 | if (isset($xmlRoot['inheritance-type'])) { |
166 | 166 | $inheritanceType = (string) $xmlRoot['inheritance-type']; |
167 | - $metadata->setInheritanceType(constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_' . $inheritanceType)); |
|
167 | + $metadata->setInheritanceType(constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_'.$inheritanceType)); |
|
168 | 168 | |
169 | 169 | if ($metadata->inheritanceType != Metadata::INHERITANCE_TYPE_NONE) { |
170 | 170 | // Evaluate <discriminator-column...> |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | } |
367 | 367 | |
368 | 368 | if (isset($oneToOneElement['fetch'])) { |
369 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . (string) $oneToOneElement['fetch']); |
|
369 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.(string) $oneToOneElement['fetch']); |
|
370 | 370 | } |
371 | 371 | |
372 | 372 | if (isset($oneToOneElement['mapped-by'])) { |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | ]; |
416 | 416 | |
417 | 417 | if (isset($oneToManyElement['fetch'])) { |
418 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . (string) $oneToManyElement['fetch']); |
|
418 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.(string) $oneToManyElement['fetch']); |
|
419 | 419 | } |
420 | 420 | |
421 | 421 | if (isset($oneToManyElement->cascade)) { |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | } |
463 | 463 | |
464 | 464 | if (isset($manyToOneElement['fetch'])) { |
465 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . (string) $manyToOneElement['fetch']); |
|
465 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.(string) $manyToOneElement['fetch']); |
|
466 | 466 | } |
467 | 467 | |
468 | 468 | if (isset($manyToOneElement['inversed-by'])) { |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | ]; |
505 | 505 | |
506 | 506 | if (isset($manyToManyElement['fetch'])) { |
507 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . (string) $manyToManyElement['fetch']); |
|
507 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.(string) $manyToManyElement['fetch']); |
|
508 | 508 | } |
509 | 509 | |
510 | 510 | if (isset($manyToManyElement['orphan-removal'])) { |
@@ -624,7 +624,7 @@ discard block |
||
624 | 624 | |
625 | 625 | // Check for `fetch` |
626 | 626 | if (isset($overrideElement['fetch'])) { |
627 | - $override['fetch'] = constant(Metadata::class . '::FETCH_' . (string) $overrideElement['fetch']); |
|
627 | + $override['fetch'] = constant(Metadata::class.'::FETCH_'.(string) $overrideElement['fetch']); |
|
628 | 628 | } |
629 | 629 | |
630 | 630 | $metadata->setAssociationOverride($fieldName, $override); |
@@ -634,7 +634,7 @@ discard block |
||
634 | 634 | // Evaluate <lifecycle-callbacks...> |
635 | 635 | if (isset($xmlRoot->{'lifecycle-callbacks'})) { |
636 | 636 | foreach ($xmlRoot->{'lifecycle-callbacks'}->{'lifecycle-callback'} as $lifecycleCallback) { |
637 | - $metadata->addLifecycleCallback((string) $lifecycleCallback['method'], constant('Doctrine\ORM\Events::' . (string) $lifecycleCallback['type'])); |
|
637 | + $metadata->addLifecycleCallback((string) $lifecycleCallback['method'], constant('Doctrine\ORM\Events::'.(string) $lifecycleCallback['type'])); |
|
638 | 638 | } |
639 | 639 | } |
640 | 640 | |
@@ -795,12 +795,12 @@ discard block |
||
795 | 795 | $region = isset($cacheMapping['region']) ? (string) $cacheMapping['region'] : null; |
796 | 796 | $usage = isset($cacheMapping['usage']) ? strtoupper($cacheMapping['usage']) : null; |
797 | 797 | |
798 | - if ($usage && ! defined('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $usage)) { |
|
798 | + if ($usage && ! defined('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_'.$usage)) { |
|
799 | 799 | throw new \InvalidArgumentException(sprintf('Invalid cache usage "%s"', $usage)); |
800 | 800 | } |
801 | 801 | |
802 | 802 | if ($usage) { |
803 | - $usage = constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $usage); |
|
803 | + $usage = constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_'.$usage); |
|
804 | 804 | } |
805 | 805 | |
806 | 806 | return [ |
@@ -867,7 +867,7 @@ discard block |
||
867 | 867 | $backedUpErrorSetting = libxml_use_internal_errors(true); |
868 | 868 | $document = new \DOMDocument(); |
869 | 869 | $document->load($file); |
870 | - if (!$document->schemaValidate(__DIR__ . '/../../../../../doctrine-mapping.xsd')) { |
|
870 | + if ( ! $document->schemaValidate(__DIR__.'/../../../../../doctrine-mapping.xsd')) { |
|
871 | 871 | $errors = libxml_get_errors(); |
872 | 872 | libxml_clear_errors(); |
873 | 873 | libxml_use_internal_errors(false); |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | $message = "The mapping of field '{$field}' is invalid: The option '{$expectedOption}' is required."; |
285 | 285 | |
286 | 286 | if ( ! empty($hint)) { |
287 | - $message .= ' (Hint: ' . $hint . ')'; |
|
287 | + $message .= ' (Hint: '.$hint.')'; |
|
288 | 288 | } |
289 | 289 | |
290 | 290 | return new self($message); |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | */ |
315 | 315 | public static function reflectionFailure($entity, \ReflectionException $previousException) |
316 | 316 | { |
317 | - return new self('An error occurred in ' . $entity, 0, $previousException); |
|
317 | + return new self('An error occurred in '.$entity, 0, $previousException); |
|
318 | 318 | } |
319 | 319 | |
320 | 320 | /** |
@@ -325,8 +325,8 @@ discard block |
||
325 | 325 | */ |
326 | 326 | public static function joinColumnMustPointToMappedField($className, $joinColumn) |
327 | 327 | { |
328 | - return new self('The column ' . $joinColumn . ' must be mapped to a field in class ' |
|
329 | - . $className . ' since it is referenced by a join column of another class.'); |
|
328 | + return new self('The column '.$joinColumn.' must be mapped to a field in class ' |
|
329 | + . $className.' since it is referenced by a join column of another class.'); |
|
330 | 330 | } |
331 | 331 | |
332 | 332 | /** |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | */ |
432 | 432 | public static function noIdDefined($entity) |
433 | 433 | { |
434 | - return new self('No ID defined for entity ' . $entity); |
|
434 | + return new self('No ID defined for entity '.$entity); |
|
435 | 435 | } |
436 | 436 | |
437 | 437 | /** |
@@ -456,12 +456,12 @@ discard block |
||
456 | 456 | public static function fileMappingDriversRequireConfiguredDirectoryPath($path = null) |
457 | 457 | { |
458 | 458 | if ( ! empty($path)) { |
459 | - $path = '[' . $path . ']'; |
|
459 | + $path = '['.$path.']'; |
|
460 | 460 | } |
461 | 461 | |
462 | 462 | return new self( |
463 | - 'File mapping drivers must have a valid directory path, ' . |
|
464 | - 'however the given path ' . $path . ' seems to be incorrect!' |
|
463 | + 'File mapping drivers must have a valid directory path, '. |
|
464 | + 'however the given path '.$path.' seems to be incorrect!' |
|
465 | 465 | ); |
466 | 466 | } |
467 | 467 | |
@@ -492,11 +492,11 @@ discard block |
||
492 | 492 | public static function duplicateDiscriminatorEntry($className, array $entries, array $map) |
493 | 493 | { |
494 | 494 | return new self( |
495 | - "The entries " . implode(', ', $entries) . " in discriminator map of class '" . $className . "' is duplicated. " . |
|
496 | - "If the discriminator map is automatically generated you have to convert it to an explicit discriminator map now. " . |
|
497 | - "The entries of the current map are: @DiscriminatorMap({" . implode(', ', array_map( |
|
495 | + "The entries ".implode(', ', $entries)." in discriminator map of class '".$className."' is duplicated. ". |
|
496 | + "If the discriminator map is automatically generated you have to convert it to an explicit discriminator map now. ". |
|
497 | + "The entries of the current map are: @DiscriminatorMap({".implode(', ', array_map( |
|
498 | 498 | function($a, $b) { return "'$a': '$b'"; }, array_keys($map), array_values($map) |
499 | - )) . "})" |
|
499 | + ))."})" |
|
500 | 500 | ); |
501 | 501 | } |
502 | 502 | |
@@ -643,7 +643,7 @@ discard block |
||
643 | 643 | public static function illegalOrphanRemoval($className, $field) |
644 | 644 | { |
645 | 645 | return new self("Orphan removal is only allowed on one-to-one and one-to-many ". |
646 | - "associations, but " . $className."#" .$field . " is not."); |
|
646 | + "associations, but ".$className."#".$field." is not."); |
|
647 | 647 | } |
648 | 648 | |
649 | 649 | /** |
@@ -675,7 +675,7 @@ discard block |
||
675 | 675 | */ |
676 | 676 | public static function noInheritanceOnMappedSuperClass($className) |
677 | 677 | { |
678 | - return new self("It is not supported to define inheritance information on a mapped superclass '" . $className . "'."); |
|
678 | + return new self("It is not supported to define inheritance information on a mapped superclass '".$className."'."); |
|
679 | 679 | } |
680 | 680 | |
681 | 681 | /** |
@@ -687,8 +687,8 @@ discard block |
||
687 | 687 | public static function mappedClassNotPartOfDiscriminatorMap($className, $rootClassName) |
688 | 688 | { |
689 | 689 | return new self( |
690 | - "Entity '" . $className . "' has to be part of the discriminator map of '" . $rootClassName . "' " . |
|
691 | - "to be properly mapped in the inheritance hierarchy. Alternatively you can make '".$className."' an abstract class " . |
|
690 | + "Entity '".$className."' has to be part of the discriminator map of '".$rootClassName."' ". |
|
691 | + "to be properly mapped in the inheritance hierarchy. Alternatively you can make '".$className."' an abstract class ". |
|
692 | 692 | "to avoid this exception from occurring." |
693 | 693 | ); |
694 | 694 | } |
@@ -701,7 +701,7 @@ discard block |
||
701 | 701 | */ |
702 | 702 | public static function lifecycleCallbackMethodNotFound($className, $methodName) |
703 | 703 | { |
704 | - return new self("Entity '" . $className . "' has no method '" . $methodName . "' to be registered as lifecycle callback."); |
|
704 | + return new self("Entity '".$className."' has no method '".$methodName."' to be registered as lifecycle callback."); |
|
705 | 705 | } |
706 | 706 | |
707 | 707 | /** |
@@ -747,7 +747,7 @@ discard block |
||
747 | 747 | */ |
748 | 748 | public static function invalidFetchMode($className, $annotation) |
749 | 749 | { |
750 | - return new self("Entity '" . $className . "' has a mapping with invalid fetch mode '" . $annotation . "'"); |
|
750 | + return new self("Entity '".$className."' has a mapping with invalid fetch mode '".$annotation."'"); |
|
751 | 751 | } |
752 | 752 | |
753 | 753 | /** |
@@ -757,7 +757,7 @@ discard block |
||
757 | 757 | */ |
758 | 758 | public static function compositeKeyAssignedIdGeneratorRequired($className) |
759 | 759 | { |
760 | - return new self("Entity '". $className . "' has a composite identifier but uses an ID generator other than manually assigning (Identity, Sequence). This is not supported."); |
|
760 | + return new self("Entity '".$className."' has a composite identifier but uses an ID generator other than manually assigning (Identity, Sequence). This is not supported."); |
|
761 | 761 | } |
762 | 762 | |
763 | 763 | /** |
@@ -769,7 +769,7 @@ discard block |
||
769 | 769 | */ |
770 | 770 | public static function invalidTargetEntityClass($targetEntity, $sourceEntity, $associationName) |
771 | 771 | { |
772 | - return new self("The target-entity " . $targetEntity . " cannot be found in '" . $sourceEntity."#".$associationName."'."); |
|
772 | + return new self("The target-entity ".$targetEntity." cannot be found in '".$sourceEntity."#".$associationName."'."); |
|
773 | 773 | } |
774 | 774 | |
775 | 775 | /** |
@@ -781,7 +781,7 @@ discard block |
||
781 | 781 | */ |
782 | 782 | public static function invalidCascadeOption(array $cascades, $className, $propertyName) |
783 | 783 | { |
784 | - $cascades = implode(", ", array_map(function ($e) { return "'" . $e . "'"; }, $cascades)); |
|
784 | + $cascades = implode(", ", array_map(function($e) { return "'".$e."'"; }, $cascades)); |
|
785 | 785 | |
786 | 786 | return new self(sprintf( |
787 | 787 | "You have specified invalid cascade options for %s::$%s: %s; available options: 'remove', 'persist', 'refresh', 'merge', and 'detach'", |
@@ -813,7 +813,7 @@ discard block |
||
813 | 813 | { |
814 | 814 | return new self( |
815 | 815 | sprintf( |
816 | - 'Infinite nesting detected for embedded property %s::%s. ' . |
|
816 | + 'Infinite nesting detected for embedded property %s::%s. '. |
|
817 | 817 | 'You cannot embed an embeddable from the same type inside an embeddable.', |
818 | 818 | $className, |
819 | 819 | $propertyName |
@@ -826,7 +826,7 @@ discard block |
||
826 | 826 | */ |
827 | 827 | public static function fromLibXmlErrors(array $errors) : self |
828 | 828 | { |
829 | - return new self(implode(PHP_EOL, array_map(function (\LibXMLError $error) : string { |
|
829 | + return new self(implode(PHP_EOL, array_map(function(\LibXMLError $error) : string { |
|
830 | 830 | return sprintf( |
831 | 831 | 'libxml error: %s%s:%d', |
832 | 832 | $error->message, |