@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | |
417 | 417 | if (isset($manyToOneElement['fetch'])) { |
418 | 418 | $association->setFetchMode( |
419 | - constant('Doctrine\ORM\Mapping\FetchMode::' . (string) $manyToOneElement['fetch']) |
|
419 | + constant('Doctrine\ORM\Mapping\FetchMode::'.(string) $manyToOneElement['fetch']) |
|
420 | 420 | ); |
421 | 421 | } |
422 | 422 | |
@@ -569,7 +569,7 @@ discard block |
||
569 | 569 | $fieldName = (string) $overrideElement['name']; |
570 | 570 | $property = $metadata->getProperty($fieldName); |
571 | 571 | |
572 | - if (! $property) { |
|
572 | + if ( ! $property) { |
|
573 | 573 | throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName); |
574 | 574 | } |
575 | 575 | |
@@ -627,7 +627,7 @@ discard block |
||
627 | 627 | // Check for fetch |
628 | 628 | if (isset($overrideElement['fetch'])) { |
629 | 629 | $override->setFetchMode( |
630 | - constant('Doctrine\ORM\Mapping\FetchMode::' . (string) $overrideElement['fetch']) |
|
630 | + constant('Doctrine\ORM\Mapping\FetchMode::'.(string) $overrideElement['fetch']) |
|
631 | 631 | ); |
632 | 632 | } |
633 | 633 | |
@@ -638,7 +638,7 @@ discard block |
||
638 | 638 | // Evaluate <lifecycle-callbacks...> |
639 | 639 | if (isset($xmlRoot->{'lifecycle-callbacks'})) { |
640 | 640 | foreach ($xmlRoot->{'lifecycle-callbacks'}->{'lifecycle-callback'} as $lifecycleCallback) { |
641 | - $eventName = constant(Events::class . '::' . (string) $lifecycleCallback['type']); |
|
641 | + $eventName = constant(Events::class.'::'.(string) $lifecycleCallback['type']); |
|
642 | 642 | $methodName = (string) $lifecycleCallback['method']; |
643 | 643 | |
644 | 644 | $metadata->addLifecycleCallback($methodName, $eventName); |
@@ -650,7 +650,7 @@ discard block |
||
650 | 650 | foreach ($xmlRoot->{'entity-listeners'}->{'entity-listener'} as $listenerElement) { |
651 | 651 | $listenerClassName = (string) $listenerElement['class']; |
652 | 652 | |
653 | - if (! class_exists($listenerClassName)) { |
|
653 | + if ( ! class_exists($listenerClassName)) { |
|
654 | 654 | throw Mapping\MappingException::entityListenerClassNotFound( |
655 | 655 | $listenerClassName, |
656 | 656 | $metadata->getClassName() |
@@ -816,7 +816,7 @@ discard block |
||
816 | 816 | $fieldName = null |
817 | 817 | ) { |
818 | 818 | $baseRegion = strtolower(str_replace('\\', '_', $metadata->getRootClassName())); |
819 | - $defaultRegion = $baseRegion . ($fieldName ? '__' . $fieldName : ''); |
|
819 | + $defaultRegion = $baseRegion.($fieldName ? '__'.$fieldName : ''); |
|
820 | 820 | |
821 | 821 | $region = (string) ($cacheMapping['region'] ?? $defaultRegion); |
822 | 822 | $usage = isset($cacheMapping['usage']) |
@@ -844,7 +844,7 @@ discard block |
||
844 | 844 | Events::preFlush, |
845 | 845 | ]; |
846 | 846 | |
847 | - return array_filter($events, static function ($eventName) use ($method) { |
|
847 | + return array_filter($events, static function($eventName) use ($method) { |
|
848 | 848 | return $eventName === $method->getName(); |
849 | 849 | }); |
850 | 850 | } |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | */ |
263 | 263 | public function __toString() |
264 | 264 | { |
265 | - return self::class . '@' . spl_object_id($this); |
|
265 | + return self::class.'@'.spl_object_id($this); |
|
266 | 266 | } |
267 | 267 | |
268 | 268 | /** |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | // Restore ReflectionClass and properties |
350 | 350 | $this->reflectionClass = $reflectionService->getClass($this->className); |
351 | 351 | |
352 | - if (! $this->reflectionClass) { |
|
352 | + if ( ! $this->reflectionClass) { |
|
353 | 353 | return; |
354 | 354 | } |
355 | 355 | |
@@ -373,11 +373,11 @@ discard block |
||
373 | 373 | } |
374 | 374 | |
375 | 375 | // Verify & complete identifier mapping |
376 | - if (! $this->identifier) { |
|
376 | + if ( ! $this->identifier) { |
|
377 | 377 | throw MappingException::identifierRequired($this->className); |
378 | 378 | } |
379 | 379 | |
380 | - $explicitlyGeneratedProperties = array_filter($this->declaredProperties, static function (Property $property) : bool { |
|
380 | + $explicitlyGeneratedProperties = array_filter($this->declaredProperties, static function(Property $property) : bool { |
|
381 | 381 | return $property instanceof FieldMetadata |
382 | 382 | && $property->isPrimaryKey() |
383 | 383 | && $property->hasValueGenerator(); |
@@ -396,14 +396,14 @@ discard block |
||
396 | 396 | public function validateAssociations() : void |
397 | 397 | { |
398 | 398 | array_map( |
399 | - function (Property $property) { |
|
400 | - if (! ($property instanceof AssociationMetadata)) { |
|
399 | + function(Property $property) { |
|
400 | + if ( ! ($property instanceof AssociationMetadata)) { |
|
401 | 401 | return; |
402 | 402 | } |
403 | 403 | |
404 | 404 | $targetEntity = $property->getTargetEntity(); |
405 | 405 | |
406 | - if (! class_exists($targetEntity)) { |
|
406 | + if ( ! class_exists($targetEntity)) { |
|
407 | 407 | throw MappingException::invalidTargetEntityClass($targetEntity, $this->className, $property->getName()); |
408 | 408 | } |
409 | 409 | }, |
@@ -421,7 +421,7 @@ discard block |
||
421 | 421 | foreach ($this->lifecycleCallbacks as $callbacks) { |
422 | 422 | /** @var array $callbacks */ |
423 | 423 | foreach ($callbacks as $callbackFuncName) { |
424 | - if (! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) { |
|
424 | + if ( ! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) { |
|
425 | 425 | throw MappingException::lifecycleCallbackMethodNotFound($this->className, $callbackFuncName); |
426 | 426 | } |
427 | 427 | } |
@@ -445,11 +445,11 @@ discard block |
||
445 | 445 | */ |
446 | 446 | public function isIdentifier(string $fieldName) : bool |
447 | 447 | { |
448 | - if (! $this->identifier) { |
|
448 | + if ( ! $this->identifier) { |
|
449 | 449 | return false; |
450 | 450 | } |
451 | 451 | |
452 | - if (! $this->isIdentifierComposite()) { |
|
452 | + if ( ! $this->isIdentifierComposite()) { |
|
453 | 453 | return $fieldName === $this->identifier[0]; |
454 | 454 | } |
455 | 455 | |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | $property->setColumnName($columnName); |
478 | 478 | } |
479 | 479 | |
480 | - if (! $this->isMappedSuperclass) { |
|
480 | + if ( ! $this->isMappedSuperclass) { |
|
481 | 481 | $property->setTableName($this->getTableName()); |
482 | 482 | } |
483 | 483 | |
@@ -497,7 +497,7 @@ discard block |
||
497 | 497 | throw MappingException::sqlConversionNotAllowedForPrimaryKeyProperties($this->className, $property); |
498 | 498 | } |
499 | 499 | |
500 | - if (! in_array($fieldName, $this->identifier, true)) { |
|
500 | + if ( ! in_array($fieldName, $this->identifier, true)) { |
|
501 | 501 | $this->identifier[] = $fieldName; |
502 | 502 | } |
503 | 503 | } |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | $fieldName = $property->getName(); |
548 | 548 | $targetEntity = $property->getTargetEntity(); |
549 | 549 | |
550 | - if (! $targetEntity) { |
|
550 | + if ( ! $targetEntity) { |
|
551 | 551 | throw MappingException::missingTargetEntity($fieldName); |
552 | 552 | } |
553 | 553 | |
@@ -560,7 +560,7 @@ discard block |
||
560 | 560 | throw MappingException::illegalOrphanRemovalOnIdentifierAssociation($this->className, $fieldName); |
561 | 561 | } |
562 | 562 | |
563 | - if (! in_array($property->getName(), $this->identifier, true)) { |
|
563 | + if ( ! in_array($property->getName(), $this->identifier, true)) { |
|
564 | 564 | if ($property instanceof ToOneAssociationMetadata && count($property->getJoinColumns()) >= 2) { |
565 | 565 | throw MappingException::cannotMapCompositePrimaryKeyEntitiesAsForeignId( |
566 | 566 | $property->getTargetEntity(), |
@@ -622,7 +622,7 @@ discard block |
||
622 | 622 | /** @var JoinColumnMetadata $joinColumn */ |
623 | 623 | if ($property instanceof OneToOneAssociationMetadata && $this->inheritanceType !== InheritanceType::SINGLE_TABLE) { |
624 | 624 | if (count($property->getJoinColumns()) === 1) { |
625 | - if (! $property->isPrimaryKey()) { |
|
625 | + if ( ! $property->isPrimaryKey()) { |
|
626 | 626 | $joinColumn->setUnique(true); |
627 | 627 | } |
628 | 628 | } else { |
@@ -630,13 +630,13 @@ discard block |
||
630 | 630 | } |
631 | 631 | } |
632 | 632 | |
633 | - $joinColumn->setTableName(! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
633 | + $joinColumn->setTableName( ! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
634 | 634 | |
635 | - if (! $joinColumn->getColumnName()) { |
|
635 | + if ( ! $joinColumn->getColumnName()) { |
|
636 | 636 | $joinColumn->setColumnName($this->namingStrategy->joinColumnName($fieldName, $this->className)); |
637 | 637 | } |
638 | 638 | |
639 | - if (! $joinColumn->getReferencedColumnName()) { |
|
639 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
640 | 640 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
641 | 641 | } |
642 | 642 | |
@@ -644,7 +644,7 @@ discard block |
||
644 | 644 | } |
645 | 645 | |
646 | 646 | if ($uniqueConstraintColumns) { |
647 | - if (! $this->table) { |
|
647 | + if ( ! $this->table) { |
|
648 | 648 | throw new RuntimeException( |
649 | 649 | 'ClassMetadata::setTable() has to be called before defining a one to one relationship.' |
650 | 650 | ); |
@@ -664,7 +664,7 @@ discard block |
||
664 | 664 | if ($property->isOrphanRemoval()) { |
665 | 665 | $cascades = $property->getCascade(); |
666 | 666 | |
667 | - if (! in_array('remove', $cascades, true)) { |
|
667 | + if ( ! in_array('remove', $cascades, true)) { |
|
668 | 668 | $cascades[] = 'remove'; |
669 | 669 | |
670 | 670 | $property->setCascade($cascades); |
@@ -727,14 +727,14 @@ discard block |
||
727 | 727 | protected function validateAndCompleteOneToManyMapping(OneToManyAssociationMetadata $property) |
728 | 728 | { |
729 | 729 | // OneToMany MUST have mappedBy |
730 | - if (! $property->getMappedBy()) { |
|
730 | + if ( ! $property->getMappedBy()) { |
|
731 | 731 | throw MappingException::oneToManyRequiresMappedBy($property->getName()); |
732 | 732 | } |
733 | 733 | |
734 | 734 | if ($property->isOrphanRemoval()) { |
735 | 735 | $cascades = $property->getCascade(); |
736 | 736 | |
737 | - if (! in_array('remove', $cascades, true)) { |
|
737 | + if ( ! in_array('remove', $cascades, true)) { |
|
738 | 738 | $cascades[] = 'remove'; |
739 | 739 | |
740 | 740 | $property->setCascade($cascades); |
@@ -757,7 +757,7 @@ discard block |
||
757 | 757 | |
758 | 758 | $property->setJoinTable($joinTable); |
759 | 759 | |
760 | - if (! $joinTable->getName()) { |
|
760 | + if ( ! $joinTable->getName()) { |
|
761 | 761 | $joinTableName = $this->namingStrategy->joinTableName( |
762 | 762 | $property->getSourceEntity(), |
763 | 763 | $property->getTargetEntity(), |
@@ -769,7 +769,7 @@ discard block |
||
769 | 769 | |
770 | 770 | $selfReferencingEntityWithoutJoinColumns = $property->getSourceEntity() === $property->getTargetEntity() && ! $joinTable->hasColumns(); |
771 | 771 | |
772 | - if (! $joinTable->getJoinColumns()) { |
|
772 | + if ( ! $joinTable->getJoinColumns()) { |
|
773 | 773 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
774 | 774 | $sourceReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'source' : $referencedColumnName; |
775 | 775 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getSourceEntity(), $sourceReferenceName); |
@@ -782,7 +782,7 @@ discard block |
||
782 | 782 | $joinTable->addJoinColumn($joinColumn); |
783 | 783 | } |
784 | 784 | |
785 | - if (! $joinTable->getInverseJoinColumns()) { |
|
785 | + if ( ! $joinTable->getInverseJoinColumns()) { |
|
786 | 786 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
787 | 787 | $targetReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'target' : $referencedColumnName; |
788 | 788 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getTargetEntity(), $targetReferenceName); |
@@ -797,13 +797,13 @@ discard block |
||
797 | 797 | |
798 | 798 | foreach ($joinTable->getJoinColumns() as $joinColumn) { |
799 | 799 | /** @var JoinColumnMetadata $joinColumn */ |
800 | - if (! $joinColumn->getReferencedColumnName()) { |
|
800 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
801 | 801 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
802 | 802 | } |
803 | 803 | |
804 | 804 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
805 | 805 | |
806 | - if (! $joinColumn->getColumnName()) { |
|
806 | + if ( ! $joinColumn->getColumnName()) { |
|
807 | 807 | $columnName = $this->namingStrategy->joinKeyColumnName( |
808 | 808 | $property->getSourceEntity(), |
809 | 809 | $referencedColumnName |
@@ -815,13 +815,13 @@ discard block |
||
815 | 815 | |
816 | 816 | foreach ($joinTable->getInverseJoinColumns() as $inverseJoinColumn) { |
817 | 817 | /** @var JoinColumnMetadata $inverseJoinColumn */ |
818 | - if (! $inverseJoinColumn->getReferencedColumnName()) { |
|
818 | + if ( ! $inverseJoinColumn->getReferencedColumnName()) { |
|
819 | 819 | $inverseJoinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
820 | 820 | } |
821 | 821 | |
822 | 822 | $referencedColumnName = $inverseJoinColumn->getReferencedColumnName(); |
823 | 823 | |
824 | - if (! $inverseJoinColumn->getColumnName()) { |
|
824 | + if ( ! $inverseJoinColumn->getColumnName()) { |
|
825 | 825 | $columnName = $this->namingStrategy->joinKeyColumnName( |
826 | 826 | $property->getTargetEntity(), |
827 | 827 | $referencedColumnName |
@@ -855,7 +855,7 @@ discard block |
||
855 | 855 | throw MappingException::singleIdNotAllowedOnCompositePrimaryKey($this->className); |
856 | 856 | } |
857 | 857 | |
858 | - if (! isset($this->identifier[0])) { |
|
858 | + if ( ! isset($this->identifier[0])) { |
|
859 | 859 | throw MappingException::noIdDefined($this->className); |
860 | 860 | } |
861 | 861 | |
@@ -914,7 +914,7 @@ discard block |
||
914 | 914 | // Association defined as Id field |
915 | 915 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
916 | 916 | |
917 | - if (! $property->isOwningSide()) { |
|
917 | + if ( ! $property->isOwningSide()) { |
|
918 | 918 | $property = $targetClass->getProperty($property->getMappedBy()); |
919 | 919 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
920 | 920 | } |
@@ -928,7 +928,7 @@ discard block |
||
928 | 928 | $columnName = $joinColumn->getColumnName(); |
929 | 929 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
930 | 930 | |
931 | - if (! $joinColumn->getType()) { |
|
931 | + if ( ! $joinColumn->getType()) { |
|
932 | 932 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $em)); |
933 | 933 | } |
934 | 934 | |
@@ -962,10 +962,10 @@ discard block |
||
962 | 962 | { |
963 | 963 | $schema = $this->getSchemaName() === null |
964 | 964 | ? '' |
965 | - : $this->getSchemaName() . '_'; |
|
965 | + : $this->getSchemaName().'_'; |
|
966 | 966 | |
967 | 967 | // replace dots with underscores because PostgreSQL creates temporary tables in a special schema |
968 | - return $schema . $this->getTableName() . '_id_tmp'; |
|
968 | + return $schema.$this->getTableName().'_id_tmp'; |
|
969 | 969 | } |
970 | 970 | |
971 | 971 | /** |
@@ -999,7 +999,7 @@ discard block |
||
999 | 999 | */ |
1000 | 1000 | public function setInheritanceType($type) : void |
1001 | 1001 | { |
1002 | - if (! $this->isInheritanceType($type)) { |
|
1002 | + if ( ! $this->isInheritanceType($type)) { |
|
1003 | 1003 | throw MappingException::invalidInheritanceType($this->className, $type); |
1004 | 1004 | } |
1005 | 1005 | |
@@ -1017,7 +1017,7 @@ discard block |
||
1017 | 1017 | { |
1018 | 1018 | $fieldName = $property->getName(); |
1019 | 1019 | |
1020 | - if (! isset($this->declaredProperties[$fieldName])) { |
|
1020 | + if ( ! isset($this->declaredProperties[$fieldName])) { |
|
1021 | 1021 | throw MappingException::invalidOverrideFieldName($this->className, $fieldName); |
1022 | 1022 | } |
1023 | 1023 | |
@@ -1214,7 +1214,7 @@ discard block |
||
1214 | 1214 | $declaringClass = $property->getDeclaringClass(); |
1215 | 1215 | |
1216 | 1216 | if ($inheritedProperty instanceof FieldMetadata) { |
1217 | - if (! $declaringClass->isMappedSuperclass) { |
|
1217 | + if ( ! $declaringClass->isMappedSuperclass) { |
|
1218 | 1218 | $inheritedProperty->setTableName($property->getTableName()); |
1219 | 1219 | } |
1220 | 1220 | |
@@ -1325,11 +1325,11 @@ discard block |
||
1325 | 1325 | 'method' => $method, |
1326 | 1326 | ]; |
1327 | 1327 | |
1328 | - if (! class_exists($class)) { |
|
1328 | + if ( ! class_exists($class)) { |
|
1329 | 1329 | throw MappingException::entityListenerClassNotFound($class, $this->className); |
1330 | 1330 | } |
1331 | 1331 | |
1332 | - if (! method_exists($class, $method)) { |
|
1332 | + if ( ! method_exists($class, $method)) { |
|
1333 | 1333 | throw MappingException::entityListenerMethodNotFound($class, $method, $this->className); |
1334 | 1334 | } |
1335 | 1335 | |
@@ -1396,7 +1396,7 @@ discard block |
||
1396 | 1396 | return; |
1397 | 1397 | } |
1398 | 1398 | |
1399 | - if (! (class_exists($className) || interface_exists($className))) { |
|
1399 | + if ( ! (class_exists($className) || interface_exists($className))) { |
|
1400 | 1400 | throw MappingException::invalidClassInDiscriminatorMap($className, $this->className); |
1401 | 1401 | } |
1402 | 1402 |
@@ -298,16 +298,16 @@ discard block |
||
298 | 298 | $tableName = $versionedClass->table->getQuotedQualifiedName($this->platform); |
299 | 299 | $columnName = $this->platform->quoteIdentifier($versionProperty->getColumnName()); |
300 | 300 | $identifier = array_map( |
301 | - function ($columnName) { |
|
301 | + function($columnName) { |
|
302 | 302 | return $this->platform->quoteIdentifier($columnName); |
303 | 303 | }, |
304 | 304 | array_keys($versionedClass->getIdentifierColumns($this->em)) |
305 | 305 | ); |
306 | 306 | |
307 | 307 | // FIXME: Order with composite keys might not be correct |
308 | - $sql = 'SELECT ' . $columnName |
|
309 | - . ' FROM ' . $tableName |
|
310 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
308 | + $sql = 'SELECT '.$columnName |
|
309 | + . ' FROM '.$tableName |
|
310 | + . ' WHERE '.implode(' = ? AND ', $identifier).' = ?'; |
|
311 | 311 | |
312 | 312 | $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id); |
313 | 313 | $versionType = $versionProperty->getType(); |
@@ -346,13 +346,13 @@ discard block |
||
346 | 346 | $tableName = $this->class->getTableName(); |
347 | 347 | $updateData = $this->prepareUpdateData($entity); |
348 | 348 | |
349 | - if (! isset($updateData[$tableName])) { |
|
349 | + if ( ! isset($updateData[$tableName])) { |
|
350 | 350 | return; |
351 | 351 | } |
352 | 352 | |
353 | 353 | $data = $updateData[$tableName]; |
354 | 354 | |
355 | - if (! $data) { |
|
355 | + if ( ! $data) { |
|
356 | 356 | return; |
357 | 357 | } |
358 | 358 | |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | |
405 | 405 | if ($value !== null) { |
406 | 406 | // @todo guilhermeblanco Make sure we do not have flat association values. |
407 | - if (! is_array($value)) { |
|
407 | + if ( ! is_array($value)) { |
|
408 | 408 | $value = [$targetClass->identifier[0] => $value]; |
409 | 409 | } |
410 | 410 | |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
418 | 418 | $targetField = $targetClass->fieldNames[$referencedColumnName]; |
419 | 419 | |
420 | - if (! $joinColumn->getType()) { |
|
420 | + if ( ! $joinColumn->getType()) { |
|
421 | 421 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
422 | 422 | } |
423 | 423 | |
@@ -483,7 +483,7 @@ discard block |
||
483 | 483 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
484 | 484 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
485 | 485 | |
486 | - if (! $joinColumn->getType()) { |
|
486 | + if ( ! $joinColumn->getType()) { |
|
487 | 487 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
488 | 488 | } |
489 | 489 | |
@@ -510,18 +510,18 @@ discard block |
||
510 | 510 | case Type::SMALLINT: |
511 | 511 | case Type::INTEGER: |
512 | 512 | case Type::BIGINT: |
513 | - $set[] = $versionColumnName . ' = ' . $versionColumnName . ' + 1'; |
|
513 | + $set[] = $versionColumnName.' = '.$versionColumnName.' + 1'; |
|
514 | 514 | break; |
515 | 515 | |
516 | 516 | case Type::DATETIME: |
517 | - $set[] = $versionColumnName . ' = CURRENT_TIMESTAMP'; |
|
517 | + $set[] = $versionColumnName.' = CURRENT_TIMESTAMP'; |
|
518 | 518 | break; |
519 | 519 | } |
520 | 520 | } |
521 | 521 | |
522 | - $sql = 'UPDATE ' . $quotedTableName |
|
523 | - . ' SET ' . implode(', ', $set) |
|
524 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
522 | + $sql = 'UPDATE '.$quotedTableName |
|
523 | + . ' SET '.implode(', ', $set) |
|
524 | + . ' WHERE '.implode(' = ? AND ', $where).' = ?'; |
|
525 | 525 | |
526 | 526 | $result = $this->conn->executeUpdate($sql, $params, $types); |
527 | 527 | |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | protected function deleteJoinTableRecords($identifier) |
539 | 539 | { |
540 | 540 | foreach ($this->class->getDeclaredPropertiesIterator() as $association) { |
541 | - if (! ($association instanceof ManyToManyAssociationMetadata)) { |
|
541 | + if ( ! ($association instanceof ManyToManyAssociationMetadata)) { |
|
542 | 542 | continue; |
543 | 543 | } |
544 | 544 | |
@@ -550,7 +550,7 @@ discard block |
||
550 | 550 | $otherKeys = []; |
551 | 551 | $keys = []; |
552 | 552 | |
553 | - if (! $owningAssociation->isOwningSide()) { |
|
553 | + if ( ! $owningAssociation->isOwningSide()) { |
|
554 | 554 | $class = $this->em->getClassMetadata($association->getTargetEntity()); |
555 | 555 | $owningAssociation = $class->getProperty($association->getMappedBy()); |
556 | 556 | } |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | } |
661 | 661 | |
662 | 662 | // Only owning side of x-1 associations can have a FK column. |
663 | - if (! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
663 | + if ( ! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
664 | 664 | continue; |
665 | 665 | } |
666 | 666 | |
@@ -680,7 +680,7 @@ discard block |
||
680 | 680 | /** @var JoinColumnMetadata $joinColumn */ |
681 | 681 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
682 | 682 | |
683 | - if (! $joinColumn->getType()) { |
|
683 | + if ( ! $joinColumn->getType()) { |
|
684 | 684 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
685 | 685 | } |
686 | 686 | |
@@ -707,7 +707,7 @@ discard block |
||
707 | 707 | $propertyName = $this->class->fieldNames[$columnName]; |
708 | 708 | $property = $this->class->getProperty($propertyName); |
709 | 709 | |
710 | - if (! $property) { |
|
710 | + if ( ! $property) { |
|
711 | 711 | return null; |
712 | 712 | } |
713 | 713 | |
@@ -726,7 +726,7 @@ discard block |
||
726 | 726 | /** @var JoinColumnMetadata $joinColumn */ |
727 | 727 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
728 | 728 | |
729 | - if (! $joinColumn->getType()) { |
|
729 | + if ( ! $joinColumn->getType()) { |
|
730 | 730 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
731 | 731 | } |
732 | 732 | |
@@ -831,7 +831,7 @@ discard block |
||
831 | 831 | $sourceKeyColumn = $joinColumn->getReferencedColumnName(); |
832 | 832 | $targetKeyColumn = $joinColumn->getColumnName(); |
833 | 833 | |
834 | - if (! isset($sourceClass->fieldNames[$sourceKeyColumn])) { |
|
834 | + if ( ! isset($sourceClass->fieldNames[$sourceKeyColumn])) { |
|
835 | 835 | throw MappingException::joinColumnMustPointToMappedField( |
836 | 836 | $sourceClass->getClassName(), |
837 | 837 | $sourceKeyColumn |
@@ -1058,7 +1058,7 @@ discard block |
||
1058 | 1058 | $criteria = []; |
1059 | 1059 | $parameters = []; |
1060 | 1060 | |
1061 | - if (! $association->isOwningSide()) { |
|
1061 | + if ( ! $association->isOwningSide()) { |
|
1062 | 1062 | $class = $this->em->getClassMetadata($association->getTargetEntity()); |
1063 | 1063 | $owningAssoc = $class->getProperty($association->getMappedBy()); |
1064 | 1064 | } |
@@ -1086,7 +1086,7 @@ discard block |
||
1086 | 1086 | $value = $value[$targetClass->identifier[0]]; |
1087 | 1087 | } |
1088 | 1088 | |
1089 | - $criteria[$joinTableName . '.' . $quotedColumnName] = $value; |
|
1089 | + $criteria[$joinTableName.'.'.$quotedColumnName] = $value; |
|
1090 | 1090 | $parameters[] = [ |
1091 | 1091 | 'value' => $value, |
1092 | 1092 | 'field' => $fieldName, |
@@ -1136,11 +1136,11 @@ discard block |
||
1136 | 1136 | |
1137 | 1137 | switch ($lockMode) { |
1138 | 1138 | case LockMode::PESSIMISTIC_READ: |
1139 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
1139 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
1140 | 1140 | break; |
1141 | 1141 | |
1142 | 1142 | case LockMode::PESSIMISTIC_WRITE: |
1143 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
1143 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
1144 | 1144 | break; |
1145 | 1145 | } |
1146 | 1146 | |
@@ -1151,14 +1151,14 @@ discard block |
||
1151 | 1151 | |
1152 | 1152 | if ($filterSql !== '') { |
1153 | 1153 | $conditionSql = $conditionSql |
1154 | - ? $conditionSql . ' AND ' . $filterSql |
|
1154 | + ? $conditionSql.' AND '.$filterSql |
|
1155 | 1155 | : $filterSql; |
1156 | 1156 | } |
1157 | 1157 | |
1158 | - $select = 'SELECT ' . $columnList; |
|
1159 | - $from = ' FROM ' . $tableName . ' ' . $tableAlias; |
|
1160 | - $join = $this->currentPersisterContext->selectJoinSql . $joinSql; |
|
1161 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : ''); |
|
1158 | + $select = 'SELECT '.$columnList; |
|
1159 | + $from = ' FROM '.$tableName.' '.$tableAlias; |
|
1160 | + $join = $this->currentPersisterContext->selectJoinSql.$joinSql; |
|
1161 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : ''); |
|
1162 | 1162 | $lock = $this->platform->appendLockHint($from, $lockMode); |
1163 | 1163 | $query = $select |
1164 | 1164 | . $lock |
@@ -1166,7 +1166,7 @@ discard block |
||
1166 | 1166 | . $where |
1167 | 1167 | . $orderBySql; |
1168 | 1168 | |
1169 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
1169 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
1170 | 1170 | } |
1171 | 1171 | |
1172 | 1172 | /** |
@@ -1185,13 +1185,13 @@ discard block |
||
1185 | 1185 | |
1186 | 1186 | if ($filterSql !== '') { |
1187 | 1187 | $conditionSql = $conditionSql |
1188 | - ? $conditionSql . ' AND ' . $filterSql |
|
1188 | + ? $conditionSql.' AND '.$filterSql |
|
1189 | 1189 | : $filterSql; |
1190 | 1190 | } |
1191 | 1191 | |
1192 | 1192 | return 'SELECT COUNT(*) ' |
1193 | - . 'FROM ' . $tableName . ' ' . $tableAlias |
|
1194 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
1193 | + . 'FROM '.$tableName.' '.$tableAlias |
|
1194 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
1195 | 1195 | } |
1196 | 1196 | |
1197 | 1197 | /** |
@@ -1206,7 +1206,7 @@ discard block |
||
1206 | 1206 | */ |
1207 | 1207 | final protected function getOrderBySQL(array $orderBy, $baseTableAlias) |
1208 | 1208 | { |
1209 | - if (! $orderBy) { |
|
1209 | + if ( ! $orderBy) { |
|
1210 | 1210 | return ''; |
1211 | 1211 | } |
1212 | 1212 | |
@@ -1215,7 +1215,7 @@ discard block |
||
1215 | 1215 | foreach ($orderBy as $fieldName => $orientation) { |
1216 | 1216 | $orientation = strtoupper(trim($orientation)); |
1217 | 1217 | |
1218 | - if (! in_array($orientation, ['ASC', 'DESC'], true)) { |
|
1218 | + if ( ! in_array($orientation, ['ASC', 'DESC'], true)) { |
|
1219 | 1219 | throw InvalidOrientation::fromClassNameAndField($this->class->getClassName(), $fieldName); |
1220 | 1220 | } |
1221 | 1221 | |
@@ -1225,11 +1225,11 @@ discard block |
||
1225 | 1225 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
1226 | 1226 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
1227 | 1227 | |
1228 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
1228 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
1229 | 1229 | |
1230 | 1230 | continue; |
1231 | 1231 | } elseif ($property instanceof AssociationMetadata) { |
1232 | - if (! $property->isOwningSide()) { |
|
1232 | + if ( ! $property->isOwningSide()) { |
|
1233 | 1233 | throw InvalidFindByCall::fromInverseSideUsage( |
1234 | 1234 | $this->class->getClassName(), |
1235 | 1235 | $fieldName |
@@ -1245,7 +1245,7 @@ discard block |
||
1245 | 1245 | /** @var JoinColumnMetadata $joinColumn */ |
1246 | 1246 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1247 | 1247 | |
1248 | - $orderByList[] = $tableAlias . '.' . $quotedColumnName . ' ' . $orientation; |
|
1248 | + $orderByList[] = $tableAlias.'.'.$quotedColumnName.' '.$orientation; |
|
1249 | 1249 | } |
1250 | 1250 | |
1251 | 1251 | continue; |
@@ -1254,7 +1254,7 @@ discard block |
||
1254 | 1254 | throw UnrecognizedField::byName($fieldName); |
1255 | 1255 | } |
1256 | 1256 | |
1257 | - return ' ORDER BY ' . implode(', ', $orderByList); |
|
1257 | + return ' ORDER BY '.implode(', ', $orderByList); |
|
1258 | 1258 | } |
1259 | 1259 | |
1260 | 1260 | /** |
@@ -1296,7 +1296,7 @@ discard block |
||
1296 | 1296 | $isAssocToOneInverseSide = $property instanceof ToOneAssociationMetadata && ! $property->isOwningSide(); |
1297 | 1297 | $isAssocFromOneEager = ! $property instanceof ManyToManyAssociationMetadata && $property->getFetchMode() === FetchMode::EAGER; |
1298 | 1298 | |
1299 | - if (! ($isAssocFromOneEager || $isAssocToOneInverseSide)) { |
|
1299 | + if ( ! ($isAssocFromOneEager || $isAssocToOneInverseSide)) { |
|
1300 | 1300 | break; |
1301 | 1301 | } |
1302 | 1302 | |
@@ -1311,7 +1311,7 @@ discard block |
||
1311 | 1311 | break; // now this is why you shouldn't use inheritance |
1312 | 1312 | } |
1313 | 1313 | |
1314 | - $assocAlias = 'e' . ($eagerAliasCounter++); |
|
1314 | + $assocAlias = 'e'.($eagerAliasCounter++); |
|
1315 | 1315 | |
1316 | 1316 | $this->currentPersisterContext->rsm->addJoinedEntityResult($targetEntity, $assocAlias, 'r', $fieldName); |
1317 | 1317 | |
@@ -1339,14 +1339,14 @@ discard block |
||
1339 | 1339 | $this->currentPersisterContext->rsm->addIndexBy($assocAlias, $property->getIndexedBy()); |
1340 | 1340 | } |
1341 | 1341 | |
1342 | - if (! $property->isOwningSide()) { |
|
1342 | + if ( ! $property->isOwningSide()) { |
|
1343 | 1343 | $owningAssociation = $eagerEntity->getProperty($property->getMappedBy()); |
1344 | 1344 | } |
1345 | 1345 | |
1346 | 1346 | $joinTableAlias = $this->getSQLTableAlias($eagerEntity->getTableName(), $assocAlias); |
1347 | 1347 | $joinTableName = $eagerEntity->table->getQuotedQualifiedName($this->platform); |
1348 | 1348 | |
1349 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $this->getJoinSQLForAssociation($property); |
|
1349 | + $this->currentPersisterContext->selectJoinSql .= ' '.$this->getJoinSQLForAssociation($property); |
|
1350 | 1350 | |
1351 | 1351 | $sourceClass = $this->em->getClassMetadata($owningAssociation->getSourceEntity()); |
1352 | 1352 | $targetClass = $this->em->getClassMetadata($owningAssociation->getTargetEntity()); |
@@ -1370,7 +1370,7 @@ discard block |
||
1370 | 1370 | $joinCondition[] = $filterSql; |
1371 | 1371 | } |
1372 | 1372 | |
1373 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $joinTableName . ' ' . $joinTableAlias . ' ON '; |
|
1373 | + $this->currentPersisterContext->selectJoinSql .= ' '.$joinTableName.' '.$joinTableAlias.' ON '; |
|
1374 | 1374 | $this->currentPersisterContext->selectJoinSql .= implode(' AND ', $joinCondition); |
1375 | 1375 | |
1376 | 1376 | break; |
@@ -1392,7 +1392,7 @@ discard block |
||
1392 | 1392 | */ |
1393 | 1393 | protected function getSelectColumnAssociationSQL($field, AssociationMetadata $association, ClassMetadata $class, $alias = 'r') |
1394 | 1394 | { |
1395 | - if (! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
1395 | + if ( ! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
1396 | 1396 | return ''; |
1397 | 1397 | } |
1398 | 1398 | |
@@ -1407,7 +1407,7 @@ discard block |
||
1407 | 1407 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
1408 | 1408 | $resultColumnName = $this->getSQLColumnAlias(); |
1409 | 1409 | |
1410 | - if (! $joinColumn->getType()) { |
|
1410 | + if ( ! $joinColumn->getType()) { |
|
1411 | 1411 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
1412 | 1412 | } |
1413 | 1413 | |
@@ -1437,7 +1437,7 @@ discard block |
||
1437 | 1437 | $owningAssociation = $association; |
1438 | 1438 | $sourceTableAlias = $this->getSQLTableAlias($this->class->getTableName()); |
1439 | 1439 | |
1440 | - if (! $association->isOwningSide()) { |
|
1440 | + if ( ! $association->isOwningSide()) { |
|
1441 | 1441 | $targetEntity = $this->em->getClassMetadata($association->getTargetEntity()); |
1442 | 1442 | $owningAssociation = $targetEntity->getProperty($association->getMappedBy()); |
1443 | 1443 | } |
@@ -1458,7 +1458,7 @@ discard block |
||
1458 | 1458 | ); |
1459 | 1459 | } |
1460 | 1460 | |
1461 | - return ' INNER JOIN ' . $joinTableName . ' ON ' . implode(' AND ', $conditions); |
|
1461 | + return ' INNER JOIN '.$joinTableName.' ON '.implode(' AND ', $conditions); |
|
1462 | 1462 | } |
1463 | 1463 | |
1464 | 1464 | /** |
@@ -1552,7 +1552,7 @@ discard block |
||
1552 | 1552 | $columnName = $joinColumn->getColumnName(); |
1553 | 1553 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
1554 | 1554 | |
1555 | - if (! $joinColumn->getType()) { |
|
1555 | + if ( ! $joinColumn->getType()) { |
|
1556 | 1556 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
1557 | 1557 | } |
1558 | 1558 | |
@@ -1591,7 +1591,7 @@ discard block |
||
1591 | 1591 | |
1592 | 1592 | $this->currentPersisterContext->rsm->addFieldResult($alias, $columnAlias, $field, $class->getClassName()); |
1593 | 1593 | |
1594 | - return $property->getType()->convertToPHPValueSQL($sql, $this->platform) . ' AS ' . $columnAlias; |
|
1594 | + return $property->getType()->convertToPHPValueSQL($sql, $this->platform).' AS '.$columnAlias; |
|
1595 | 1595 | } |
1596 | 1596 | |
1597 | 1597 | /** |
@@ -1605,14 +1605,14 @@ discard block |
||
1605 | 1605 | protected function getSQLTableAlias($tableName, $assocName = '') |
1606 | 1606 | { |
1607 | 1607 | if ($tableName) { |
1608 | - $tableName .= '#' . $assocName; |
|
1608 | + $tableName .= '#'.$assocName; |
|
1609 | 1609 | } |
1610 | 1610 | |
1611 | 1611 | if (isset($this->currentPersisterContext->sqlTableAliases[$tableName])) { |
1612 | 1612 | return $this->currentPersisterContext->sqlTableAliases[$tableName]; |
1613 | 1613 | } |
1614 | 1614 | |
1615 | - $tableAlias = 't' . $this->currentPersisterContext->sqlAliasCounter++; |
|
1615 | + $tableAlias = 't'.$this->currentPersisterContext->sqlAliasCounter++; |
|
1616 | 1616 | |
1617 | 1617 | $this->currentPersisterContext->sqlTableAliases[$tableName] = $tableAlias; |
1618 | 1618 | |
@@ -1638,7 +1638,7 @@ discard block |
||
1638 | 1638 | } |
1639 | 1639 | |
1640 | 1640 | $lock = $this->getLockTablesSql($lockMode); |
1641 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
|
1641 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : '').' '; |
|
1642 | 1642 | $sql = 'SELECT 1 ' |
1643 | 1643 | . $lock |
1644 | 1644 | . $where |
@@ -1661,7 +1661,7 @@ discard block |
||
1661 | 1661 | $tableName = $this->class->table->getQuotedQualifiedName($this->platform); |
1662 | 1662 | |
1663 | 1663 | return $this->platform->appendLockHint( |
1664 | - 'FROM ' . $tableName . ' ' . $this->getSQLTableAlias($this->class->getTableName()), |
|
1664 | + 'FROM '.$tableName.' '.$this->getSQLTableAlias($this->class->getTableName()), |
|
1665 | 1665 | $lockMode |
1666 | 1666 | ); |
1667 | 1667 | } |
@@ -1711,19 +1711,19 @@ discard block |
||
1711 | 1711 | |
1712 | 1712 | if ($comparison !== null) { |
1713 | 1713 | // special case null value handling |
1714 | - if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && $value ===null) { |
|
1715 | - $selectedColumns[] = $column . ' IS NULL'; |
|
1714 | + if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && $value === null) { |
|
1715 | + $selectedColumns[] = $column.' IS NULL'; |
|
1716 | 1716 | |
1717 | 1717 | continue; |
1718 | 1718 | } |
1719 | 1719 | |
1720 | 1720 | if ($comparison === Comparison::NEQ && $value === null) { |
1721 | - $selectedColumns[] = $column . ' IS NOT NULL'; |
|
1721 | + $selectedColumns[] = $column.' IS NOT NULL'; |
|
1722 | 1722 | |
1723 | 1723 | continue; |
1724 | 1724 | } |
1725 | 1725 | |
1726 | - $selectedColumns[] = $column . ' ' . sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1726 | + $selectedColumns[] = $column.' '.sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1727 | 1727 | |
1728 | 1728 | continue; |
1729 | 1729 | } |
@@ -1771,7 +1771,7 @@ discard block |
||
1771 | 1771 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
1772 | 1772 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
1773 | 1773 | |
1774 | - return [$tableAlias . '.' . $columnName]; |
|
1774 | + return [$tableAlias.'.'.$columnName]; |
|
1775 | 1775 | } |
1776 | 1776 | |
1777 | 1777 | if ($property instanceof AssociationMetadata) { |
@@ -1780,7 +1780,7 @@ discard block |
||
1780 | 1780 | |
1781 | 1781 | // Many-To-Many requires join table check for joinColumn |
1782 | 1782 | if ($owningAssociation instanceof ManyToManyAssociationMetadata) { |
1783 | - if (! $owningAssociation->isOwningSide()) { |
|
1783 | + if ( ! $owningAssociation->isOwningSide()) { |
|
1784 | 1784 | $owningAssociation = $association; |
1785 | 1785 | } |
1786 | 1786 | |
@@ -1793,10 +1793,10 @@ discard block |
||
1793 | 1793 | foreach ($joinColumns as $joinColumn) { |
1794 | 1794 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1795 | 1795 | |
1796 | - $columns[] = $joinTableName . '.' . $quotedColumnName; |
|
1796 | + $columns[] = $joinTableName.'.'.$quotedColumnName; |
|
1797 | 1797 | } |
1798 | 1798 | } else { |
1799 | - if (! $owningAssociation->isOwningSide()) { |
|
1799 | + if ( ! $owningAssociation->isOwningSide()) { |
|
1800 | 1800 | throw InvalidFindByCall::fromInverseSideUsage( |
1801 | 1801 | $this->class->getClassName(), |
1802 | 1802 | $field |
@@ -1811,7 +1811,7 @@ discard block |
||
1811 | 1811 | foreach ($owningAssociation->getJoinColumns() as $joinColumn) { |
1812 | 1812 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1813 | 1813 | |
1814 | - $columns[] = $tableAlias . '.' . $quotedColumnName; |
|
1814 | + $columns[] = $tableAlias.'.'.$quotedColumnName; |
|
1815 | 1815 | } |
1816 | 1816 | } |
1817 | 1817 | |
@@ -1920,7 +1920,7 @@ discard block |
||
1920 | 1920 | $value = $value[$targetClass->identifier[0]]; |
1921 | 1921 | } |
1922 | 1922 | |
1923 | - $criteria[$tableAlias . '.' . $quotedColumnName] = $value; |
|
1923 | + $criteria[$tableAlias.'.'.$quotedColumnName] = $value; |
|
1924 | 1924 | $parameters[] = [ |
1925 | 1925 | 'value' => $value, |
1926 | 1926 | 'field' => $fieldName, |
@@ -2005,7 +2005,7 @@ discard block |
||
2005 | 2005 | case $property instanceof AssociationMetadata: |
2006 | 2006 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
2007 | 2007 | |
2008 | - if (! $property->isOwningSide()) { |
|
2008 | + if ( ! $property->isOwningSide()) { |
|
2009 | 2009 | $property = $class->getProperty($property->getMappedBy()); |
2010 | 2010 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
2011 | 2011 | } |
@@ -2018,7 +2018,7 @@ discard block |
||
2018 | 2018 | /** @var JoinColumnMetadata $joinColumn */ |
2019 | 2019 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
2020 | 2020 | |
2021 | - if (! $joinColumn->getType()) { |
|
2021 | + if ( ! $joinColumn->getType()) { |
|
2022 | 2022 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em)); |
2023 | 2023 | } |
2024 | 2024 | |
@@ -2033,7 +2033,7 @@ discard block |
||
2033 | 2033 | } |
2034 | 2034 | |
2035 | 2035 | if (is_array($value)) { |
2036 | - return array_map(static function ($type) { |
|
2036 | + return array_map(static function($type) { |
|
2037 | 2037 | return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET; |
2038 | 2038 | }, $types); |
2039 | 2039 | } |
@@ -2090,7 +2090,7 @@ discard block |
||
2090 | 2090 | */ |
2091 | 2091 | private function getIndividualValue($value) |
2092 | 2092 | { |
2093 | - if (! is_object($value) || ! $this->em->getMetadataFactory()->hasMetadataFor(StaticClassNameConverter::getClass($value))) { |
|
2093 | + if ( ! is_object($value) || ! $this->em->getMetadataFactory()->hasMetadataFor(StaticClassNameConverter::getClass($value))) { |
|
2094 | 2094 | return $value; |
2095 | 2095 | } |
2096 | 2096 | |
@@ -2104,7 +2104,7 @@ discard block |
||
2104 | 2104 | { |
2105 | 2105 | $criteria = $this->getIdentifier($entity); |
2106 | 2106 | |
2107 | - if (! $criteria) { |
|
2107 | + if ( ! $criteria) { |
|
2108 | 2108 | return false; |
2109 | 2109 | } |
2110 | 2110 | |
@@ -2112,12 +2112,12 @@ discard block |
||
2112 | 2112 | |
2113 | 2113 | $sql = 'SELECT 1 ' |
2114 | 2114 | . $this->getLockTablesSql(null) |
2115 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
2115 | + . ' WHERE '.$this->getSelectConditionSQL($criteria); |
|
2116 | 2116 | |
2117 | 2117 | [$params, $types] = $this->expandParameters($criteria); |
2118 | 2118 | |
2119 | 2119 | if ($extraConditions !== null) { |
2120 | - $sql .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions); |
|
2120 | + $sql .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions); |
|
2121 | 2121 | [$criteriaParams, $criteriaTypes] = $this->expandCriteriaParameters($extraConditions); |
2122 | 2122 | |
2123 | 2123 | $params = array_merge($params, $criteriaParams); |
@@ -2127,7 +2127,7 @@ discard block |
||
2127 | 2127 | $filterSql = $this->generateFilterConditionSQL($this->class, $alias); |
2128 | 2128 | |
2129 | 2129 | if ($filterSql) { |
2130 | - $sql .= ' AND ' . $filterSql; |
|
2130 | + $sql .= ' AND '.$filterSql; |
|
2131 | 2131 | } |
2132 | 2132 | |
2133 | 2133 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
@@ -2140,13 +2140,13 @@ discard block |
||
2140 | 2140 | */ |
2141 | 2141 | protected function getJoinSQLForAssociation(AssociationMetadata $association) |
2142 | 2142 | { |
2143 | - if (! $association->isOwningSide()) { |
|
2143 | + if ( ! $association->isOwningSide()) { |
|
2144 | 2144 | return 'LEFT JOIN'; |
2145 | 2145 | } |
2146 | 2146 | |
2147 | 2147 | // if one of the join columns is nullable, return left join |
2148 | 2148 | foreach ($association->getJoinColumns() as $joinColumn) { |
2149 | - if (! $joinColumn->isNullable()) { |
|
2149 | + if ( ! $joinColumn->isNullable()) { |
|
2150 | 2150 | continue; |
2151 | 2151 | } |
2152 | 2152 | |
@@ -2163,7 +2163,7 @@ discard block |
||
2163 | 2163 | */ |
2164 | 2164 | public function getSQLColumnAlias() |
2165 | 2165 | { |
2166 | - return $this->platform->getSQLResultCasing('c' . $this->currentPersisterContext->sqlAliasCounter++); |
|
2166 | + return $this->platform->getSQLResultCasing('c'.$this->currentPersisterContext->sqlAliasCounter++); |
|
2167 | 2167 | } |
2168 | 2168 | |
2169 | 2169 | /** |
@@ -2182,13 +2182,13 @@ discard block |
||
2182 | 2182 | $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias); |
2183 | 2183 | |
2184 | 2184 | if ($filterExpr !== '') { |
2185 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
2185 | + $filterClauses[] = '('.$filterExpr.')'; |
|
2186 | 2186 | } |
2187 | 2187 | } |
2188 | 2188 | |
2189 | 2189 | $sql = implode(' AND ', $filterClauses); |
2190 | 2190 | |
2191 | - return $sql ? '(' . $sql . ')' : ''; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2191 | + return $sql ? '('.$sql.')' : ''; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2192 | 2192 | } |
2193 | 2193 | |
2194 | 2194 | /** |
@@ -305,8 +305,8 @@ discard block |
||
305 | 305 | |
306 | 306 | // FIXME: Order with composite keys might not be correct |
307 | 307 | $sql = 'SELECT ' . $columnName |
308 | - . ' FROM ' . $tableName |
|
309 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
308 | + . ' FROM ' . $tableName |
|
309 | + . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
310 | 310 | |
311 | 311 | $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id); |
312 | 312 | $versionType = $versionProperty->getType(); |
@@ -519,8 +519,8 @@ discard block |
||
519 | 519 | } |
520 | 520 | |
521 | 521 | $sql = 'UPDATE ' . $quotedTableName |
522 | - . ' SET ' . implode(', ', $set) |
|
523 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
522 | + . ' SET ' . implode(', ', $set) |
|
523 | + . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
524 | 524 | |
525 | 525 | $result = $this->conn->executeUpdate($sql, $params, $types); |
526 | 526 | |
@@ -1641,9 +1641,9 @@ discard block |
||
1641 | 1641 | $lock = $this->getLockTablesSql($lockMode); |
1642 | 1642 | $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
1643 | 1643 | $sql = 'SELECT 1 ' |
1644 | - . $lock |
|
1645 | - . $where |
|
1646 | - . $lockSql; |
|
1644 | + . $lock |
|
1645 | + . $where |
|
1646 | + . $lockSql; |
|
1647 | 1647 | |
1648 | 1648 | [$params, $types] = $this->expandParameters($criteria); |
1649 | 1649 | |
@@ -2112,8 +2112,8 @@ discard block |
||
2112 | 2112 | $alias = $this->getSQLTableAlias($this->class->getTableName()); |
2113 | 2113 | |
2114 | 2114 | $sql = 'SELECT 1 ' |
2115 | - . $this->getLockTablesSql(null) |
|
2116 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
2115 | + . $this->getLockTablesSql(null) |
|
2116 | + . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
2117 | 2117 | |
2118 | 2118 | [$params, $types] = $this->expandParameters($criteria); |
2119 | 2119 |
@@ -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) . $lockSql; |
|
262 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$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); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | { |
38 | 38 | $association = $collection->getMapping(); |
39 | 39 | |
40 | - if (! $association->isOwningSide()) { |
|
40 | + if ( ! $association->isOwningSide()) { |
|
41 | 41 | return; // ignore inverse side |
42 | 42 | } |
43 | 43 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | /** @var JoinColumnMetadata $joinColumn */ |
50 | 50 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
51 | 51 | |
52 | - if (! $joinColumn->getType()) { |
|
52 | + if ( ! $joinColumn->getType()) { |
|
53 | 53 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em)); |
54 | 54 | } |
55 | 55 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | { |
70 | 70 | $association = $collection->getMapping(); |
71 | 71 | |
72 | - if (! $association->isOwningSide()) { |
|
72 | + if ( ! $association->isOwningSide()) { |
|
73 | 73 | return; // ignore inverse side |
74 | 74 | } |
75 | 75 | |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | { |
101 | 101 | $association = $collection->getMapping(); |
102 | 102 | |
103 | - if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
103 | + if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
104 | 104 | throw new BadMethodCallException('Selecting a collection by index is only supported on indexed collections.'); |
105 | 105 | } |
106 | 106 | |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
145 | 145 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
146 | 146 | |
147 | - if (! $joinColumn->getType()) { |
|
147 | + if ( ! $joinColumn->getType()) { |
|
148 | 148 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $sourceClass, $this->em)); |
149 | 149 | } |
150 | 150 | |
@@ -176,9 +176,9 @@ discard block |
||
176 | 176 | }*/ |
177 | 177 | |
178 | 178 | $sql = 'SELECT COUNT(*)' |
179 | - . ' FROM ' . $joinTableName . ' t' |
|
179 | + . ' FROM '.$joinTableName.' t' |
|
180 | 180 | . $joinTargetEntitySQL |
181 | - . ' WHERE ' . implode(' AND ', $conditions); |
|
181 | + . ' WHERE '.implode(' AND ', $conditions); |
|
182 | 182 | |
183 | 183 | return $this->conn->fetchColumn($sql, $params, 0, $types); |
184 | 184 | } |
@@ -200,13 +200,13 @@ discard block |
||
200 | 200 | { |
201 | 201 | $association = $collection->getMapping(); |
202 | 202 | |
203 | - if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
203 | + if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
204 | 204 | throw new BadMethodCallException('Selecting a collection by index is only supported on indexed collections.'); |
205 | 205 | } |
206 | 206 | |
207 | 207 | [$quotedJoinTable, $whereClauses, $params, $types] = $this->getJoinTableRestrictionsWithKey($collection, $key, true); |
208 | 208 | |
209 | - $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
|
209 | + $sql = 'SELECT 1 FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses); |
|
210 | 210 | |
211 | 211 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
212 | 212 | } |
@@ -216,13 +216,13 @@ discard block |
||
216 | 216 | */ |
217 | 217 | public function contains(PersistentCollection $collection, $element) |
218 | 218 | { |
219 | - if (! $this->isValidEntityState($element)) { |
|
219 | + if ( ! $this->isValidEntityState($element)) { |
|
220 | 220 | return false; |
221 | 221 | } |
222 | 222 | |
223 | 223 | [$quotedJoinTable, $whereClauses, $params, $types] = $this->getJoinTableRestrictions($collection, $element, true); |
224 | 224 | |
225 | - $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
|
225 | + $sql = 'SELECT 1 FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses); |
|
226 | 226 | |
227 | 227 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
228 | 228 | } |
@@ -232,13 +232,13 @@ discard block |
||
232 | 232 | */ |
233 | 233 | public function removeElement(PersistentCollection $collection, $element) |
234 | 234 | { |
235 | - if (! $this->isValidEntityState($element)) { |
|
235 | + if ( ! $this->isValidEntityState($element)) { |
|
236 | 236 | return false; |
237 | 237 | } |
238 | 238 | |
239 | 239 | [$quotedJoinTable, $whereClauses, $params, $types] = $this->getJoinTableRestrictions($collection, $element, false); |
240 | 240 | |
241 | - $sql = 'DELETE FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
|
241 | + $sql = 'DELETE FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses); |
|
242 | 242 | |
243 | 243 | return (bool) $this->conn->executeUpdate($sql, $params, $types); |
244 | 244 | } |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | $onConditions = $this->getOnConditionSQL($association); |
257 | 257 | $whereClauses = $params = $types = []; |
258 | 258 | |
259 | - if (! $association->isOwningSide()) { |
|
259 | + if ( ! $association->isOwningSide()) { |
|
260 | 260 | $association = $targetClass->getProperty($association->getMappedBy()); |
261 | 261 | $joinColumns = $association->getJoinTable()->getInverseJoinColumns(); |
262 | 262 | } else { |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
269 | 269 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
270 | 270 | |
271 | - if (! $joinColumn->getType()) { |
|
271 | + if ( ! $joinColumn->getType()) { |
|
272 | 272 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $ownerMetadata, $this->em)); |
273 | 273 | } |
274 | 274 | |
@@ -296,11 +296,11 @@ discard block |
||
296 | 296 | |
297 | 297 | $resultSetMapping->addRootEntityFromClassMetadata($targetClass->getClassName(), 'te'); |
298 | 298 | |
299 | - $sql = 'SELECT ' . $resultSetMapping->generateSelectClause() |
|
300 | - . ' FROM ' . $tableName . ' te' |
|
301 | - . ' JOIN ' . $joinTableName . ' t ON' |
|
299 | + $sql = 'SELECT '.$resultSetMapping->generateSelectClause() |
|
300 | + . ' FROM '.$tableName.' te' |
|
301 | + . ' JOIN '.$joinTableName.' t ON' |
|
302 | 302 | . implode(' AND ', $onConditions) |
303 | - . ' WHERE ' . implode(' AND ', $whereClauses); |
|
303 | + . ' WHERE '.implode(' AND ', $whereClauses); |
|
304 | 304 | |
305 | 305 | $sql .= $this->getOrderingSql($criteria, $targetClass); |
306 | 306 | $sql .= $this->getLimitSql($criteria); |
@@ -335,8 +335,8 @@ discard block |
||
335 | 335 | |
336 | 336 | // A join is needed if there is filtering on the target entity |
337 | 337 | $tableName = $rootClass->table->getQuotedQualifiedName($this->platform); |
338 | - $joinSql = ' JOIN ' . $tableName . ' te' |
|
339 | - . ' ON' . implode(' AND ', $this->getOnConditionSQL($association)); |
|
338 | + $joinSql = ' JOIN '.$tableName.' te' |
|
339 | + . ' ON'.implode(' AND ', $this->getOnConditionSQL($association)); |
|
340 | 340 | |
341 | 341 | return [$joinSql, $filterSql]; |
342 | 342 | } |
@@ -357,18 +357,18 @@ discard block |
||
357 | 357 | $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias); |
358 | 358 | |
359 | 359 | if ($filterExpr) { |
360 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
360 | + $filterClauses[] = '('.$filterExpr.')'; |
|
361 | 361 | } |
362 | 362 | } |
363 | 363 | |
364 | - if (! $filterClauses) { |
|
364 | + if ( ! $filterClauses) { |
|
365 | 365 | return ''; |
366 | 366 | } |
367 | 367 | |
368 | 368 | $filterSql = implode(' AND ', $filterClauses); |
369 | 369 | |
370 | 370 | return isset($filterClauses[1]) |
371 | - ? '(' . $filterSql . ')' |
|
371 | + ? '('.$filterSql.')' |
|
372 | 372 | : $filterSql; |
373 | 373 | } |
374 | 374 | |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
396 | 396 | $quotedReferencedColumnName = $this->platform->quoteIdentifier($joinColumn->getReferencedColumnName()); |
397 | 397 | |
398 | - $conditions[] = ' t.' . $quotedColumnName . ' = te.' . $quotedReferencedColumnName; |
|
398 | + $conditions[] = ' t.'.$quotedColumnName.' = te.'.$quotedReferencedColumnName; |
|
399 | 399 | } |
400 | 400 | |
401 | 401 | return $conditions; |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | $columns[] = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
418 | 418 | } |
419 | 419 | |
420 | - return 'DELETE FROM ' . $joinTableName . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?'; |
|
420 | + return 'DELETE FROM '.$joinTableName.' WHERE '.implode(' = ? AND ', $columns).' = ?'; |
|
421 | 421 | } |
422 | 422 | |
423 | 423 | /** |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
473 | 473 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
474 | 474 | |
475 | - if (! $joinColumn->getType()) { |
|
475 | + if ( ! $joinColumn->getType()) { |
|
476 | 476 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em)); |
477 | 477 | } |
478 | 478 | |
@@ -485,7 +485,7 @@ discard block |
||
485 | 485 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
486 | 486 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
487 | 487 | |
488 | - if (! $joinColumn->getType()) { |
|
488 | + if ( ! $joinColumn->getType()) { |
|
489 | 489 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
490 | 490 | } |
491 | 491 | |
@@ -536,7 +536,7 @@ discard block |
||
536 | 536 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
537 | 537 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
538 | 538 | |
539 | - if (! $joinColumn->getType()) { |
|
539 | + if ( ! $joinColumn->getType()) { |
|
540 | 540 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em)); |
541 | 541 | } |
542 | 542 | |
@@ -549,7 +549,7 @@ discard block |
||
549 | 549 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
550 | 550 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
551 | 551 | |
552 | - if (! $joinColumn->getType()) { |
|
552 | + if ( ! $joinColumn->getType()) { |
|
553 | 553 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
554 | 554 | } |
555 | 555 | |
@@ -633,7 +633,7 @@ discard block |
||
633 | 633 | $sourceClass = $this->em->getClassMetadata($owningAssociation->getSourceEntity()); |
634 | 634 | $targetClass = $this->em->getClassMetadata($owningAssociation->getTargetEntity()); |
635 | 635 | |
636 | - if (! $owningAssociation->isOwningSide()) { |
|
636 | + if ( ! $owningAssociation->isOwningSide()) { |
|
637 | 637 | $owningAssociation = $targetClass->getProperty($owningAssociation->getMappedBy()); |
638 | 638 | $joinTable = $owningAssociation->getJoinTable(); |
639 | 639 | $joinColumns = $joinTable->getJoinColumns(); |
@@ -645,7 +645,7 @@ discard block |
||
645 | 645 | } |
646 | 646 | |
647 | 647 | $joinTableName = $joinTable->getQuotedQualifiedName($this->platform); |
648 | - $quotedJoinTable = $joinTableName . ' t'; |
|
648 | + $quotedJoinTable = $joinTableName.' t'; |
|
649 | 649 | $whereClauses = []; |
650 | 650 | $params = []; |
651 | 651 | $types = []; |
@@ -659,11 +659,11 @@ discard block |
||
659 | 659 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
660 | 660 | $quotedReferencedColumnName = $this->platform->quoteIdentifier($joinColumn->getReferencedColumnName()); |
661 | 661 | |
662 | - $joinConditions[] = ' t.' . $quotedColumnName . ' = tr.' . $quotedReferencedColumnName; |
|
662 | + $joinConditions[] = ' t.'.$quotedColumnName.' = tr.'.$quotedReferencedColumnName; |
|
663 | 663 | } |
664 | 664 | |
665 | 665 | $tableName = $targetClass->table->getQuotedQualifiedName($this->platform); |
666 | - $quotedJoinTable .= ' JOIN ' . $tableName . ' tr ON ' . implode(' AND ', $joinConditions); |
|
666 | + $quotedJoinTable .= ' JOIN '.$tableName.' tr ON '.implode(' AND ', $joinConditions); |
|
667 | 667 | $indexByProperty = $targetClass->getProperty($indexBy); |
668 | 668 | |
669 | 669 | switch (true) { |
@@ -686,7 +686,7 @@ discard block |
||
686 | 686 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
687 | 687 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
688 | 688 | |
689 | - if (! $joinColumn->getType()) { |
|
689 | + if ( ! $joinColumn->getType()) { |
|
690 | 690 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $sourceClass, $this->em)); |
691 | 691 | } |
692 | 692 | |
@@ -695,13 +695,13 @@ discard block |
||
695 | 695 | $types[] = $joinColumn->getType(); |
696 | 696 | } |
697 | 697 | |
698 | - if (! $joinNeeded) { |
|
698 | + if ( ! $joinNeeded) { |
|
699 | 699 | foreach ($joinColumns as $joinColumn) { |
700 | 700 | /** @var JoinColumnMetadata $joinColumn */ |
701 | 701 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
702 | 702 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
703 | 703 | |
704 | - if (! $joinColumn->getType()) { |
|
704 | + if ( ! $joinColumn->getType()) { |
|
705 | 705 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
706 | 706 | } |
707 | 707 | |
@@ -715,7 +715,7 @@ discard block |
||
715 | 715 | [$joinTargetEntitySQL, $filterSql] = $this->getFilterSql($association); |
716 | 716 | |
717 | 717 | if ($filterSql) { |
718 | - $quotedJoinTable .= ' ' . $joinTargetEntitySQL; |
|
718 | + $quotedJoinTable .= ' '.$joinTargetEntitySQL; |
|
719 | 719 | $whereClauses[] = $filterSql; |
720 | 720 | } |
721 | 721 | } |
@@ -738,7 +738,7 @@ discard block |
||
738 | 738 | $association = $collection->getMapping(); |
739 | 739 | $owningAssociation = $association; |
740 | 740 | |
741 | - if (! $association->isOwningSide()) { |
|
741 | + if ( ! $association->isOwningSide()) { |
|
742 | 742 | $sourceClass = $this->em->getClassMetadata($association->getTargetEntity()); |
743 | 743 | $targetClass = $this->em->getClassMetadata($association->getSourceEntity()); |
744 | 744 | $sourceIdentifier = $this->uow->getEntityIdentifier($element); |
@@ -764,11 +764,11 @@ discard block |
||
764 | 764 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
765 | 765 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
766 | 766 | |
767 | - if (! $joinColumn->getType()) { |
|
767 | + if ( ! $joinColumn->getType()) { |
|
768 | 768 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $sourceClass, $this->em)); |
769 | 769 | } |
770 | 770 | |
771 | - $whereClauses[] = ($addFilters ? 't.' : '') . $quotedColumnName . ' = ?'; |
|
771 | + $whereClauses[] = ($addFilters ? 't.' : '').$quotedColumnName.' = ?'; |
|
772 | 772 | $params[] = $sourceIdentifier[$sourceClass->fieldNames[$referencedColumnName]]; |
773 | 773 | $types[] = $joinColumn->getType(); |
774 | 774 | } |
@@ -778,11 +778,11 @@ discard block |
||
778 | 778 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
779 | 779 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
780 | 780 | |
781 | - if (! $joinColumn->getType()) { |
|
781 | + if ( ! $joinColumn->getType()) { |
|
782 | 782 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
783 | 783 | } |
784 | 784 | |
785 | - $whereClauses[] = ($addFilters ? 't.' : '') . $quotedColumnName . ' = ?'; |
|
785 | + $whereClauses[] = ($addFilters ? 't.' : '').$quotedColumnName.' = ?'; |
|
786 | 786 | $params[] = $targetIdentifier[$targetClass->fieldNames[$referencedColumnName]]; |
787 | 787 | $types[] = $joinColumn->getType(); |
788 | 788 | } |
@@ -793,7 +793,7 @@ discard block |
||
793 | 793 | [$joinTargetEntitySQL, $filterSql] = $this->getFilterSql($association); |
794 | 794 | |
795 | 795 | if ($filterSql) { |
796 | - $quotedJoinTable .= ' ' . $joinTargetEntitySQL; |
|
796 | + $quotedJoinTable .= ' '.$joinTargetEntitySQL; |
|
797 | 797 | $whereClauses[] = $filterSql; |
798 | 798 | } |
799 | 799 | } |
@@ -838,10 +838,10 @@ discard block |
||
838 | 838 | $property = $targetClass->getProperty($name); |
839 | 839 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
840 | 840 | |
841 | - $orderBy[] = $columnName . ' ' . $direction; |
|
841 | + $orderBy[] = $columnName.' '.$direction; |
|
842 | 842 | } |
843 | 843 | |
844 | - return ' ORDER BY ' . implode(', ', $orderBy); |
|
844 | + return ' ORDER BY '.implode(', ', $orderBy); |
|
845 | 845 | } |
846 | 846 | return ''; |
847 | 847 | } |
@@ -74,13 +74,13 @@ |
||
74 | 74 | |
75 | 75 | switch ($expr->getType()) { |
76 | 76 | case CompositeExpression::TYPE_AND: |
77 | - return '(' . implode(' AND ', $expressionList) . ')'; |
|
77 | + return '('.implode(' AND ', $expressionList).')'; |
|
78 | 78 | |
79 | 79 | case CompositeExpression::TYPE_OR: |
80 | - return '(' . implode(' OR ', $expressionList) . ')'; |
|
80 | + return '('.implode(' OR ', $expressionList).')'; |
|
81 | 81 | |
82 | 82 | default: |
83 | - throw new RuntimeException('Unknown composite ' . $expr->getType()); |
|
83 | + throw new RuntimeException('Unknown composite '.$expr->getType()); |
|
84 | 84 | } |
85 | 85 | } |
86 | 86 |
@@ -162,7 +162,7 @@ |
||
162 | 162 | |
163 | 163 | // Recognize identifiers, aliased or qualified names |
164 | 164 | case ctype_alpha($value[0]) || $value[0] === '_' || $value[0] === '\\': |
165 | - $name = 'Doctrine\ORM\Query\Lexer::T_' . strtoupper($value); |
|
165 | + $name = 'Doctrine\ORM\Query\Lexer::T_'.strtoupper($value); |
|
166 | 166 | |
167 | 167 | if (defined($name)) { |
168 | 168 | $type = constant($name); |
@@ -63,12 +63,12 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function add($arg) |
65 | 65 | { |
66 | - if ($arg !== null && (! $arg instanceof self || $arg->count() > 0)) { |
|
66 | + if ($arg !== null && ( ! $arg instanceof self || $arg->count() > 0)) { |
|
67 | 67 | // If we decide to keep Expr\Base instances, we can use this check |
68 | - if (! is_string($arg)) { |
|
68 | + if ( ! is_string($arg)) { |
|
69 | 69 | $class = get_class($arg); |
70 | 70 | |
71 | - if (! in_array($class, $this->allowedClasses, true)) { |
|
71 | + if ( ! in_array($class, $this->allowedClasses, true)) { |
|
72 | 72 | throw new InvalidArgumentException( |
73 | 73 | sprintf("Expression of type '%s' not allowed in this context.", $class) |
74 | 74 | ); |
@@ -98,6 +98,6 @@ discard block |
||
98 | 98 | return (string) $this->parts[0]; |
99 | 99 | } |
100 | 100 | |
101 | - return $this->preSeparator . implode($this->separator, $this->parts) . $this->postSeparator; |
|
101 | + return $this->preSeparator.implode($this->separator, $this->parts).$this->postSeparator; |
|
102 | 102 | } |
103 | 103 | } |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | } |
398 | 398 | |
399 | 399 | foreach ($this->queryComponents as $dqlAlias => $qComp) { |
400 | - if (! isset($this->identVariableExpressions[$dqlAlias])) { |
|
400 | + if ( ! isset($this->identVariableExpressions[$dqlAlias])) { |
|
401 | 401 | continue; |
402 | 402 | } |
403 | 403 | |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | $tokenStr = substr($dql, (int) $token['position'], $length); |
462 | 462 | |
463 | 463 | // Building informative message |
464 | - $message = 'line 0, col ' . $tokenPos . " near '" . $tokenStr . "': Error: " . $message; |
|
464 | + $message = 'line 0, col '.$tokenPos." near '".$tokenStr."': Error: ".$message; |
|
465 | 465 | |
466 | 466 | throw QueryException::semanticalError( |
467 | 467 | $message, |
@@ -564,7 +564,7 @@ discard block |
||
564 | 564 | $identVariable = $deferredItem['expression']; |
565 | 565 | |
566 | 566 | // Check if IdentificationVariable exists in queryComponents |
567 | - if (! isset($this->queryComponents[$identVariable])) { |
|
567 | + if ( ! isset($this->queryComponents[$identVariable])) { |
|
568 | 568 | $this->semanticalError( |
569 | 569 | sprintf("'%s' is not defined.", $identVariable), |
570 | 570 | $deferredItem['token'] |
@@ -574,7 +574,7 @@ discard block |
||
574 | 574 | $qComp = $this->queryComponents[$identVariable]; |
575 | 575 | |
576 | 576 | // Check if queryComponent points to an AbstractSchemaName or a ResultVariable |
577 | - if (! isset($qComp['metadata'])) { |
|
577 | + if ( ! isset($qComp['metadata'])) { |
|
578 | 578 | $this->semanticalError( |
579 | 579 | sprintf("'%s' does not point to a Class.", $identVariable), |
580 | 580 | $deferredItem['token'] |
@@ -608,7 +608,7 @@ discard block |
||
608 | 608 | // If the namespace is not given then assumes the first FROM entity namespace |
609 | 609 | if (strpos($className, '\\') === false && ! class_exists($className) && strpos($fromClassName, '\\') !== false) { |
610 | 610 | $namespace = substr($fromClassName, 0, strrpos($fromClassName, '\\')); |
611 | - $fqcn = $namespace . '\\' . $className; |
|
611 | + $fqcn = $namespace.'\\'.$className; |
|
612 | 612 | |
613 | 613 | if (class_exists($fqcn)) { |
614 | 614 | $expression->className = $fqcn; |
@@ -616,13 +616,13 @@ discard block |
||
616 | 616 | } |
617 | 617 | } |
618 | 618 | |
619 | - if (! class_exists($className)) { |
|
619 | + if ( ! class_exists($className)) { |
|
620 | 620 | $this->semanticalError(sprintf('Class "%s" is not defined.', $className), $token); |
621 | 621 | } |
622 | 622 | |
623 | 623 | $class = new ReflectionClass($className); |
624 | 624 | |
625 | - if (! $class->isInstantiable()) { |
|
625 | + if ( ! $class->isInstantiable()) { |
|
626 | 626 | $this->semanticalError(sprintf('Class "%s" can not be instantiated.', $className), $token); |
627 | 627 | } |
628 | 628 | |
@@ -679,7 +679,7 @@ discard block |
||
679 | 679 | $resultVariable = $deferredItem['expression']; |
680 | 680 | |
681 | 681 | // Check if ResultVariable exists in queryComponents |
682 | - if (! isset($this->queryComponents[$resultVariable])) { |
|
682 | + if ( ! isset($this->queryComponents[$resultVariable])) { |
|
683 | 683 | $this->semanticalError( |
684 | 684 | sprintf("'%s' is not defined.", $resultVariable), |
685 | 685 | $deferredItem['token'] |
@@ -689,7 +689,7 @@ discard block |
||
689 | 689 | $qComp = $this->queryComponents[$resultVariable]; |
690 | 690 | |
691 | 691 | // Check if queryComponent points to an AbstractSchemaName or a ResultVariable |
692 | - if (! isset($qComp['resultVariable'])) { |
|
692 | + if ( ! isset($qComp['resultVariable'])) { |
|
693 | 693 | $this->semanticalError( |
694 | 694 | sprintf("'%s' does not point to a ResultVariable.", $resultVariable), |
695 | 695 | $deferredItem['token'] |
@@ -731,9 +731,9 @@ discard block |
||
731 | 731 | $property = $class->getProperty($field); |
732 | 732 | |
733 | 733 | // Check if field or association exists |
734 | - if (! $property) { |
|
734 | + if ( ! $property) { |
|
735 | 735 | $this->semanticalError( |
736 | - 'Class ' . $class->getClassName() . ' has no field or association named ' . $field, |
|
736 | + 'Class '.$class->getClassName().' has no field or association named '.$field, |
|
737 | 737 | $deferredItem['token'] |
738 | 738 | ); |
739 | 739 | } |
@@ -749,7 +749,7 @@ discard block |
||
749 | 749 | // Validate if PathExpression is one of the expected types |
750 | 750 | $expectedType = $pathExpression->expectedType; |
751 | 751 | |
752 | - if (! ($expectedType & $fieldType)) { |
|
752 | + if ( ! ($expectedType & $fieldType)) { |
|
753 | 753 | // We need to recognize which was expected type(s) |
754 | 754 | $expectedStringTypes = []; |
755 | 755 | |
@@ -771,8 +771,8 @@ discard block |
||
771 | 771 | // Build the error message |
772 | 772 | $semanticalError = 'Invalid PathExpression. '; |
773 | 773 | $semanticalError .= count($expectedStringTypes) === 1 |
774 | - ? 'Must be a ' . $expectedStringTypes[0] . '.' |
|
775 | - : implode(' or ', $expectedStringTypes) . ' expected.'; |
|
774 | + ? 'Must be a '.$expectedStringTypes[0].'.' |
|
775 | + : implode(' or ', $expectedStringTypes).' expected.'; |
|
776 | 776 | |
777 | 777 | $this->semanticalError($semanticalError, $deferredItem['token']); |
778 | 778 | } |
@@ -784,7 +784,7 @@ discard block |
||
784 | 784 | |
785 | 785 | private function processRootEntityAliasSelected() |
786 | 786 | { |
787 | - if (! $this->identVariableExpressions) { |
|
787 | + if ( ! $this->identVariableExpressions) { |
|
788 | 788 | return; |
789 | 789 | } |
790 | 790 | |
@@ -941,7 +941,7 @@ discard block |
||
941 | 941 | |
942 | 942 | [$namespaceAlias, $simpleClassName] = explode(':', $this->lexer->token['value']); |
943 | 943 | |
944 | - return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName; |
|
944 | + return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias).'\\'.$simpleClassName; |
|
945 | 945 | } |
946 | 946 | |
947 | 947 | /** |
@@ -1020,9 +1020,9 @@ discard block |
||
1020 | 1020 | { |
1021 | 1021 | $identVariable = $this->IdentificationVariable(); |
1022 | 1022 | |
1023 | - if (! isset($this->queryComponents[$identVariable])) { |
|
1023 | + if ( ! isset($this->queryComponents[$identVariable])) { |
|
1024 | 1024 | $this->semanticalError( |
1025 | - 'Identification Variable ' . $identVariable . ' used in join path expression but was not defined before.' |
|
1025 | + 'Identification Variable '.$identVariable.' used in join path expression but was not defined before.' |
|
1026 | 1026 | ); |
1027 | 1027 | } |
1028 | 1028 | |
@@ -1036,8 +1036,8 @@ discard block |
||
1036 | 1036 | $class = $qComp['metadata']; |
1037 | 1037 | $property = $class->getProperty($field); |
1038 | 1038 | |
1039 | - if (! ($property !== null && $property instanceof AssociationMetadata)) { |
|
1040 | - $this->semanticalError('Class ' . $class->getClassName() . ' has no association named ' . $field); |
|
1039 | + if ( ! ($property !== null && $property instanceof AssociationMetadata)) { |
|
1040 | + $this->semanticalError('Class '.$class->getClassName().' has no association named '.$field); |
|
1041 | 1041 | } |
1042 | 1042 | |
1043 | 1043 | return new AST\JoinAssociationPathExpression($identVariable, $field); |
@@ -1067,7 +1067,7 @@ discard block |
||
1067 | 1067 | while ($this->lexer->isNextToken(Lexer::T_DOT)) { |
1068 | 1068 | $this->match(Lexer::T_DOT); |
1069 | 1069 | $this->match(Lexer::T_IDENTIFIER); |
1070 | - $field .= '.' . $this->lexer->token['value']; |
|
1070 | + $field .= '.'.$this->lexer->token['value']; |
|
1071 | 1071 | } |
1072 | 1072 | } |
1073 | 1073 | |
@@ -1449,7 +1449,7 @@ discard block |
||
1449 | 1449 | // Still need to decide between IdentificationVariable or ResultVariable |
1450 | 1450 | $lookaheadValue = $this->lexer->lookahead['value']; |
1451 | 1451 | |
1452 | - if (! isset($this->queryComponents[$lookaheadValue])) { |
|
1452 | + if ( ! isset($this->queryComponents[$lookaheadValue])) { |
|
1453 | 1453 | $this->semanticalError('Cannot group by undefined identification or result variable.'); |
1454 | 1454 | } |
1455 | 1455 | |
@@ -1797,7 +1797,7 @@ discard block |
||
1797 | 1797 | while ($this->lexer->isNextToken(Lexer::T_DOT)) { |
1798 | 1798 | $this->match(Lexer::T_DOT); |
1799 | 1799 | $this->match(Lexer::T_IDENTIFIER); |
1800 | - $field .= '.' . $this->lexer->token['value']; |
|
1800 | + $field .= '.'.$this->lexer->token['value']; |
|
1801 | 1801 | } |
1802 | 1802 | |
1803 | 1803 | $partialFieldSet[] = $field; |
@@ -1811,7 +1811,7 @@ discard block |
||
1811 | 1811 | while ($this->lexer->isNextToken(Lexer::T_DOT)) { |
1812 | 1812 | $this->match(Lexer::T_DOT); |
1813 | 1813 | $this->match(Lexer::T_IDENTIFIER); |
1814 | - $field .= '.' . $this->lexer->token['value']; |
|
1814 | + $field .= '.'.$this->lexer->token['value']; |
|
1815 | 1815 | } |
1816 | 1816 | |
1817 | 1817 | $partialFieldSet[] = $field; |
@@ -2432,7 +2432,7 @@ discard block |
||
2432 | 2432 | |
2433 | 2433 | // Phase 1 AST optimization: Prevent AST\ConditionalFactor |
2434 | 2434 | // if only one AST\ConditionalPrimary is defined |
2435 | - if (! $not) { |
|
2435 | + if ( ! $not) { |
|
2436 | 2436 | return $conditionalPrimary; |
2437 | 2437 | } |
2438 | 2438 | |
@@ -2451,7 +2451,7 @@ discard block |
||
2451 | 2451 | { |
2452 | 2452 | $condPrimary = new AST\ConditionalPrimary(); |
2453 | 2453 | |
2454 | - if (! $this->lexer->isNextToken(Lexer::T_OPEN_PARENTHESIS)) { |
|
2454 | + if ( ! $this->lexer->isNextToken(Lexer::T_OPEN_PARENTHESIS)) { |
|
2455 | 2455 | $condPrimary->simpleConditionalExpression = $this->SimpleConditionalExpression(); |
2456 | 2456 | |
2457 | 2457 | return $condPrimary; |
@@ -2619,7 +2619,7 @@ discard block |
||
2619 | 2619 | $this->match(Lexer::T_OF); |
2620 | 2620 | } |
2621 | 2621 | |
2622 | - $collMemberExpr = new AST\CollectionMemberExpression( |
|
2622 | + $collMemberExpr = new AST\CollectionMemberExpression( |
|
2623 | 2623 | $entityExpr, |
2624 | 2624 | $this->CollectionValuedPathExpression() |
2625 | 2625 | ); |
@@ -2958,7 +2958,7 @@ discard block |
||
2958 | 2958 | $lookaheadType = $this->lexer->lookahead['type']; |
2959 | 2959 | $isDistinct = false; |
2960 | 2960 | |
2961 | - if (! in_array($lookaheadType, [Lexer::T_COUNT, Lexer::T_AVG, Lexer::T_MAX, Lexer::T_MIN, Lexer::T_SUM], true)) { |
|
2961 | + if ( ! in_array($lookaheadType, [Lexer::T_COUNT, Lexer::T_AVG, Lexer::T_MAX, Lexer::T_MIN, Lexer::T_SUM], true)) { |
|
2962 | 2962 | $this->syntaxError('One of: MAX, MIN, AVG, SUM, COUNT'); |
2963 | 2963 | } |
2964 | 2964 | |
@@ -2988,7 +2988,7 @@ discard block |
||
2988 | 2988 | $lookaheadType = $this->lexer->lookahead['type']; |
2989 | 2989 | $value = $this->lexer->lookahead['value']; |
2990 | 2990 | |
2991 | - if (! in_array($lookaheadType, [Lexer::T_ALL, Lexer::T_ANY, Lexer::T_SOME], true)) { |
|
2991 | + if ( ! in_array($lookaheadType, [Lexer::T_ALL, Lexer::T_ANY, Lexer::T_SOME], true)) { |
|
2992 | 2992 | $this->syntaxError('ALL, ANY or SOME'); |
2993 | 2993 | } |
2994 | 2994 | |
@@ -3226,7 +3226,7 @@ discard block |
||
3226 | 3226 | $lookaheadValue = $this->lexer->lookahead['value']; |
3227 | 3227 | |
3228 | 3228 | // Validate existing component |
3229 | - if (! isset($this->queryComponents[$lookaheadValue])) { |
|
3229 | + if ( ! isset($this->queryComponents[$lookaheadValue])) { |
|
3230 | 3230 | $this->semanticalError('Cannot add having condition on undefined result variable.'); |
3231 | 3231 | } |
3232 | 3232 | |
@@ -3237,7 +3237,7 @@ discard block |
||
3237 | 3237 | } |
3238 | 3238 | |
3239 | 3239 | // Validating ResultVariable |
3240 | - if (! isset($this->queryComponents[$lookaheadValue]['resultVariable'])) { |
|
3240 | + if ( ! isset($this->queryComponents[$lookaheadValue]['resultVariable'])) { |
|
3241 | 3241 | $this->semanticalError('Cannot add having condition on a non result variable.'); |
3242 | 3242 | } |
3243 | 3243 |