@@ -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\Exporter; |
| 6 | 6 | |
@@ -11,30 +11,30 @@ discard block |
||
| 11 | 11 | */ |
| 12 | 12 | public function export($value, int $indentationLevel = 0) : string |
| 13 | 13 | { |
| 14 | - if (! is_array($value)) { |
|
| 14 | + if ( ! is_array($value)) { |
|
| 15 | 15 | return var_export($value, true); |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
| 19 | - $longestKey = array_reduce(array_keys($value), function ($k, $v) { |
|
| 19 | + $longestKey = array_reduce(array_keys($value), function($k, $v) { |
|
| 20 | 20 | return (string) (strlen((string) $k) > strlen((string) $v) ? $k : $v); |
| 21 | 21 | }); |
| 22 | 22 | $maxKeyLength = strlen($longestKey) + (is_numeric($longestKey) ? 0 : 2); |
| 23 | 23 | |
| 24 | 24 | $lines = []; |
| 25 | 25 | |
| 26 | - $lines[] = $indentation . '['; |
|
| 26 | + $lines[] = $indentation.'['; |
|
| 27 | 27 | |
| 28 | 28 | foreach ($value as $entryKey => $entryValue) { |
| 29 | 29 | $lines[] = sprintf( |
| 30 | 30 | '%s%s => %s,', |
| 31 | - $indentation . self::INDENTATION, |
|
| 31 | + $indentation.self::INDENTATION, |
|
| 32 | 32 | str_pad(var_export($entryKey, true), $maxKeyLength), |
| 33 | 33 | ltrim($this->export($entryValue, $indentationLevel + 1)) |
| 34 | 34 | ); |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - $lines[] = $indentation . ']'; |
|
| 37 | + $lines[] = $indentation.']'; |
|
| 38 | 38 | |
| 39 | 39 | return implode(PHP_EOL, $lines); |
| 40 | 40 | } |
@@ -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 |
@@ -850,7 +850,7 @@ discard block |
||
| 850 | 850 | { |
| 851 | 851 | return new self( |
| 852 | 852 | sprintf( |
| 853 | - 'Class %s not found in namespaces %s.' . |
|
| 853 | + 'Class %s not found in namespaces %s.'. |
|
| 854 | 854 | $className, |
| 855 | 855 | implode(', ', $namespaces) |
| 856 | 856 | ) |
@@ -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($this->className, $property); |
| 623 | 623 | } |
| 624 | 624 | |
| 625 | - if (! in_array($fieldName, $this->identifier, true)) { |
|
| 625 | + if ( ! in_array($fieldName, $this->identifier, true)) { |
|
| 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, true)) { |
|
| 689 | + if ( ! in_array($property->getName(), $this->identifier, true)) { |
|
| 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, true)) { |
|
| 797 | + if ( ! in_array('remove', $cascades, true)) { |
|
| 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, true)) { |
|
| 870 | + if ( ! in_array('remove', $cascades, true)) { |
|
| 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 | |