@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | $conn = static::$sharedConn; |
347 | 347 | |
348 | 348 | // In case test is skipped, tearDown is called, but no setup may have run |
349 | - if (! $conn) { |
|
349 | + if ( ! $conn) { |
|
350 | 350 | return; |
351 | 351 | } |
352 | 352 | |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | } |
421 | 421 | |
422 | 422 | if (isset($this->usedModelSets['directorytree'])) { |
423 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('file')); |
|
423 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('file')); |
|
424 | 424 | // MySQL doesn't know deferred deletions therefore only executing the second query gives errors. |
425 | 425 | $conn->executeUpdate('DELETE FROM Directory WHERE parentDirectory_id IS NOT NULL'); |
426 | 426 | $conn->executeUpdate('DELETE FROM Directory'); |
@@ -513,12 +513,12 @@ discard block |
||
513 | 513 | ) |
514 | 514 | ); |
515 | 515 | |
516 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-users-groups')); |
|
517 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-group')); |
|
518 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-phone')); |
|
519 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-user')); |
|
520 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-address')); |
|
521 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-city')); |
|
516 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-users-groups')); |
|
517 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-group')); |
|
518 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-phone')); |
|
519 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-user')); |
|
520 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-address')); |
|
521 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-city')); |
|
522 | 522 | } |
523 | 523 | |
524 | 524 | if (isset($this->usedModelSets['vct_onetoone'])) { |
@@ -630,7 +630,7 @@ discard block |
||
630 | 630 | $classes = []; |
631 | 631 | |
632 | 632 | foreach ($classNames as $className) { |
633 | - if (! isset(static::$entityTablesCreated[$className])) { |
|
633 | + if ( ! isset(static::$entityTablesCreated[$className])) { |
|
634 | 634 | static::$entityTablesCreated[$className] = true; |
635 | 635 | $classes[] = $this->em->getClassMetadata($className); |
636 | 636 | } |
@@ -649,25 +649,25 @@ discard block |
||
649 | 649 | { |
650 | 650 | $this->setUpDBALTypes(); |
651 | 651 | |
652 | - if (! isset(static::$sharedConn)) { |
|
652 | + if ( ! isset(static::$sharedConn)) { |
|
653 | 653 | static::$sharedConn = TestUtil::getConnection(); |
654 | 654 | } |
655 | 655 | |
656 | 656 | if (isset($GLOBALS['DOCTRINE_MARK_SQL_LOGS'])) { |
657 | 657 | if (in_array(static::$sharedConn->getDatabasePlatform()->getName(), ['mysql', 'postgresql'], true)) { |
658 | - static::$sharedConn->executeQuery('SELECT 1 /*' . static::class . '*/'); |
|
658 | + static::$sharedConn->executeQuery('SELECT 1 /*'.static::class.'*/'); |
|
659 | 659 | } elseif (static::$sharedConn->getDatabasePlatform()->getName() === 'oracle') { |
660 | - static::$sharedConn->executeQuery('SELECT 1 /*' . static::class . '*/ FROM dual'); |
|
660 | + static::$sharedConn->executeQuery('SELECT 1 /*'.static::class.'*/ FROM dual'); |
|
661 | 661 | } |
662 | 662 | } |
663 | 663 | |
664 | - if (! $this->em) { |
|
664 | + if ( ! $this->em) { |
|
665 | 665 | $this->em = $this->getEntityManager(); |
666 | 666 | $this->schemaTool = new SchemaTool($this->em); |
667 | 667 | } |
668 | 668 | |
669 | 669 | foreach ($this->usedModelSets as $setName => $bool) { |
670 | - if (! isset(static::$tablesCreated[$setName])) { |
|
670 | + if ( ! isset(static::$tablesCreated[$setName])) { |
|
671 | 671 | $this->setUpEntitySchema(static::$modelSets[$setName]); |
672 | 672 | |
673 | 673 | static::$tablesCreated[$setName] = true; |
@@ -742,8 +742,8 @@ discard block |
||
742 | 742 | |
743 | 743 | $config->setMetadataDriverImpl( |
744 | 744 | $mappingDriver ?? $config->newDefaultAnnotationDriver([ |
745 | - realpath(__DIR__ . '/Models/Cache'), |
|
746 | - realpath(__DIR__ . '/Models/GeoNames'), |
|
745 | + realpath(__DIR__.'/Models/Cache'), |
|
746 | + realpath(__DIR__.'/Models/GeoNames'), |
|
747 | 747 | ]) |
748 | 748 | ); |
749 | 749 | |
@@ -791,13 +791,13 @@ discard block |
||
791 | 791 | |
792 | 792 | foreach ($last25queries as $i => $query) { |
793 | 793 | $params = array_map( |
794 | - static function ($p) { |
|
794 | + static function($p) { |
|
795 | 795 | return is_object($p) ? get_class($p) : var_export($p, true); |
796 | 796 | }, |
797 | 797 | $query['params'] ?: [] |
798 | 798 | ); |
799 | 799 | |
800 | - $queries .= $i . ". SQL: '" . $query['sql'] . "' Params: " . implode(', ', $params) . PHP_EOL; |
|
800 | + $queries .= $i.". SQL: '".$query['sql']."' Params: ".implode(', ', $params).PHP_EOL; |
|
801 | 801 | } |
802 | 802 | |
803 | 803 | $trace = $e->getTrace(); |
@@ -810,11 +810,11 @@ discard block |
||
810 | 810 | break; |
811 | 811 | } |
812 | 812 | |
813 | - $traceMsg .= $part['file'] . ':' . $part['line'] . PHP_EOL; |
|
813 | + $traceMsg .= $part['file'].':'.$part['line'].PHP_EOL; |
|
814 | 814 | } |
815 | 815 | } |
816 | 816 | |
817 | - $message = '[' . get_class($e) . '] ' . $e->getMessage() . PHP_EOL . PHP_EOL . 'With queries:' . PHP_EOL . $queries . PHP_EOL . 'Trace:' . PHP_EOL . $traceMsg; |
|
817 | + $message = '['.get_class($e).'] '.$e->getMessage().PHP_EOL.PHP_EOL.'With queries:'.PHP_EOL.$queries.PHP_EOL.'Trace:'.PHP_EOL.$traceMsg; |
|
818 | 818 | |
819 | 819 | throw new Exception($message, (int) $e->getCode(), $e); |
820 | 820 | } |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | */ |
24 | 24 | public static function pathRequired() |
25 | 25 | { |
26 | - return new self('Specifying the paths to your entities is required ' . |
|
26 | + return new self('Specifying the paths to your entities is required '. |
|
27 | 27 | 'in the AnnotationDriver to retrieve all class names.'); |
28 | 28 | } |
29 | 29 | |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | */ |
214 | 214 | public static function missingQueryMapping($entity, $queryName) |
215 | 215 | { |
216 | - return new self('Query named "' . $queryName . '" in "' . $entity . ' requires a result class or result set mapping.'); |
|
216 | + return new self('Query named "'.$queryName.'" in "'.$entity.' requires a result class or result set mapping.'); |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | /** |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | */ |
225 | 225 | public static function missingResultSetMappingEntity($entity, $resultName) |
226 | 226 | { |
227 | - return new self('Result set mapping named "' . $resultName . '" in "' . $entity . ' requires a entity class name.'); |
|
227 | + return new self('Result set mapping named "'.$resultName.'" in "'.$entity.' requires a entity class name.'); |
|
228 | 228 | } |
229 | 229 | |
230 | 230 | /** |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | */ |
236 | 236 | public static function missingResultSetMappingFieldName($entity, $resultName) |
237 | 237 | { |
238 | - return new self('Result set mapping named "' . $resultName . '" in "' . $entity . ' requires a field name.'); |
|
238 | + return new self('Result set mapping named "'.$resultName.'" in "'.$entity.' requires a field name.'); |
|
239 | 239 | } |
240 | 240 | |
241 | 241 | /** |
@@ -282,8 +282,8 @@ discard block |
||
282 | 282 | { |
283 | 283 | $message = sprintf("The mapping of field '%s' is invalid: The option '%s' is required.", $field, $expectedOption); |
284 | 284 | |
285 | - if (! empty($hint)) { |
|
286 | - $message .= ' (Hint: ' . $hint . ')'; |
|
285 | + if ( ! empty($hint)) { |
|
286 | + $message .= ' (Hint: '.$hint.')'; |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | return new self($message); |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | */ |
313 | 313 | public static function reflectionFailure($entity, ReflectionException $previousException) |
314 | 314 | { |
315 | - return new self('An error occurred in ' . $entity, 0, $previousException); |
|
315 | + return new self('An error occurred in '.$entity, 0, $previousException); |
|
316 | 316 | } |
317 | 317 | |
318 | 318 | /** |
@@ -323,8 +323,8 @@ discard block |
||
323 | 323 | */ |
324 | 324 | public static function joinColumnMustPointToMappedField($className, $joinColumn) |
325 | 325 | { |
326 | - return new self('The column ' . $joinColumn . ' must be mapped to a field in class ' |
|
327 | - . $className . ' since it is referenced by a join column of another class.'); |
|
326 | + return new self('The column '.$joinColumn.' must be mapped to a field in class ' |
|
327 | + . $className.' since it is referenced by a join column of another class.'); |
|
328 | 328 | } |
329 | 329 | |
330 | 330 | /** |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | */ |
359 | 359 | public static function propertyTypeIsRequired($className, $propertyName) |
360 | 360 | { |
361 | - return new self("The attribute 'type' is required for the column description of property " . $className . '::$' . $propertyName . '.'); |
|
361 | + return new self("The attribute 'type' is required for the column description of property ".$className.'::$'.$propertyName.'.'); |
|
362 | 362 | } |
363 | 363 | |
364 | 364 | /** |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | */ |
369 | 369 | public static function tableIdGeneratorNotImplemented($className) |
370 | 370 | { |
371 | - return new self('TableIdGenerator is not yet implemented for use with class ' . $className); |
|
371 | + return new self('TableIdGenerator is not yet implemented for use with class '.$className); |
|
372 | 372 | } |
373 | 373 | |
374 | 374 | /** |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | */ |
395 | 395 | public static function duplicateQueryMapping($entity, $queryName) |
396 | 396 | { |
397 | - return new self('Query named "' . $queryName . '" in "' . $entity . '" was already declared, but it must be declared only once'); |
|
397 | + return new self('Query named "'.$queryName.'" in "'.$entity.'" was already declared, but it must be declared only once'); |
|
398 | 398 | } |
399 | 399 | |
400 | 400 | /** |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | */ |
406 | 406 | public static function duplicateResultSetMapping($entity, $resultName) |
407 | 407 | { |
408 | - return new self('Result set mapping named "' . $resultName . '" in "' . $entity . '" was already declared, but it must be declared only once'); |
|
408 | + return new self('Result set mapping named "'.$resultName.'" in "'.$entity.'" was already declared, but it must be declared only once'); |
|
409 | 409 | } |
410 | 410 | |
411 | 411 | /** |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | */ |
416 | 416 | public static function singleIdNotAllowedOnCompositePrimaryKey($entity) |
417 | 417 | { |
418 | - return new self('Single id is not allowed on composite primary key in entity ' . $entity); |
|
418 | + return new self('Single id is not allowed on composite primary key in entity '.$entity); |
|
419 | 419 | } |
420 | 420 | |
421 | 421 | /** |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | */ |
426 | 426 | public static function noIdDefined($entity) |
427 | 427 | { |
428 | - return new self('No ID defined for entity ' . $entity); |
|
428 | + return new self('No ID defined for entity '.$entity); |
|
429 | 429 | } |
430 | 430 | |
431 | 431 | /** |
@@ -435,7 +435,7 @@ discard block |
||
435 | 435 | */ |
436 | 436 | public static function unsupportedOptimisticLockingType($unsupportedType) |
437 | 437 | { |
438 | - return new self('Locking type "' . $unsupportedType->getName() . '" is not supported by Doctrine.'); |
|
438 | + return new self('Locking type "'.$unsupportedType->getName().'" is not supported by Doctrine.'); |
|
439 | 439 | } |
440 | 440 | |
441 | 441 | /** |
@@ -445,13 +445,13 @@ discard block |
||
445 | 445 | */ |
446 | 446 | public static function fileMappingDriversRequireConfiguredDirectoryPath($path = null) |
447 | 447 | { |
448 | - if (! empty($path)) { |
|
449 | - $path = '[' . $path . ']'; |
|
448 | + if ( ! empty($path)) { |
|
449 | + $path = '['.$path.']'; |
|
450 | 450 | } |
451 | 451 | |
452 | 452 | return new self( |
453 | - 'File mapping drivers must have a valid directory path, ' . |
|
454 | - 'however the given path ' . $path . ' seems to be incorrect!' |
|
453 | + 'File mapping drivers must have a valid directory path, '. |
|
454 | + 'however the given path '.$path.' seems to be incorrect!' |
|
455 | 455 | ); |
456 | 456 | } |
457 | 457 | |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | public static function invalidClassInDiscriminatorMap($className, $owningClass) |
468 | 468 | { |
469 | 469 | return new self(sprintf( |
470 | - "Entity class '%s' used in the discriminator map of class '%s' " . |
|
470 | + "Entity class '%s' used in the discriminator map of class '%s' ". |
|
471 | 471 | 'does not exist.', |
472 | 472 | $className, |
473 | 473 | $owningClass |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | public static function sqlConversionNotAllowedForPrimaryKeyProperties($className, Property $property) |
534 | 534 | { |
535 | 535 | return new self(sprintf( |
536 | - 'It is not possible to set id field "%s" to type "%s" in entity class "%s". ' . |
|
536 | + 'It is not possible to set id field "%s" to type "%s" in entity class "%s". '. |
|
537 | 537 | 'The type "%s" requires conversion SQL which is not allowed for identifiers.', |
538 | 538 | $property->getName(), |
539 | 539 | $property->getTypeName(), |
@@ -569,7 +569,7 @@ discard block |
||
569 | 569 | */ |
570 | 570 | public static function duplicateColumnName($className, $columnName) |
571 | 571 | { |
572 | - return new self("Duplicate definition of column '" . $columnName . "' on entity '" . $className . "' in a field or discriminator column mapping."); |
|
572 | + return new self("Duplicate definition of column '".$columnName."' on entity '".$className."' in a field or discriminator column mapping."); |
|
573 | 573 | } |
574 | 574 | |
575 | 575 | /** |
@@ -580,7 +580,7 @@ discard block |
||
580 | 580 | */ |
581 | 581 | public static function illegalToManyAssociationOnMappedSuperclass($className, $field) |
582 | 582 | { |
583 | - return new self("It is illegal to put an inverse side one-to-many or many-to-many association on mapped superclass '" . $className . '#' . $field . "'."); |
|
583 | + return new self("It is illegal to put an inverse side one-to-many or many-to-many association on mapped superclass '".$className.'#'.$field."'."); |
|
584 | 584 | } |
585 | 585 | |
586 | 586 | /** |
@@ -592,8 +592,8 @@ discard block |
||
592 | 592 | */ |
593 | 593 | public static function cannotMapCompositePrimaryKeyEntitiesAsForeignId($className, $targetEntity, $targetField) |
594 | 594 | { |
595 | - return new self("It is not possible to map entity '" . $className . "' with a composite primary key " . |
|
596 | - "as part of the primary key of another entity '" . $targetEntity . '#' . $targetField . "'."); |
|
595 | + return new self("It is not possible to map entity '".$className."' with a composite primary key ". |
|
596 | + "as part of the primary key of another entity '".$targetEntity.'#'.$targetField."'."); |
|
597 | 597 | } |
598 | 598 | |
599 | 599 | /** |
@@ -647,8 +647,8 @@ discard block |
||
647 | 647 | */ |
648 | 648 | public static function illegalOrphanRemoval($className, $field) |
649 | 649 | { |
650 | - return new self('Orphan removal is only allowed on one-to-one and one-to-many ' . |
|
651 | - 'associations, but ' . $className . '#' . $field . ' is not.'); |
|
650 | + return new self('Orphan removal is only allowed on one-to-one and one-to-many '. |
|
651 | + 'associations, but '.$className.'#'.$field.' is not.'); |
|
652 | 652 | } |
653 | 653 | |
654 | 654 | /** |
@@ -680,7 +680,7 @@ discard block |
||
680 | 680 | */ |
681 | 681 | public static function noInheritanceOnMappedSuperClass($className) |
682 | 682 | { |
683 | - return new self("It is not supported to define inheritance information on a mapped superclass '" . $className . "'."); |
|
683 | + return new self("It is not supported to define inheritance information on a mapped superclass '".$className."'."); |
|
684 | 684 | } |
685 | 685 | |
686 | 686 | /** |
@@ -692,8 +692,8 @@ discard block |
||
692 | 692 | public static function mappedClassNotPartOfDiscriminatorMap($className, $rootClassName) |
693 | 693 | { |
694 | 694 | return new self( |
695 | - "Entity '" . $className . "' has to be part of the discriminator map of '" . $rootClassName . "' " . |
|
696 | - "to be properly mapped in the inheritance hierarchy. Alternatively you can make '" . $className . "' an abstract class " . |
|
695 | + "Entity '".$className."' has to be part of the discriminator map of '".$rootClassName."' ". |
|
696 | + "to be properly mapped in the inheritance hierarchy. Alternatively you can make '".$className."' an abstract class ". |
|
697 | 697 | 'to avoid this exception from occurring.' |
698 | 698 | ); |
699 | 699 | } |
@@ -706,7 +706,7 @@ discard block |
||
706 | 706 | */ |
707 | 707 | public static function lifecycleCallbackMethodNotFound($className, $methodName) |
708 | 708 | { |
709 | - return new self("Entity '" . $className . "' has no method '" . $methodName . "' to be registered as lifecycle callback."); |
|
709 | + return new self("Entity '".$className."' has no method '".$methodName."' to be registered as lifecycle callback."); |
|
710 | 710 | } |
711 | 711 | |
712 | 712 | /** |
@@ -752,7 +752,7 @@ discard block |
||
752 | 752 | */ |
753 | 753 | public static function invalidFetchMode($className, $annotation) |
754 | 754 | { |
755 | - return new self("Entity '" . $className . "' has a mapping with invalid fetch mode '" . $annotation . "'"); |
|
755 | + return new self("Entity '".$className."' has a mapping with invalid fetch mode '".$annotation."'"); |
|
756 | 756 | } |
757 | 757 | |
758 | 758 | /** |
@@ -762,7 +762,7 @@ discard block |
||
762 | 762 | */ |
763 | 763 | public static function compositeKeyAssignedIdGeneratorRequired($className) |
764 | 764 | { |
765 | - return new self("Entity '" . $className . "' has a composite identifier but uses an ID generator other than manually assigning (Identity, Sequence). This is not supported."); |
|
765 | + return new self("Entity '".$className."' has a composite identifier but uses an ID generator other than manually assigning (Identity, Sequence). This is not supported."); |
|
766 | 766 | } |
767 | 767 | |
768 | 768 | /** |
@@ -774,7 +774,7 @@ discard block |
||
774 | 774 | */ |
775 | 775 | public static function invalidTargetEntityClass($targetEntity, $sourceEntity, $associationName) |
776 | 776 | { |
777 | - return new self("The target-entity '" . $targetEntity . "' cannot be found in '" . $sourceEntity . '#' . $associationName . "'."); |
|
777 | + return new self("The target-entity '".$targetEntity."' cannot be found in '".$sourceEntity.'#'.$associationName."'."); |
|
778 | 778 | } |
779 | 779 | |
780 | 780 | /** |
@@ -786,8 +786,8 @@ discard block |
||
786 | 786 | */ |
787 | 787 | public static function invalidCascadeOption(array $cascades, $className, $propertyName) |
788 | 788 | { |
789 | - $cascades = implode(', ', array_map(static function ($e) { |
|
790 | - return "'" . $e . "'"; |
|
789 | + $cascades = implode(', ', array_map(static function($e) { |
|
790 | + return "'".$e."'"; |
|
791 | 791 | }, $cascades)); |
792 | 792 | |
793 | 793 | return new self(sprintf( |
@@ -820,7 +820,7 @@ discard block |
||
820 | 820 | { |
821 | 821 | return new self( |
822 | 822 | sprintf( |
823 | - 'Infinite nesting detected for embedded property %s::%s. ' . |
|
823 | + 'Infinite nesting detected for embedded property %s::%s. '. |
|
824 | 824 | 'You cannot embed an embeddable from the same type inside an embeddable.', |
825 | 825 | $className, |
826 | 826 | $propertyName |
@@ -835,7 +835,7 @@ discard block |
||
835 | 835 | { |
836 | 836 | return new self( |
837 | 837 | sprintf( |
838 | - 'Class %s not found in namespaces %s.' . |
|
838 | + 'Class %s not found in namespaces %s.'. |
|
839 | 839 | $className, |
840 | 840 | implode(', ', $namespaces) |
841 | 841 | ) |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | } |
110 | 110 | |
111 | 111 | foreach ($data as $columnName => $value) { |
112 | - if (! is_array($id) || ! isset($id[$columnName])) { |
|
112 | + if ( ! is_array($id) || ! isset($id[$columnName])) { |
|
113 | 113 | $type = $this->columns[$columnName]->getType(); |
114 | 114 | |
115 | 115 | $stmt->bindValue($paramIndex++, $value, $type); |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | { |
134 | 134 | $updateData = $this->prepareUpdateData($entity); |
135 | 135 | |
136 | - if (! $updateData) { |
|
136 | + if ( ! $updateData) { |
|
137 | 137 | return; |
138 | 138 | } |
139 | 139 | |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $versionedClass = $this->class->versionProperty->getDeclaringClass(); |
152 | 152 | $versionedTable = $versionedClass->getTableName(); |
153 | 153 | |
154 | - if (! isset($updateData[$versionedTable])) { |
|
154 | + if ( ! isset($updateData[$versionedTable])) { |
|
155 | 155 | $tableName = $versionedClass->table->getQuotedQualifiedName($this->platform); |
156 | 156 | |
157 | 157 | $this->updateTable($entity, $tableName, [], true); |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | |
233 | 233 | if ($filterSql) { |
234 | 234 | $conditionSql .= $conditionSql |
235 | - ? ' AND ' . $filterSql |
|
235 | + ? ' AND '.$filterSql |
|
236 | 236 | : $filterSql; |
237 | 237 | } |
238 | 238 | |
@@ -240,26 +240,26 @@ discard block |
||
240 | 240 | |
241 | 241 | switch ($lockMode) { |
242 | 242 | case LockMode::PESSIMISTIC_READ: |
243 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
243 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
244 | 244 | break; |
245 | 245 | |
246 | 246 | case LockMode::PESSIMISTIC_WRITE: |
247 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
247 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
248 | 248 | break; |
249 | 249 | } |
250 | 250 | |
251 | 251 | $tableName = $this->class->table->getQuotedQualifiedName($this->platform); |
252 | - $from = ' FROM ' . $tableName . ' ' . $baseTableAlias; |
|
253 | - $where = $conditionSql !== '' ? ' WHERE ' . $conditionSql : ''; |
|
252 | + $from = ' FROM '.$tableName.' '.$baseTableAlias; |
|
253 | + $where = $conditionSql !== '' ? ' WHERE '.$conditionSql : ''; |
|
254 | 254 | $lock = $this->platform->appendLockHint($from, $lockMode); |
255 | 255 | $columnList = $this->getSelectColumnsSQL(); |
256 | - $query = 'SELECT ' . $columnList |
|
256 | + $query = 'SELECT '.$columnList |
|
257 | 257 | . $lock |
258 | 258 | . $joinSql |
259 | 259 | . $where |
260 | 260 | . $orderBySql; |
261 | 261 | |
262 | - return $this->platform->modifyLimitQuery($query, $limit, $offset ?? 0) . $lockSql; |
|
262 | + return $this->platform->modifyLimitQuery($query, $limit, $offset ?? 0).$lockSql; |
|
263 | 263 | } |
264 | 264 | |
265 | 265 | /** |
@@ -281,14 +281,14 @@ discard block |
||
281 | 281 | |
282 | 282 | if ($filterSql !== '') { |
283 | 283 | $conditionSql = $conditionSql |
284 | - ? $conditionSql . ' AND ' . $filterSql |
|
284 | + ? $conditionSql.' AND '.$filterSql |
|
285 | 285 | : $filterSql; |
286 | 286 | } |
287 | 287 | |
288 | 288 | return 'SELECT COUNT(*) ' |
289 | - . 'FROM ' . $tableName . ' ' . $baseTableAlias |
|
289 | + . 'FROM '.$tableName.' '.$baseTableAlias |
|
290 | 290 | . $joinSql |
291 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
291 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
292 | 292 | } |
293 | 293 | |
294 | 294 | /** |
@@ -307,18 +307,18 @@ discard block |
||
307 | 307 | $conditions = []; |
308 | 308 | $tableName = $parentClass->table->getQuotedQualifiedName($this->platform); |
309 | 309 | $tableAlias = $this->getSQLTableAlias($parentClass->getTableName()); |
310 | - $joinSql .= ' INNER JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
310 | + $joinSql .= ' INNER JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
311 | 311 | |
312 | 312 | foreach ($identifierColumns as $idColumn) { |
313 | 313 | $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName()); |
314 | 314 | |
315 | - $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
315 | + $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
316 | 316 | } |
317 | 317 | |
318 | 318 | $joinSql .= implode(' AND ', $conditions); |
319 | 319 | } |
320 | 320 | |
321 | - return parent::getLockTablesSql($lockMode) . $joinSql; |
|
321 | + return parent::getLockTablesSql($lockMode).$joinSql; |
|
322 | 322 | } |
323 | 323 | |
324 | 324 | /** |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | continue; |
346 | 346 | } |
347 | 347 | |
348 | - if (! ($property instanceof ToOneAssociationMetadata) || ! $property->isOwningSide()) { |
|
348 | + if ( ! ($property instanceof ToOneAssociationMetadata) || ! $property->isOwningSide()) { |
|
349 | 349 | continue; |
350 | 350 | } |
351 | 351 | |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | /** @var JoinColumnMetadata $joinColumn */ |
356 | 356 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
357 | 357 | |
358 | - if (! $joinColumn->getType()) { |
|
358 | + if ( ! $joinColumn->getType()) { |
|
359 | 359 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
360 | 360 | } |
361 | 361 | |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | $this->currentPersisterContext->rsm->setDiscriminatorColumn('r', $resultColumnName); |
375 | 375 | $this->currentPersisterContext->rsm->addMetaResult('r', $resultColumnName, $discrColumnName, false, $discrColumnType); |
376 | 376 | |
377 | - $columnList[] = $discrColumnType->convertToDatabaseValueSQL($discrTableAlias . '.' . $quotedColumnName, $this->platform); |
|
377 | + $columnList[] = $discrColumnType->convertToDatabaseValueSQL($discrTableAlias.'.'.$quotedColumnName, $this->platform); |
|
378 | 378 | |
379 | 379 | // sub tables |
380 | 380 | foreach ($this->class->getSubClasses() as $subClassName) { |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | /** @var JoinColumnMetadata $joinColumn */ |
399 | 399 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
400 | 400 | |
401 | - if (! $joinColumn->getType()) { |
|
401 | + if ( ! $joinColumn->getType()) { |
|
402 | 402 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
403 | 403 | } |
404 | 404 | |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | $columnName = $joinColumn->getColumnName(); |
449 | 449 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
450 | 450 | |
451 | - if (! $joinColumn->getType()) { |
|
451 | + if ( ! $joinColumn->getType()) { |
|
452 | 452 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
453 | 453 | } |
454 | 454 | |
@@ -504,12 +504,12 @@ discard block |
||
504 | 504 | $conditions = []; |
505 | 505 | $tableName = $parentClass->table->getQuotedQualifiedName($this->platform); |
506 | 506 | $tableAlias = $this->getSQLTableAlias($parentClass->getTableName()); |
507 | - $joinSql .= ' INNER JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
507 | + $joinSql .= ' INNER JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
508 | 508 | |
509 | 509 | foreach ($identifierColumns as $idColumn) { |
510 | 510 | $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName()); |
511 | 511 | |
512 | - $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
512 | + $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
513 | 513 | } |
514 | 514 | |
515 | 515 | $joinSql .= implode(' AND ', $conditions); |
@@ -521,12 +521,12 @@ discard block |
||
521 | 521 | $subClass = $this->em->getClassMetadata($subClassName); |
522 | 522 | $tableName = $subClass->table->getQuotedQualifiedName($this->platform); |
523 | 523 | $tableAlias = $this->getSQLTableAlias($subClass->getTableName()); |
524 | - $joinSql .= ' LEFT JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
524 | + $joinSql .= ' LEFT JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
525 | 525 | |
526 | 526 | foreach ($identifierColumns as $idColumn) { |
527 | 527 | $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName()); |
528 | 528 | |
529 | - $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
529 | + $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
530 | 530 | } |
531 | 531 | |
532 | 532 | $joinSql .= implode(' AND ', $conditions); |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | |
341 | 341 | $this->computeChangeSets(); |
342 | 342 | |
343 | - if (! ($this->entityInsertions || |
|
343 | + if ( ! ($this->entityInsertions || |
|
344 | 344 | $this->entityDeletions || |
345 | 345 | $this->entityUpdates || |
346 | 346 | $this->collectionUpdates || |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | // Entity deletions come last and need to be in reverse commit order |
400 | 400 | if ($this->entityDeletions) { |
401 | 401 | foreach (array_reverse($commitOrder) as $committedEntityName) { |
402 | - if (! $this->entityDeletions) { |
|
402 | + if ( ! $this->entityDeletions) { |
|
403 | 403 | break; // just a performance optimisation |
404 | 404 | } |
405 | 405 | |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | $oid = spl_object_id($entity); |
480 | 480 | $data = []; |
481 | 481 | |
482 | - if (! isset($this->entityChangeSets[$oid])) { |
|
482 | + if ( ! isset($this->entityChangeSets[$oid])) { |
|
483 | 483 | return $data; |
484 | 484 | } |
485 | 485 | |
@@ -559,12 +559,12 @@ discard block |
||
559 | 559 | || ! $class->getProperty($name) instanceof FieldMetadata |
560 | 560 | || ! $class->getProperty($name)->hasValueGenerator() |
561 | 561 | || $class->getProperty($name)->getValueGenerator()->getType() !== GeneratorType::IDENTITY |
562 | - ) && (! $class->isVersioned() || $name !== $class->versionProperty->getName())) { |
|
562 | + ) && ( ! $class->isVersioned() || $name !== $class->versionProperty->getName())) { |
|
563 | 563 | $actualData[$name] = $value; |
564 | 564 | } |
565 | 565 | } |
566 | 566 | |
567 | - if (! isset($this->originalEntityData[$oid])) { |
|
567 | + if ( ! isset($this->originalEntityData[$oid])) { |
|
568 | 568 | // Entity is either NEW or MANAGED but not yet fully persisted (only has an id). |
569 | 569 | // These result in an INSERT. |
570 | 570 | $this->originalEntityData[$oid] = $actualData; |
@@ -591,7 +591,7 @@ discard block |
||
591 | 591 | |
592 | 592 | foreach ($actualData as $propName => $actualValue) { |
593 | 593 | // skip field, its a partially omitted one! |
594 | - if (! (isset($originalData[$propName]) || array_key_exists($propName, $originalData))) { |
|
594 | + if ( ! (isset($originalData[$propName]) || array_key_exists($propName, $originalData))) { |
|
595 | 595 | continue; |
596 | 596 | } |
597 | 597 | |
@@ -613,7 +613,7 @@ discard block |
||
613 | 613 | if ($owner === null) { // cloned |
614 | 614 | $actualValue->setOwner($entity, $property); |
615 | 615 | } elseif ($owner !== $entity) { // no clone, we have to fix |
616 | - if (! $actualValue->isInitialized()) { |
|
616 | + if ( ! $actualValue->isInitialized()) { |
|
617 | 617 | $actualValue->initialize(); // we have to do this otherwise the cols share state |
618 | 618 | } |
619 | 619 | |
@@ -651,7 +651,7 @@ discard block |
||
651 | 651 | // Check if original value exists |
652 | 652 | if ($orgValue instanceof PersistentCollection) { |
653 | 653 | // A PersistentCollection was de-referenced, so delete it. |
654 | - if (! $this->isCollectionScheduledForDeletion($orgValue)) { |
|
654 | + if ( ! $this->isCollectionScheduledForDeletion($orgValue)) { |
|
655 | 655 | $this->scheduleCollectionDeletion($orgValue); |
656 | 656 | |
657 | 657 | $changeSet[$propName] = $orgValue; // Signal changeset, to-many associations will be ignored |
@@ -674,7 +674,7 @@ discard block |
||
674 | 674 | |
675 | 675 | // Look for changes in associations of the entity |
676 | 676 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
677 | - if (! $property instanceof AssociationMetadata) { |
|
677 | + if ( ! $property instanceof AssociationMetadata) { |
|
678 | 678 | continue; |
679 | 679 | } |
680 | 680 | |
@@ -741,7 +741,7 @@ discard block |
||
741 | 741 | // Only MANAGED entities that are NOT SCHEDULED FOR INSERTION OR DELETION are processed here. |
742 | 742 | $oid = spl_object_id($entity); |
743 | 743 | |
744 | - if (! isset($this->entityInsertions[$oid]) && ! isset($this->entityDeletions[$oid]) && isset($this->entityStates[$oid])) { |
|
744 | + if ( ! isset($this->entityInsertions[$oid]) && ! isset($this->entityDeletions[$oid]) && isset($this->entityStates[$oid])) { |
|
745 | 745 | $this->computeChangeSet($class, $entity); |
746 | 746 | } |
747 | 747 | } |
@@ -778,13 +778,13 @@ discard block |
||
778 | 778 | $targetClass = $this->em->getClassMetadata($targetEntity); |
779 | 779 | |
780 | 780 | foreach ($unwrappedValue as $key => $entry) { |
781 | - if (! ($entry instanceof $targetEntity)) { |
|
781 | + if ( ! ($entry instanceof $targetEntity)) { |
|
782 | 782 | throw ORMInvalidArgumentException::invalidAssociation($targetClass, $association, $entry); |
783 | 783 | } |
784 | 784 | |
785 | 785 | $state = $this->getEntityState($entry, self::STATE_NEW); |
786 | 786 | |
787 | - if (! ($entry instanceof $targetEntity)) { |
|
787 | + if ( ! ($entry instanceof $targetEntity)) { |
|
788 | 788 | throw UnexpectedAssociationValue::create( |
789 | 789 | $association->getSourceEntity(), |
790 | 790 | $association->getName(), |
@@ -795,7 +795,7 @@ discard block |
||
795 | 795 | |
796 | 796 | switch ($state) { |
797 | 797 | case self::STATE_NEW: |
798 | - if (! in_array('persist', $association->getCascade(), true)) { |
|
798 | + if ( ! in_array('persist', $association->getCascade(), true)) { |
|
799 | 799 | $this->nonCascadedNewDetectedEntities[spl_object_id($entry)] = [$association, $entry]; |
800 | 800 | |
801 | 801 | break; |
@@ -844,7 +844,7 @@ discard block |
||
844 | 844 | $persister = $this->getEntityPersister($class->getClassName()); |
845 | 845 | $generationPlan->executeImmediate($this->em, $entity); |
846 | 846 | |
847 | - if (! $generationPlan->containsDeferred()) { |
|
847 | + if ( ! $generationPlan->containsDeferred()) { |
|
848 | 848 | $id = $this->em->getIdentifierFlattener()->flattenIdentifier($class, $persister->getIdentifier($entity)); |
849 | 849 | $this->entityIdentifiers[$oid] = $id; |
850 | 850 | } |
@@ -875,7 +875,7 @@ discard block |
||
875 | 875 | { |
876 | 876 | $oid = spl_object_id($entity); |
877 | 877 | |
878 | - if (! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) { |
|
878 | + if ( ! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) { |
|
879 | 879 | throw ORMInvalidArgumentException::entityNotManaged($entity); |
880 | 880 | } |
881 | 881 | |
@@ -897,7 +897,7 @@ discard block |
||
897 | 897 | break; |
898 | 898 | |
899 | 899 | case $property instanceof FieldMetadata: |
900 | - if (! $property->isPrimaryKey() |
|
900 | + if ( ! $property->isPrimaryKey() |
|
901 | 901 | || ! $property->getValueGenerator() |
902 | 902 | || $property->getValueGenerator()->getType() !== GeneratorType::IDENTITY) { |
903 | 903 | $actualData[$name] = $property->getValue($entity); |
@@ -911,7 +911,7 @@ discard block |
||
911 | 911 | } |
912 | 912 | } |
913 | 913 | |
914 | - if (! isset($this->originalEntityData[$oid])) { |
|
914 | + if ( ! isset($this->originalEntityData[$oid])) { |
|
915 | 915 | throw new RuntimeException('Cannot call recomputeSingleEntityChangeSet before computeChangeSet on an entity.'); |
916 | 916 | } |
917 | 917 | |
@@ -929,7 +929,7 @@ discard block |
||
929 | 929 | if ($changeSet) { |
930 | 930 | if (isset($this->entityChangeSets[$oid])) { |
931 | 931 | $this->entityChangeSets[$oid] = array_merge($this->entityChangeSets[$oid], $changeSet); |
932 | - } elseif (! isset($this->entityInsertions[$oid])) { |
|
932 | + } elseif ( ! isset($this->entityInsertions[$oid])) { |
|
933 | 933 | $this->entityChangeSets[$oid] = $changeSet; |
934 | 934 | $this->entityUpdates[$oid] = $entity; |
935 | 935 | } |
@@ -999,7 +999,7 @@ discard block |
||
999 | 999 | $this->recomputeSingleEntityChangeSet($class, $entity); |
1000 | 1000 | } |
1001 | 1001 | |
1002 | - if (! empty($this->entityChangeSets[$oid])) { |
|
1002 | + if ( ! empty($this->entityChangeSets[$oid])) { |
|
1003 | 1003 | $persister->update($entity); |
1004 | 1004 | } |
1005 | 1005 | |
@@ -1038,7 +1038,7 @@ discard block |
||
1038 | 1038 | |
1039 | 1039 | // Entity with this $oid after deletion treated as NEW, even if the $oid |
1040 | 1040 | // is obtained by a new entity because the old one went out of scope. |
1041 | - if (! $class->isIdentifierComposite()) { |
|
1041 | + if ( ! $class->isIdentifierComposite()) { |
|
1042 | 1042 | $property = $class->getProperty($class->getSingleIdentifierFieldName()); |
1043 | 1043 | |
1044 | 1044 | if ($property instanceof FieldMetadata && $property->hasValueGenerator()) { |
@@ -1085,13 +1085,13 @@ discard block |
||
1085 | 1085 | // Calculate dependencies for new nodes |
1086 | 1086 | while ($class = array_pop($newNodes)) { |
1087 | 1087 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
1088 | - if (! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) { |
|
1088 | + if ( ! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) { |
|
1089 | 1089 | continue; |
1090 | 1090 | } |
1091 | 1091 | |
1092 | 1092 | $targetClass = $this->em->getClassMetadata($property->getTargetEntity()); |
1093 | 1093 | |
1094 | - if (! $calc->hasNode($targetClass->getClassName())) { |
|
1094 | + if ( ! $calc->hasNode($targetClass->getClassName())) { |
|
1095 | 1095 | $calc->addNode($targetClass->getClassName(), $targetClass); |
1096 | 1096 | |
1097 | 1097 | $newNodes[] = $targetClass; |
@@ -1099,7 +1099,7 @@ discard block |
||
1099 | 1099 | |
1100 | 1100 | $weight = ! array_filter( |
1101 | 1101 | $property->getJoinColumns(), |
1102 | - static function (JoinColumnMetadata $joinColumn) { |
|
1102 | + static function(JoinColumnMetadata $joinColumn) { |
|
1103 | 1103 | return $joinColumn->isNullable(); |
1104 | 1104 | } |
1105 | 1105 | ); |
@@ -1107,14 +1107,14 @@ discard block |
||
1107 | 1107 | $calc->addDependency($targetClass->getClassName(), $class->getClassName(), $weight); |
1108 | 1108 | |
1109 | 1109 | // If the target class has mapped subclasses, these share the same dependency. |
1110 | - if (! $targetClass->getSubClasses()) { |
|
1110 | + if ( ! $targetClass->getSubClasses()) { |
|
1111 | 1111 | continue; |
1112 | 1112 | } |
1113 | 1113 | |
1114 | 1114 | foreach ($targetClass->getSubClasses() as $subClassName) { |
1115 | 1115 | $targetSubClass = $this->em->getClassMetadata($subClassName); |
1116 | 1116 | |
1117 | - if (! $calc->hasNode($subClassName)) { |
|
1117 | + if ( ! $calc->hasNode($subClassName)) { |
|
1118 | 1118 | $calc->addNode($targetSubClass->getClassName(), $targetSubClass); |
1119 | 1119 | |
1120 | 1120 | $newNodes[] = $targetSubClass; |
@@ -1190,7 +1190,7 @@ discard block |
||
1190 | 1190 | { |
1191 | 1191 | $oid = spl_object_id($entity); |
1192 | 1192 | |
1193 | - if (! isset($this->entityIdentifiers[$oid])) { |
|
1193 | + if ( ! isset($this->entityIdentifiers[$oid])) { |
|
1194 | 1194 | throw ORMInvalidArgumentException::entityHasNoIdentity($entity, 'scheduling for update'); |
1195 | 1195 | } |
1196 | 1196 | |
@@ -1198,7 +1198,7 @@ discard block |
||
1198 | 1198 | throw ORMInvalidArgumentException::entityIsRemoved($entity, 'schedule for update'); |
1199 | 1199 | } |
1200 | 1200 | |
1201 | - if (! isset($this->entityUpdates[$oid]) && ! isset($this->entityInsertions[$oid])) { |
|
1201 | + if ( ! isset($this->entityUpdates[$oid]) && ! isset($this->entityInsertions[$oid])) { |
|
1202 | 1202 | $this->entityUpdates[$oid] = $entity; |
1203 | 1203 | } |
1204 | 1204 | } |
@@ -1273,7 +1273,7 @@ discard block |
||
1273 | 1273 | return; // entity has not been persisted yet, so nothing more to do. |
1274 | 1274 | } |
1275 | 1275 | |
1276 | - if (! $this->isInIdentityMap($entity)) { |
|
1276 | + if ( ! $this->isInIdentityMap($entity)) { |
|
1277 | 1277 | return; |
1278 | 1278 | } |
1279 | 1279 | |
@@ -1281,7 +1281,7 @@ discard block |
||
1281 | 1281 | |
1282 | 1282 | unset($this->entityUpdates[$oid]); |
1283 | 1283 | |
1284 | - if (! isset($this->entityDeletions[$oid])) { |
|
1284 | + if ( ! isset($this->entityDeletions[$oid])) { |
|
1285 | 1285 | $this->entityDeletions[$oid] = $entity; |
1286 | 1286 | $this->entityStates[$oid] = self::STATE_REMOVED; |
1287 | 1287 | } |
@@ -1383,7 +1383,7 @@ discard block |
||
1383 | 1383 | $persister = $this->getEntityPersister($class->getClassName()); |
1384 | 1384 | $id = $persister->getIdentifier($entity); |
1385 | 1385 | |
1386 | - if (! $id) { |
|
1386 | + if ( ! $id) { |
|
1387 | 1387 | return self::STATE_NEW; |
1388 | 1388 | } |
1389 | 1389 | |
@@ -1741,7 +1741,7 @@ discard block |
||
1741 | 1741 | $class = $this->em->getClassMetadata(get_class($entity)); |
1742 | 1742 | |
1743 | 1743 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
1744 | - if (! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade(), true))) { |
|
1744 | + if ( ! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade(), true))) { |
|
1745 | 1745 | continue; |
1746 | 1746 | } |
1747 | 1747 | |
@@ -1788,7 +1788,7 @@ discard block |
||
1788 | 1788 | } |
1789 | 1789 | |
1790 | 1790 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
1791 | - if (! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade(), true))) { |
|
1791 | + if ( ! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade(), true))) { |
|
1792 | 1792 | continue; |
1793 | 1793 | } |
1794 | 1794 | |
@@ -1804,7 +1804,7 @@ discard block |
||
1804 | 1804 | |
1805 | 1805 | case $relatedEntities instanceof Collection: |
1806 | 1806 | case is_array($relatedEntities): |
1807 | - if (! ($association instanceof ToManyAssociationMetadata)) { |
|
1807 | + if ( ! ($association instanceof ToManyAssociationMetadata)) { |
|
1808 | 1808 | throw ORMInvalidArgumentException::invalidAssociation( |
1809 | 1809 | $this->em->getClassMetadata($targetEntity), |
1810 | 1810 | $association, |
@@ -1819,7 +1819,7 @@ discard block |
||
1819 | 1819 | break; |
1820 | 1820 | |
1821 | 1821 | case $relatedEntities !== null: |
1822 | - if (! $relatedEntities instanceof $targetEntity) { |
|
1822 | + if ( ! $relatedEntities instanceof $targetEntity) { |
|
1823 | 1823 | throw ORMInvalidArgumentException::invalidAssociation( |
1824 | 1824 | $this->em->getClassMetadata($targetEntity), |
1825 | 1825 | $association, |
@@ -1848,7 +1848,7 @@ discard block |
||
1848 | 1848 | $class = $this->em->getClassMetadata(get_class($entity)); |
1849 | 1849 | |
1850 | 1850 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
1851 | - if (! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade(), true))) { |
|
1851 | + if ( ! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade(), true))) { |
|
1852 | 1852 | continue; |
1853 | 1853 | } |
1854 | 1854 | |
@@ -1907,7 +1907,7 @@ discard block |
||
1907 | 1907 | |
1908 | 1908 | switch (true) { |
1909 | 1909 | case $lockMode === LockMode::OPTIMISTIC: |
1910 | - if (! $class->isVersioned()) { |
|
1910 | + if ( ! $class->isVersioned()) { |
|
1911 | 1911 | throw OptimisticLockException::notVersioned($class->getClassName()); |
1912 | 1912 | } |
1913 | 1913 | |
@@ -1930,7 +1930,7 @@ discard block |
||
1930 | 1930 | case $lockMode === LockMode::NONE: |
1931 | 1931 | case $lockMode === LockMode::PESSIMISTIC_READ: |
1932 | 1932 | case $lockMode === LockMode::PESSIMISTIC_WRITE: |
1933 | - if (! $this->em->getConnection()->isTransactionActive()) { |
|
1933 | + if ( ! $this->em->getConnection()->isTransactionActive()) { |
|
1934 | 1934 | throw TransactionRequiredException::transactionRequired(); |
1935 | 1935 | } |
1936 | 1936 | |
@@ -2088,7 +2088,7 @@ discard block |
||
2088 | 2088 | $entity->addPropertyChangedListener($this); |
2089 | 2089 | } |
2090 | 2090 | } else { |
2091 | - if (! isset($hints[Query::HINT_REFRESH]) |
|
2091 | + if ( ! isset($hints[Query::HINT_REFRESH]) |
|
2092 | 2092 | || (isset($hints[Query::HINT_REFRESH_ENTITY]) && $hints[Query::HINT_REFRESH_ENTITY] !== $entity)) { |
2093 | 2093 | return $entity; |
2094 | 2094 | } |
@@ -2136,7 +2136,7 @@ discard block |
||
2136 | 2136 | } |
2137 | 2137 | |
2138 | 2138 | foreach ($class->getDeclaredPropertiesIterator() as $field => $association) { |
2139 | - if (! ($association instanceof AssociationMetadata)) { |
|
2139 | + if ( ! ($association instanceof AssociationMetadata)) { |
|
2140 | 2140 | continue; |
2141 | 2141 | } |
2142 | 2142 | |
@@ -2185,7 +2185,7 @@ discard block |
||
2185 | 2185 | continue; |
2186 | 2186 | } |
2187 | 2187 | |
2188 | - if (! $association->isOwningSide()) { |
|
2188 | + if ( ! $association->isOwningSide()) { |
|
2189 | 2189 | // use the given entity association |
2190 | 2190 | if (isset($data[$field]) && is_object($data[$field]) && |
2191 | 2191 | isset($this->entityStates[spl_object_id($data[$field])])) { |
@@ -2235,7 +2235,7 @@ discard block |
||
2235 | 2235 | $associatedId[$targetField] = $joinColumnValue; |
2236 | 2236 | } |
2237 | 2237 | |
2238 | - if (! $associatedId) { |
|
2238 | + if ( ! $associatedId) { |
|
2239 | 2239 | // Foreign key is NULL |
2240 | 2240 | $association->setValue($entity, null); |
2241 | 2241 | $this->originalEntityData[$oid][$field] = null; |
@@ -2244,7 +2244,7 @@ discard block |
||
2244 | 2244 | } |
2245 | 2245 | |
2246 | 2246 | // @todo guilhermeblanco Can we remove the need of this somehow? |
2247 | - if (! isset($hints['fetchMode'][$class->getClassName()][$field])) { |
|
2247 | + if ( ! isset($hints['fetchMode'][$class->getClassName()][$field])) { |
|
2248 | 2248 | $hints['fetchMode'][$class->getClassName()][$field] = $association->getFetchMode(); |
2249 | 2249 | } |
2250 | 2250 | |
@@ -2261,7 +2261,7 @@ discard block |
||
2261 | 2261 | // If this is an uninitialized proxy, we are deferring eager loads, |
2262 | 2262 | // this association is marked as eager fetch, and its an uninitialized proxy (wtf!) |
2263 | 2263 | // then we can append this entity for eager loading! |
2264 | - if (! $targetClass->isIdentifierComposite() && |
|
2264 | + if ( ! $targetClass->isIdentifierComposite() && |
|
2265 | 2265 | $newValue instanceof GhostObjectInterface && |
2266 | 2266 | isset($hints[self::HINT_DEFEREAGERLOAD]) && |
2267 | 2267 | $hints['fetchMode'][$class->getClassName()][$field] === FetchMode::EAGER && |
@@ -2344,7 +2344,7 @@ discard block |
||
2344 | 2344 | |
2345 | 2345 | public function triggerEagerLoads() |
2346 | 2346 | { |
2347 | - if (! $this->eagerLoadingEntities) { |
|
2347 | + if ( ! $this->eagerLoadingEntities) { |
|
2348 | 2348 | return; |
2349 | 2349 | } |
2350 | 2350 | |
@@ -2353,7 +2353,7 @@ discard block |
||
2353 | 2353 | $this->eagerLoadingEntities = []; |
2354 | 2354 | |
2355 | 2355 | foreach ($eagerLoadingEntities as $entityName => $ids) { |
2356 | - if (! $ids) { |
|
2356 | + if ( ! $ids) { |
|
2357 | 2357 | continue; |
2358 | 2358 | } |
2359 | 2359 | |
@@ -2651,7 +2651,7 @@ discard block |
||
2651 | 2651 | { |
2652 | 2652 | $class = $this->em->getClassMetadata(get_class($entity)); |
2653 | 2653 | |
2654 | - if (! $class->getProperty($propertyName)) { |
|
2654 | + if ( ! $class->getProperty($propertyName)) { |
|
2655 | 2655 | return; // ignore non-persistent fields |
2656 | 2656 | } |
2657 | 2657 | |
@@ -2660,7 +2660,7 @@ discard block |
||
2660 | 2660 | // Update changeset and mark entity for synchronization |
2661 | 2661 | $this->entityChangeSets[$oid][$propertyName] = [$oldValue, $newValue]; |
2662 | 2662 | |
2663 | - if (! isset($this->scheduledForSynchronization[$class->getRootClassName()][$oid])) { |
|
2663 | + if ( ! isset($this->scheduledForSynchronization[$class->getRootClassName()][$oid])) { |
|
2664 | 2664 | $this->scheduleForSynchronization($entity); |
2665 | 2665 | } |
2666 | 2666 | } |
@@ -2742,7 +2742,7 @@ discard block |
||
2742 | 2742 | */ |
2743 | 2743 | private static function objToStr($obj) |
2744 | 2744 | { |
2745 | - return method_exists($obj, '__toString') ? (string) $obj : get_class($obj) . '@' . spl_object_id($obj); |
|
2745 | + return method_exists($obj, '__toString') ? (string) $obj : get_class($obj).'@'.spl_object_id($obj); |
|
2746 | 2746 | } |
2747 | 2747 | |
2748 | 2748 | /** |
@@ -2757,7 +2757,7 @@ discard block |
||
2757 | 2757 | */ |
2758 | 2758 | public function markReadOnly($object) |
2759 | 2759 | { |
2760 | - if (! is_object($object) || ! $this->isInIdentityMap($object)) { |
|
2760 | + if ( ! is_object($object) || ! $this->isInIdentityMap($object)) { |
|
2761 | 2761 | throw ORMInvalidArgumentException::readOnlyRequiresManagedEntity($object); |
2762 | 2762 | } |
2763 | 2763 | |
@@ -2775,7 +2775,7 @@ discard block |
||
2775 | 2775 | */ |
2776 | 2776 | public function isReadOnly($object) |
2777 | 2777 | { |
2778 | - if (! is_object($object)) { |
|
2778 | + if ( ! is_object($object)) { |
|
2779 | 2779 | throw ORMInvalidArgumentException::readOnlyRequiresManagedEntity($object); |
2780 | 2780 | } |
2781 | 2781 | |
@@ -2787,7 +2787,7 @@ discard block |
||
2787 | 2787 | */ |
2788 | 2788 | private function afterTransactionComplete() |
2789 | 2789 | { |
2790 | - $this->performCallbackOnCachedPersister(static function (CachedPersister $persister) { |
|
2790 | + $this->performCallbackOnCachedPersister(static function(CachedPersister $persister) { |
|
2791 | 2791 | $persister->afterTransactionComplete(); |
2792 | 2792 | }); |
2793 | 2793 | } |
@@ -2797,7 +2797,7 @@ discard block |
||
2797 | 2797 | */ |
2798 | 2798 | private function afterTransactionRolledBack() |
2799 | 2799 | { |
2800 | - $this->performCallbackOnCachedPersister(static function (CachedPersister $persister) { |
|
2800 | + $this->performCallbackOnCachedPersister(static function(CachedPersister $persister) { |
|
2801 | 2801 | $persister->afterTransactionRolledBack(); |
2802 | 2802 | }); |
2803 | 2803 | } |
@@ -2807,7 +2807,7 @@ discard block |
||
2807 | 2807 | */ |
2808 | 2808 | private function performCallbackOnCachedPersister(callable $callback) |
2809 | 2809 | { |
2810 | - if (! $this->hasCache) { |
|
2810 | + if ( ! $this->hasCache) { |
|
2811 | 2811 | return; |
2812 | 2812 | } |
2813 | 2813 |
@@ -33,13 +33,13 @@ |
||
33 | 33 | protected function configure() |
34 | 34 | { |
35 | 35 | $this->setName('orm:run-dql') |
36 | - ->setDescription('Executes arbitrary DQL directly from the command line') |
|
37 | - ->addArgument('dql', InputArgument::REQUIRED, 'The DQL to execute.') |
|
38 | - ->addOption('hydrate', null, InputOption::VALUE_REQUIRED, 'Hydration mode of result set. Should be either: object, array, scalar or single-scalar.', 'object') |
|
39 | - ->addOption('first-result', null, InputOption::VALUE_REQUIRED, 'The first result in the result set.') |
|
40 | - ->addOption('max-result', null, InputOption::VALUE_REQUIRED, 'The maximum number of results in the result set.') |
|
41 | - ->addOption('show-sql', null, InputOption::VALUE_NONE, 'Dump generated SQL instead of executing query') |
|
42 | - ->setHelp('Executes arbitrary DQL directly from the command line.'); |
|
36 | + ->setDescription('Executes arbitrary DQL directly from the command line') |
|
37 | + ->addArgument('dql', InputArgument::REQUIRED, 'The DQL to execute.') |
|
38 | + ->addOption('hydrate', null, InputOption::VALUE_REQUIRED, 'Hydration mode of result set. Should be either: object, array, scalar or single-scalar.', 'object') |
|
39 | + ->addOption('first-result', null, InputOption::VALUE_REQUIRED, 'The first result in the result set.') |
|
40 | + ->addOption('max-result', null, InputOption::VALUE_REQUIRED, 'The maximum number of results in the result set.') |
|
41 | + ->addOption('show-sql', null, InputOption::VALUE_NONE, 'Dump generated SQL instead of executing query') |
|
42 | + ->setHelp('Executes arbitrary DQL directly from the command line.'); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
@@ -58,9 +58,9 @@ discard block |
||
58 | 58 | } |
59 | 59 | |
60 | 60 | $hydrationModeName = $input->getOption('hydrate'); |
61 | - $hydrationMode = 'Doctrine\ORM\Query::HYDRATE_' . strtoupper(str_replace('-', '_', $hydrationModeName)); |
|
61 | + $hydrationMode = 'Doctrine\ORM\Query::HYDRATE_'.strtoupper(str_replace('-', '_', $hydrationModeName)); |
|
62 | 62 | |
63 | - if (! defined($hydrationMode)) { |
|
63 | + if ( ! defined($hydrationMode)) { |
|
64 | 64 | throw new RuntimeException(sprintf( |
65 | 65 | "Hydration mode '%s' does not exist. It should be either: object. array, scalar or single-scalar.", |
66 | 66 | $hydrationModeName |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $firstResult = $input->getOption('first-result'); |
72 | 72 | |
73 | 73 | if ($firstResult !== null) { |
74 | - if (! is_numeric($firstResult)) { |
|
74 | + if ( ! is_numeric($firstResult)) { |
|
75 | 75 | throw new LogicException("Option 'first-result' must contain an integer value"); |
76 | 76 | } |
77 | 77 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | $maxResult = $input->getOption('max-result'); |
82 | 82 | |
83 | 83 | if ($maxResult !== null) { |
84 | - if (! is_numeric($maxResult)) { |
|
84 | + if ( ! is_numeric($maxResult)) { |
|
85 | 85 | throw new LogicException("Option 'max-result' must contain an integer value"); |
86 | 86 | } |
87 | 87 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | $resultSet = $query->execute([], constant($hydrationMode)); |
97 | 97 | |
98 | - $dumper = new CliDumper(static function (string $payload) use ($output) : void { |
|
98 | + $dumper = new CliDumper(static function(string $payload) use ($output) : void { |
|
99 | 99 | $output->write($payload); |
100 | 100 | }); |
101 | 101 | $dumper->dump((new VarCloner())->cloneVar($resultSet)); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | { |
87 | 87 | $cache = self::createCacheInstance($isDevMode, $cache); |
88 | 88 | |
89 | - if (! $cache instanceof CacheProvider) { |
|
89 | + if ( ! $cache instanceof CacheProvider) { |
|
90 | 90 | return $cache; |
91 | 91 | } |
92 | 92 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $namespace .= ':'; |
97 | 97 | } |
98 | 98 | |
99 | - $cache->setNamespace($namespace . 'dc2_' . md5($proxyDir) . '_'); // to avoid collisions |
|
99 | + $cache->setNamespace($namespace.'dc2_'.md5($proxyDir).'_'); // to avoid collisions |
|
100 | 100 | |
101 | 101 | return $cache; |
102 | 102 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | public function tearDown() : void |
37 | 37 | { |
38 | - if (! $this->originalIncludePath) { |
|
38 | + if ( ! $this->originalIncludePath) { |
|
39 | 39 | return; |
40 | 40 | } |
41 | 41 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | $config = Setup::createConfiguration(false, __DIR__); |
75 | 75 | $cache = $config->getMetadataCacheImpl(); |
76 | 76 | |
77 | - self::assertSame('dc2_' . md5(__DIR__) . '_', $cache->getNamespace()); |
|
77 | + self::assertSame('dc2_'.md5(__DIR__).'_', $cache->getNamespace()); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | /** |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $config = Setup::createConfiguration(false, __DIR__, new ArrayCache()); |
86 | 86 | $cache = $config->getMetadataCacheImpl(); |
87 | 87 | |
88 | - self::assertSame('dc2_' . md5(__DIR__) . '_', $cache->getNamespace()); |
|
88 | + self::assertSame('dc2_'.md5(__DIR__).'_', $cache->getNamespace()); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | /** |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | $cache = $config->getMetadataCacheImpl(); |
101 | 101 | |
102 | 102 | self::assertSame($originalCache, $cache); |
103 | - self::assertSame('foo:dc2_' . md5(__DIR__) . '_', $cache->getNamespace()); |
|
103 | + self::assertSame('foo:dc2_'.md5(__DIR__).'_', $cache->getNamespace()); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
@@ -34,7 +34,7 @@ |
||
34 | 34 | */ |
35 | 35 | public function getDatabasePlatform() |
36 | 36 | { |
37 | - if (! $this->platformMock) { |
|
37 | + if ( ! $this->platformMock) { |
|
38 | 38 | $this->platformMock = new DatabasePlatformMock(); |
39 | 39 | } |
40 | 40 |
@@ -116,7 +116,7 @@ |
||
116 | 116 | public function quote($input, $type = null) |
117 | 117 | { |
118 | 118 | if (is_string($input)) { |
119 | - return "'" . $input . "'"; |
|
119 | + return "'".$input."'"; |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | return $input; |