@@ -5,8 +5,8 @@ discard block |
||
| 5 | 5 | |
| 6 | 6 | // Path to composer autoloader. You can use different provided by your favorite framework, |
| 7 | 7 | // if you want to. |
| 8 | -$loaderPath = __DIR__ . '/../../vendor/autoload.php'; |
|
| 9 | -if(!is_readable($loaderPath)){ |
|
| 8 | +$loaderPath = __DIR__.'/../../vendor/autoload.php'; |
|
| 9 | +if ( ! is_readable($loaderPath)) { |
|
| 10 | 10 | throw new LogicException('Run php composer.phar install at first'); |
| 11 | 11 | } |
| 12 | 12 | $loader = require $loaderPath; |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | $config = new \Doctrine\ORM\Configuration(); |
| 20 | 20 | |
| 21 | 21 | // Set up Metadata Drivers |
| 22 | -$driverImpl = $config->newDefaultAnnotationDriver([__DIR__ . "/Entities"]); |
|
| 22 | +$driverImpl = $config->newDefaultAnnotationDriver([__DIR__."/Entities"]); |
|
| 23 | 23 | $config->setMetadataDriverImpl($driverImpl); |
| 24 | 24 | |
| 25 | 25 | // Set up caches, depending on $debug variable. |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | $config->setQueryCacheImpl($cache); |
| 30 | 30 | |
| 31 | 31 | // Proxy configuration |
| 32 | -$config->setProxyDir(__DIR__ . '/Proxies'); |
|
| 32 | +$config->setProxyDir(__DIR__.'/Proxies'); |
|
| 33 | 33 | $config->setProxyNamespace('Proxies'); |
| 34 | 34 | |
| 35 | 35 | // Database connection information |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | $args[] = $sqlWalker->walkStringPrimary($expression); |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - return call_user_func_array([$platform,'getConcatExpression'], $args); |
|
| 56 | + return call_user_func_array([$platform, 'getConcatExpression'], $args); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
@@ -492,7 +492,7 @@ discard block |
||
| 492 | 492 | $tokenStr = substr($dql, $token['position'], $length); |
| 493 | 493 | |
| 494 | 494 | // Building informative message |
| 495 | - $message = 'line 0, col ' . $tokenPos . " near '" . $tokenStr . "': Error: " . $message; |
|
| 495 | + $message = 'line 0, col '.$tokenPos." near '".$tokenStr."': Error: ".$message; |
|
| 496 | 496 | |
| 497 | 497 | throw QueryException::semanticalError($message, QueryException::dqlError($this->query->getDQL())); |
| 498 | 498 | } |
@@ -639,7 +639,7 @@ discard block |
||
| 639 | 639 | // If the namespace is not given then assumes the first FROM entity namespace |
| 640 | 640 | if (strpos($className, '\\') === false && ! class_exists($className) && strpos($fromClassName, '\\') !== false) { |
| 641 | 641 | $namespace = substr($fromClassName, 0, strrpos($fromClassName, '\\')); |
| 642 | - $fqcn = $namespace . '\\' . $className; |
|
| 642 | + $fqcn = $namespace.'\\'.$className; |
|
| 643 | 643 | |
| 644 | 644 | if (class_exists($fqcn)) { |
| 645 | 645 | $expression->className = $fqcn; |
@@ -691,13 +691,13 @@ discard block |
||
| 691 | 691 | } |
| 692 | 692 | |
| 693 | 693 | $this->semanticalError( |
| 694 | - "There is no mapped field named '$field' on class " . $class->name . ".", $deferredItem['token'] |
|
| 694 | + "There is no mapped field named '$field' on class ".$class->name.".", $deferredItem['token'] |
|
| 695 | 695 | ); |
| 696 | 696 | } |
| 697 | 697 | |
| 698 | 698 | if (array_intersect($class->identifier, $expr->partialFieldSet) != $class->identifier) { |
| 699 | 699 | $this->semanticalError( |
| 700 | - "The partial field selection of class " . $class->name . " must contain the identifier.", |
|
| 700 | + "The partial field selection of class ".$class->name." must contain the identifier.", |
|
| 701 | 701 | $deferredItem['token'] |
| 702 | 702 | ); |
| 703 | 703 | } |
@@ -768,7 +768,7 @@ discard block |
||
| 768 | 768 | // Check if field or association exists |
| 769 | 769 | if ( ! isset($class->associationMappings[$field]) && ! isset($class->fieldMappings[$field])) { |
| 770 | 770 | $this->semanticalError( |
| 771 | - 'Class ' . $class->name . ' has no field or association named ' . $field, |
|
| 771 | + 'Class '.$class->name.' has no field or association named '.$field, |
|
| 772 | 772 | $deferredItem['token'] |
| 773 | 773 | ); |
| 774 | 774 | } |
@@ -808,8 +808,8 @@ discard block |
||
| 808 | 808 | // Build the error message |
| 809 | 809 | $semanticalError = 'Invalid PathExpression. '; |
| 810 | 810 | $semanticalError .= (count($expectedStringTypes) == 1) |
| 811 | - ? 'Must be a ' . $expectedStringTypes[0] . '.' |
|
| 812 | - : implode(' or ', $expectedStringTypes) . ' expected.'; |
|
| 811 | + ? 'Must be a '.$expectedStringTypes[0].'.' |
|
| 812 | + : implode(' or ', $expectedStringTypes).' expected.'; |
|
| 813 | 813 | |
| 814 | 814 | $this->semanticalError($semanticalError, $deferredItem['token']); |
| 815 | 815 | } |
@@ -978,7 +978,7 @@ discard block |
||
| 978 | 978 | |
| 979 | 979 | list($namespaceAlias, $simpleClassName) = explode(':', $this->lexer->token['value']); |
| 980 | 980 | |
| 981 | - $schemaName = $this->em->getConfiguration()->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName; |
|
| 981 | + $schemaName = $this->em->getConfiguration()->getEntityNamespace($namespaceAlias).'\\'.$simpleClassName; |
|
| 982 | 982 | } |
| 983 | 983 | |
| 984 | 984 | return $schemaName; |
@@ -993,7 +993,7 @@ discard block |
||
| 993 | 993 | */ |
| 994 | 994 | private function validateAbstractSchemaName($schemaName) |
| 995 | 995 | { |
| 996 | - if (! (class_exists($schemaName, true) || interface_exists($schemaName, true))) { |
|
| 996 | + if ( ! (class_exists($schemaName, true) || interface_exists($schemaName, true))) { |
|
| 997 | 997 | $this->semanticalError("Class '$schemaName' is not defined.", $this->lexer->token); |
| 998 | 998 | } |
| 999 | 999 | } |
@@ -1049,7 +1049,7 @@ discard block |
||
| 1049 | 1049 | |
| 1050 | 1050 | if ( ! isset($this->queryComponents[$identVariable])) { |
| 1051 | 1051 | $this->semanticalError( |
| 1052 | - 'Identification Variable ' . $identVariable .' used in join path expression but was not defined before.' |
|
| 1052 | + 'Identification Variable '.$identVariable.' used in join path expression but was not defined before.' |
|
| 1053 | 1053 | ); |
| 1054 | 1054 | } |
| 1055 | 1055 | |
@@ -1063,7 +1063,7 @@ discard block |
||
| 1063 | 1063 | $class = $qComp['metadata']; |
| 1064 | 1064 | |
| 1065 | 1065 | if ( ! $class->hasAssociation($field)) { |
| 1066 | - $this->semanticalError('Class ' . $class->name . ' has no association named ' . $field); |
|
| 1066 | + $this->semanticalError('Class '.$class->name.' has no association named '.$field); |
|
| 1067 | 1067 | } |
| 1068 | 1068 | |
| 1069 | 1069 | return new AST\JoinAssociationPathExpression($identVariable, $field); |
@@ -2485,7 +2485,7 @@ discard block |
||
| 2485 | 2485 | // Peek beyond the matching closing parenthesis ')' |
| 2486 | 2486 | $peek = $this->peekBeyondClosingParenthesis(); |
| 2487 | 2487 | |
| 2488 | - if (in_array($peek['value'], ["=", "<", "<=", "<>", ">", ">=", "!="]) || |
|
| 2488 | + if (in_array($peek['value'], ["=", "<", "<=", "<>", ">", ">=", "!="]) || |
|
| 2489 | 2489 | in_array($peek['type'], [Lexer::T_NOT, Lexer::T_BETWEEN, Lexer::T_LIKE, Lexer::T_IN, Lexer::T_IS, Lexer::T_EXISTS]) || |
| 2490 | 2490 | $this->isMathOperator($peek)) { |
| 2491 | 2491 | $condPrimary->simpleConditionalExpression = $this->SimpleConditionalExpression(); |
@@ -2590,7 +2590,7 @@ discard block |
||
| 2590 | 2590 | return $this->NullComparisonExpression(); |
| 2591 | 2591 | } |
| 2592 | 2592 | |
| 2593 | - if ($token['type'] === Lexer::T_IS && $lookahead['type'] === Lexer::T_EMPTY) { |
|
| 2593 | + if ($token['type'] === Lexer::T_IS && $lookahead['type'] === Lexer::T_EMPTY) { |
|
| 2594 | 2594 | return $this->EmptyCollectionComparisonExpression(); |
| 2595 | 2595 | } |
| 2596 | 2596 | |
@@ -92,7 +92,7 @@ |
||
| 92 | 92 | $this->_tableName, $this->_sequenceName, $this->_allocationSize |
| 93 | 93 | ); |
| 94 | 94 | |
| 95 | - if ($conn->executeUpdate($updateSql, [1 => $currentLevel, 2 => $currentLevel+1]) !== 1) { |
|
| 95 | + if ($conn->executeUpdate($updateSql, [1 => $currentLevel, 2 => $currentLevel + 1]) !== 1) { |
|
| 96 | 96 | // no affected rows, concurrency issue, throw exception |
| 97 | 97 | } |
| 98 | 98 | } else { |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | /** |
| 40 | 40 | * @var array |
| 41 | 41 | */ |
| 42 | - private $types = []; |
|
| 42 | + private $types = []; |
|
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | 45 | * Converts a comparison expression into the target query language output. |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | */ |
| 106 | 106 | protected function onNotFoundMetadata($className) |
| 107 | 107 | { |
| 108 | - if (! $this->evm->hasListeners(Events::onClassMetadataNotFound)) { |
|
| 108 | + if ( ! $this->evm->hasListeners(Events::onClassMetadataNotFound)) { |
|
| 109 | 109 | return; |
| 110 | 110 | } |
| 111 | 111 | |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | $this->completeIdGeneratorMapping($class); |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | - if (!$class->isMappedSuperclass) { |
|
| 165 | + if ( ! $class->isMappedSuperclass) { |
|
| 166 | 166 | foreach ($class->embeddedClasses as $property => $embeddableClass) { |
| 167 | 167 | |
| 168 | 168 | if (isset($embeddableClass['inherited'])) { |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | |
| 188 | 188 | $identifier = $embeddableMetadata->getIdentifier(); |
| 189 | 189 | |
| 190 | - if (! empty($identifier)) { |
|
| 190 | + if ( ! empty($identifier)) { |
|
| 191 | 191 | $this->inheritIdGeneratorMapping($class, $embeddableMetadata); |
| 192 | 192 | } |
| 193 | 193 | |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | */ |
| 258 | 258 | protected function validateRuntimeMetadata($class, $parent) |
| 259 | 259 | { |
| 260 | - if ( ! $class->reflClass ) { |
|
| 260 | + if ( ! $class->reflClass) { |
|
| 261 | 261 | // only validate if there is a reflection class instance |
| 262 | 262 | return; |
| 263 | 263 | } |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | $class->validateLifecycleCallbacks($this->getReflectionService()); |
| 268 | 268 | |
| 269 | 269 | // verify inheritance |
| 270 | - if ( ! $class->isMappedSuperclass && !$class->isInheritanceTypeNone()) { |
|
| 270 | + if ( ! $class->isMappedSuperclass && ! $class->isInheritanceTypeNone()) { |
|
| 271 | 271 | if ( ! $parent) { |
| 272 | 272 | if (count($class->discriminatorMap) == 0) { |
| 273 | 273 | throw MappingException::missingDiscriminatorMap($class->name); |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | { |
| 429 | 429 | foreach ($parentClass->associationMappings as $field => $mapping) { |
| 430 | 430 | if ($parentClass->isMappedSuperclass) { |
| 431 | - if ($mapping['type'] & ClassMetadata::TO_MANY && !$mapping['isOwningSide']) { |
|
| 431 | + if ($mapping['type'] & ClassMetadata::TO_MANY && ! $mapping['isOwningSide']) { |
|
| 432 | 432 | throw MappingException::illegalToManyAssociationOnMappedSuperclass($parentClass->name, $field); |
| 433 | 433 | } |
| 434 | 434 | $mapping['sourceEntity'] = $subClass->name; |
@@ -477,11 +477,11 @@ discard block |
||
| 477 | 477 | |
| 478 | 478 | $parentClass->mapEmbedded( |
| 479 | 479 | [ |
| 480 | - 'fieldName' => $prefix . '.' . $property, |
|
| 480 | + 'fieldName' => $prefix.'.'.$property, |
|
| 481 | 481 | 'class' => $embeddableMetadata->name, |
| 482 | 482 | 'columnPrefix' => $embeddableClass['columnPrefix'], |
| 483 | 483 | 'declaredField' => $embeddableClass['declaredField'] |
| 484 | - ? $prefix . '.' . $embeddableClass['declaredField'] |
|
| 484 | + ? $prefix.'.'.$embeddableClass['declaredField'] |
|
| 485 | 485 | : $prefix, |
| 486 | 486 | 'originalField' => $embeddableClass['originalField'] ?: $property, |
| 487 | 487 | ] |
@@ -499,7 +499,7 @@ discard block |
||
| 499 | 499 | */ |
| 500 | 500 | private function addInheritedIndexes(ClassMetadata $subClass, ClassMetadata $parentClass) |
| 501 | 501 | { |
| 502 | - if (! $parentClass->isMappedSuperclass) { |
|
| 502 | + if ( ! $parentClass->isMappedSuperclass) { |
|
| 503 | 503 | return; |
| 504 | 504 | } |
| 505 | 505 | |
@@ -704,14 +704,14 @@ discard block |
||
| 704 | 704 | case ClassMetadata::GENERATOR_TYPE_CUSTOM: |
| 705 | 705 | $definition = $class->customGeneratorDefinition; |
| 706 | 706 | if ( ! class_exists($definition['class'])) { |
| 707 | - throw new ORMException("Can't instantiate custom generator : " . |
|
| 707 | + throw new ORMException("Can't instantiate custom generator : ". |
|
| 708 | 708 | $definition['class']); |
| 709 | 709 | } |
| 710 | 710 | $class->setIdGenerator(new $definition['class']); |
| 711 | 711 | break; |
| 712 | 712 | |
| 713 | 713 | default: |
| 714 | - throw new ORMException("Unknown generator type: " . $class->generatorType); |
|
| 714 | + throw new ORMException("Unknown generator type: ".$class->generatorType); |
|
| 715 | 715 | } |
| 716 | 716 | } |
| 717 | 717 | |
@@ -761,7 +761,7 @@ discard block |
||
| 761 | 761 | */ |
| 762 | 762 | protected function getFqcnFromAlias($namespaceAlias, $simpleClassName) |
| 763 | 763 | { |
| 764 | - return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName; |
|
| 764 | + return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias).'\\'.$simpleClassName; |
|
| 765 | 765 | } |
| 766 | 766 | |
| 767 | 767 | /** |
@@ -785,7 +785,7 @@ discard block |
||
| 785 | 785 | */ |
| 786 | 786 | private function getTargetPlatform() |
| 787 | 787 | { |
| 788 | - if (!$this->targetPlatform) { |
|
| 788 | + if ( ! $this->targetPlatform) { |
|
| 789 | 789 | $this->targetPlatform = $this->em->getConnection()->getDatabasePlatform(); |
| 790 | 790 | } |
| 791 | 791 | |
@@ -460,7 +460,7 @@ discard block |
||
| 460 | 460 | $state = $this->getEntityState($entity); |
| 461 | 461 | |
| 462 | 462 | if ($state !== self::STATE_MANAGED && $state !== self::STATE_REMOVED) { |
| 463 | - throw new \InvalidArgumentException("Entity has to be managed or scheduled for removal for single computation " . self::objToStr($entity)); |
|
| 463 | + throw new \InvalidArgumentException("Entity has to be managed or scheduled for removal for single computation ".self::objToStr($entity)); |
|
| 464 | 464 | } |
| 465 | 465 | |
| 466 | 466 | $class = $this->em->getClassMetadata(get_class($entity)); |
@@ -516,7 +516,7 @@ discard block |
||
| 516 | 516 | $oid = spl_object_hash($entity); |
| 517 | 517 | $data = []; |
| 518 | 518 | |
| 519 | - if (!isset($this->entityChangeSets[$oid])) { |
|
| 519 | + if ( ! isset($this->entityChangeSets[$oid])) { |
|
| 520 | 520 | return $data; |
| 521 | 521 | } |
| 522 | 522 | |
@@ -679,7 +679,7 @@ discard block |
||
| 679 | 679 | if ($owner === null) { // cloned |
| 680 | 680 | $actualValue->setOwner($entity, $assoc); |
| 681 | 681 | } else if ($owner !== $entity) { // no clone, we have to fix |
| 682 | - if (!$actualValue->isInitialized()) { |
|
| 682 | + if ( ! $actualValue->isInitialized()) { |
|
| 683 | 683 | $actualValue->initialize(); // we have to do this otherwise the cols share state |
| 684 | 684 | } |
| 685 | 685 | $newValue = clone $actualValue; |
@@ -825,7 +825,7 @@ discard block |
||
| 825 | 825 | $targetClass = $this->em->getClassMetadata($assoc['targetEntity']); |
| 826 | 826 | |
| 827 | 827 | foreach ($unwrappedValue as $key => $entry) { |
| 828 | - if (! ($entry instanceof $targetClass->name)) { |
|
| 828 | + if ( ! ($entry instanceof $targetClass->name)) { |
|
| 829 | 829 | throw ORMInvalidArgumentException::invalidAssociation($targetClass, $assoc, $entry); |
| 830 | 830 | } |
| 831 | 831 | |
@@ -1154,7 +1154,7 @@ discard block |
||
| 1154 | 1154 | |
| 1155 | 1155 | $joinColumns = reset($assoc['joinColumns']); |
| 1156 | 1156 | |
| 1157 | - $calc->addDependency($targetClass->name, $class->name, (int)empty($joinColumns['nullable'])); |
|
| 1157 | + $calc->addDependency($targetClass->name, $class->name, (int) empty($joinColumns['nullable'])); |
|
| 1158 | 1158 | |
| 1159 | 1159 | // If the target class has mapped subclasses, these share the same dependency. |
| 1160 | 1160 | if ( ! $targetClass->subClasses) { |
@@ -1677,7 +1677,7 @@ discard block |
||
| 1677 | 1677 | throw ORMInvalidArgumentException::detachedEntityCannot($entity, "persisted"); |
| 1678 | 1678 | |
| 1679 | 1679 | default: |
| 1680 | - throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity)); |
|
| 1680 | + throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity)); |
|
| 1681 | 1681 | } |
| 1682 | 1682 | |
| 1683 | 1683 | $this->cascadePersist($entity, $visited); |
@@ -1747,7 +1747,7 @@ discard block |
||
| 1747 | 1747 | case self::STATE_DETACHED: |
| 1748 | 1748 | throw ORMInvalidArgumentException::detachedEntityCannot($entity, "removed"); |
| 1749 | 1749 | default: |
| 1750 | - throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity)); |
|
| 1750 | + throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity)); |
|
| 1751 | 1751 | } |
| 1752 | 1752 | |
| 1753 | 1753 | } |
@@ -1886,7 +1886,7 @@ discard block |
||
| 1886 | 1886 | */ |
| 1887 | 1887 | private function ensureVersionMatch(ClassMetadata $class, $entity, $managedCopy) |
| 1888 | 1888 | { |
| 1889 | - if (! ($class->isVersioned && $this->isLoaded($managedCopy) && $this->isLoaded($entity))) { |
|
| 1889 | + if ( ! ($class->isVersioned && $this->isLoaded($managedCopy) && $this->isLoaded($entity))) { |
|
| 1890 | 1890 | return; |
| 1891 | 1891 | } |
| 1892 | 1892 | |
@@ -1911,7 +1911,7 @@ discard block |
||
| 1911 | 1911 | */ |
| 1912 | 1912 | private function isLoaded($entity) |
| 1913 | 1913 | { |
| 1914 | - return !($entity instanceof Proxy) || $entity->__isInitialized(); |
|
| 1914 | + return ! ($entity instanceof Proxy) || $entity->__isInitialized(); |
|
| 1915 | 1915 | } |
| 1916 | 1916 | |
| 1917 | 1917 | /** |
@@ -2069,7 +2069,7 @@ discard block |
||
| 2069 | 2069 | |
| 2070 | 2070 | $associationMappings = array_filter( |
| 2071 | 2071 | $class->associationMappings, |
| 2072 | - function ($assoc) { return $assoc['isCascadeRefresh']; } |
|
| 2072 | + function($assoc) { return $assoc['isCascadeRefresh']; } |
|
| 2073 | 2073 | ); |
| 2074 | 2074 | |
| 2075 | 2075 | foreach ($associationMappings as $assoc) { |
@@ -2112,7 +2112,7 @@ discard block |
||
| 2112 | 2112 | |
| 2113 | 2113 | $associationMappings = array_filter( |
| 2114 | 2114 | $class->associationMappings, |
| 2115 | - function ($assoc) { return $assoc['isCascadeDetach']; } |
|
| 2115 | + function($assoc) { return $assoc['isCascadeDetach']; } |
|
| 2116 | 2116 | ); |
| 2117 | 2117 | |
| 2118 | 2118 | foreach ($associationMappings as $assoc) { |
@@ -2156,7 +2156,7 @@ discard block |
||
| 2156 | 2156 | |
| 2157 | 2157 | $associationMappings = array_filter( |
| 2158 | 2158 | $class->associationMappings, |
| 2159 | - function ($assoc) { return $assoc['isCascadeMerge']; } |
|
| 2159 | + function($assoc) { return $assoc['isCascadeMerge']; } |
|
| 2160 | 2160 | ); |
| 2161 | 2161 | |
| 2162 | 2162 | foreach ($associationMappings as $assoc) { |
@@ -2195,7 +2195,7 @@ discard block |
||
| 2195 | 2195 | |
| 2196 | 2196 | $associationMappings = array_filter( |
| 2197 | 2197 | $class->associationMappings, |
| 2198 | - function ($assoc) { return $assoc['isCascadePersist']; } |
|
| 2198 | + function($assoc) { return $assoc['isCascadePersist']; } |
|
| 2199 | 2199 | ); |
| 2200 | 2200 | |
| 2201 | 2201 | foreach ($associationMappings as $assoc) { |
@@ -2224,7 +2224,7 @@ discard block |
||
| 2224 | 2224 | break; |
| 2225 | 2225 | |
| 2226 | 2226 | case ($relatedEntities !== null): |
| 2227 | - if (! $relatedEntities instanceof $assoc['targetEntity']) { |
|
| 2227 | + if ( ! $relatedEntities instanceof $assoc['targetEntity']) { |
|
| 2228 | 2228 | throw ORMInvalidArgumentException::invalidAssociation( |
| 2229 | 2229 | $this->em->getClassMetadata($assoc['targetEntity']), |
| 2230 | 2230 | $assoc, |
@@ -2255,13 +2255,13 @@ discard block |
||
| 2255 | 2255 | |
| 2256 | 2256 | $associationMappings = array_filter( |
| 2257 | 2257 | $class->associationMappings, |
| 2258 | - function ($assoc) { return $assoc['isCascadeRemove']; } |
|
| 2258 | + function($assoc) { return $assoc['isCascadeRemove']; } |
|
| 2259 | 2259 | ); |
| 2260 | 2260 | |
| 2261 | 2261 | $entitiesToCascade = []; |
| 2262 | 2262 | |
| 2263 | 2263 | foreach ($associationMappings as $assoc) { |
| 2264 | - if ($entity instanceof Proxy && !$entity->__isInitialized__) { |
|
| 2264 | + if ($entity instanceof Proxy && ! $entity->__isInitialized__) { |
|
| 2265 | 2265 | $entity->__load(); |
| 2266 | 2266 | } |
| 2267 | 2267 | |
@@ -2325,7 +2325,7 @@ discard block |
||
| 2325 | 2325 | return; |
| 2326 | 2326 | } |
| 2327 | 2327 | |
| 2328 | - if ($entity instanceof Proxy && !$entity->__isInitialized__) { |
|
| 2328 | + if ($entity instanceof Proxy && ! $entity->__isInitialized__) { |
|
| 2329 | 2329 | $entity->__load(); |
| 2330 | 2330 | } |
| 2331 | 2331 | |
@@ -2340,7 +2340,7 @@ discard block |
||
| 2340 | 2340 | case LockMode::NONE === $lockMode: |
| 2341 | 2341 | case LockMode::PESSIMISTIC_READ === $lockMode: |
| 2342 | 2342 | case LockMode::PESSIMISTIC_WRITE === $lockMode: |
| 2343 | - if (!$this->em->getConnection()->isTransactionActive()) { |
|
| 2343 | + if ( ! $this->em->getConnection()->isTransactionActive()) { |
|
| 2344 | 2344 | throw TransactionRequiredException::transactionRequired(); |
| 2345 | 2345 | } |
| 2346 | 2346 | |
@@ -2676,7 +2676,7 @@ discard block |
||
| 2676 | 2676 | // then we can append this entity for eager loading! |
| 2677 | 2677 | if ($hints['fetchMode'][$class->name][$field] == ClassMetadata::FETCH_EAGER && |
| 2678 | 2678 | isset($hints[self::HINT_DEFEREAGERLOAD]) && |
| 2679 | - !$targetClass->isIdentifierComposite && |
|
| 2679 | + ! $targetClass->isIdentifierComposite && |
|
| 2680 | 2680 | $newValue instanceof Proxy && |
| 2681 | 2681 | $newValue->__isInitialized__ === false) { |
| 2682 | 2682 | |
@@ -3043,7 +3043,7 @@ discard block |
||
| 3043 | 3043 | public function getCollectionPersister(array $association) |
| 3044 | 3044 | { |
| 3045 | 3045 | $role = isset($association['cache']) |
| 3046 | - ? $association['sourceEntity'] . '::' . $association['fieldName'] |
|
| 3046 | + ? $association['sourceEntity'].'::'.$association['fieldName'] |
|
| 3047 | 3047 | : $association['type']; |
| 3048 | 3048 | |
| 3049 | 3049 | if (isset($this->collectionPersisters[$role])) { |
@@ -3261,7 +3261,7 @@ discard block |
||
| 3261 | 3261 | */ |
| 3262 | 3262 | private function afterTransactionComplete() |
| 3263 | 3263 | { |
| 3264 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
| 3264 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
| 3265 | 3265 | $persister->afterTransactionComplete(); |
| 3266 | 3266 | }); |
| 3267 | 3267 | } |
@@ -3271,7 +3271,7 @@ discard block |
||
| 3271 | 3271 | */ |
| 3272 | 3272 | private function afterTransactionRolledBack() |
| 3273 | 3273 | { |
| 3274 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
| 3274 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
| 3275 | 3275 | $persister->afterTransactionRolledBack(); |
| 3276 | 3276 | }); |
| 3277 | 3277 | } |
@@ -3351,11 +3351,11 @@ discard block |
||
| 3351 | 3351 | */ |
| 3352 | 3352 | private function mergeEntityStateIntoManagedCopy($entity, $managedCopy) |
| 3353 | 3353 | { |
| 3354 | - if (! $this->isLoaded($entity)) { |
|
| 3354 | + if ( ! $this->isLoaded($entity)) { |
|
| 3355 | 3355 | return; |
| 3356 | 3356 | } |
| 3357 | 3357 | |
| 3358 | - if (! $this->isLoaded($managedCopy)) { |
|
| 3358 | + if ( ! $this->isLoaded($managedCopy)) { |
|
| 3359 | 3359 | $managedCopy->__load(); |
| 3360 | 3360 | } |
| 3361 | 3361 | |
@@ -3378,7 +3378,7 @@ discard block |
||
| 3378 | 3378 | if ($other === null) { |
| 3379 | 3379 | $prop->setValue($managedCopy, null); |
| 3380 | 3380 | } else { |
| 3381 | - if ($other instanceof Proxy && !$other->__isInitialized()) { |
|
| 3381 | + if ($other instanceof Proxy && ! $other->__isInitialized()) { |
|
| 3382 | 3382 | // do not merge fields marked lazy that have not been fetched. |
| 3383 | 3383 | continue; |
| 3384 | 3384 | } |
@@ -3465,7 +3465,7 @@ discard block |
||
| 3465 | 3465 | */ |
| 3466 | 3466 | private function clearIdentityMapForEntityName($entityName) |
| 3467 | 3467 | { |
| 3468 | - if (! isset($this->identityMap[$entityName])) { |
|
| 3468 | + if ( ! isset($this->identityMap[$entityName])) { |
|
| 3469 | 3469 | return; |
| 3470 | 3470 | } |
| 3471 | 3471 | |
@@ -88,8 +88,8 @@ discard block |
||
| 88 | 88 | // 1. Create an INSERT INTO temptable ... SELECT identifiers WHERE $AST->getWhereClause() |
| 89 | 89 | $sqlWalker->setSQLTableAlias($primaryClass->getTableName(), 't0', $updateClause->aliasIdentificationVariable); |
| 90 | 90 | |
| 91 | - $this->_insertSql = 'INSERT INTO ' . $tempTable . ' (' . $idColumnList . ')' |
|
| 92 | - . ' SELECT t0.' . implode(', t0.', $idColumnNames); |
|
| 91 | + $this->_insertSql = 'INSERT INTO '.$tempTable.' ('.$idColumnList.')' |
|
| 92 | + . ' SELECT t0.'.implode(', t0.', $idColumnNames); |
|
| 93 | 93 | |
| 94 | 94 | $rangeDecl = new AST\RangeVariableDeclaration($primaryClass->name, $updateClause->aliasIdentificationVariable); |
| 95 | 95 | $fromClause = new AST\FromClause([new AST\IdentificationVariableDeclaration($rangeDecl, null, [])]); |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $this->_insertSql .= $sqlWalker->walkFromClause($fromClause); |
| 98 | 98 | |
| 99 | 99 | // 2. Create ID subselect statement used in UPDATE ... WHERE ... IN (subselect) |
| 100 | - $idSubselect = 'SELECT ' . $idColumnList . ' FROM ' . $tempTable; |
|
| 100 | + $idSubselect = 'SELECT '.$idColumnList.' FROM '.$tempTable; |
|
| 101 | 101 | |
| 102 | 102 | // 3. Create and store UPDATE statements |
| 103 | 103 | $classNames = array_merge($primaryClass->parentClasses, [$primaryClass->name], $primaryClass->subClasses); |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | foreach (array_reverse($classNames) as $className) { |
| 107 | 107 | $affected = false; |
| 108 | 108 | $class = $em->getClassMetadata($className); |
| 109 | - $updateSql = 'UPDATE ' . $quoteStrategy->getTableName($class, $platform) . ' SET '; |
|
| 109 | + $updateSql = 'UPDATE '.$quoteStrategy->getTableName($class, $platform).' SET '; |
|
| 110 | 110 | |
| 111 | 111 | foreach ($updateItems as $updateItem) { |
| 112 | 112 | $field = $updateItem->pathExpression->field; |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | if ($affected) { |
| 136 | - $this->_sqlStatements[$i] = $updateSql . ' WHERE (' . $idColumnList . ') IN (' . $idSubselect . ')'; |
|
| 136 | + $this->_sqlStatements[$i] = $updateSql.' WHERE ('.$idColumnList.') IN ('.$idSubselect.')'; |
|
| 137 | 137 | } |
| 138 | 138 | } |
| 139 | 139 | |
@@ -152,8 +152,8 @@ discard block |
||
| 152 | 152 | ]; |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | - $this->_createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable . ' (' |
|
| 156 | - . $platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; |
|
| 155 | + $this->_createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable.' (' |
|
| 156 | + . $platform->getColumnDeclarationListSQL($columnDefinitions).')'; |
|
| 157 | 157 | |
| 158 | 158 | $this->_dropTempTableSql = $platform->getDropTemporaryTableSQL($tempTable); |
| 159 | 159 | } |
@@ -77,8 +77,8 @@ discard block |
||
| 77 | 77 | // 1. Create an INSERT INTO temptable ... SELECT identifiers WHERE $AST->getWhereClause() |
| 78 | 78 | $sqlWalker->setSQLTableAlias($primaryClass->getTableName(), 't0', $primaryDqlAlias); |
| 79 | 79 | |
| 80 | - $this->_insertSql = 'INSERT INTO ' . $tempTable . ' (' . $idColumnList . ')' |
|
| 81 | - . ' SELECT t0.' . implode(', t0.', $idColumnNames); |
|
| 80 | + $this->_insertSql = 'INSERT INTO '.$tempTable.' ('.$idColumnList.')' |
|
| 81 | + . ' SELECT t0.'.implode(', t0.', $idColumnNames); |
|
| 82 | 82 | |
| 83 | 83 | $rangeDecl = new AST\RangeVariableDeclaration($primaryClass->name, $primaryDqlAlias); |
| 84 | 84 | $fromClause = new AST\FromClause([new AST\IdentificationVariableDeclaration($rangeDecl, null, [])]); |
@@ -90,14 +90,14 @@ discard block |
||
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | // 2. Create ID subselect statement used in DELETE ... WHERE ... IN (subselect) |
| 93 | - $idSubselect = 'SELECT ' . $idColumnList . ' FROM ' . $tempTable; |
|
| 93 | + $idSubselect = 'SELECT '.$idColumnList.' FROM '.$tempTable; |
|
| 94 | 94 | |
| 95 | 95 | // 3. Create and store DELETE statements |
| 96 | 96 | $classNames = array_merge($primaryClass->parentClasses, [$primaryClass->name], $primaryClass->subClasses); |
| 97 | 97 | foreach (array_reverse($classNames) as $className) { |
| 98 | 98 | $tableName = $quoteStrategy->getTableName($em->getClassMetadata($className), $platform); |
| 99 | - $this->_sqlStatements[] = 'DELETE FROM ' . $tableName |
|
| 100 | - . ' WHERE (' . $idColumnList . ') IN (' . $idSubselect . ')'; |
|
| 99 | + $this->_sqlStatements[] = 'DELETE FROM '.$tableName |
|
| 100 | + . ' WHERE ('.$idColumnList.') IN ('.$idSubselect.')'; |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | // 4. Store DDL for temporary identifier table. |
@@ -108,8 +108,8 @@ discard block |
||
| 108 | 108 | 'type' => Type::getType(PersisterHelper::getTypeOfColumn($idColumnName, $rootClass, $em)), |
| 109 | 109 | ]; |
| 110 | 110 | } |
| 111 | - $this->_createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable . ' (' |
|
| 112 | - . $platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; |
|
| 111 | + $this->_createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable.' (' |
|
| 112 | + . $platform->getColumnDeclarationListSQL($columnDefinitions).')'; |
|
| 113 | 113 | $this->_dropTempTableSql = $platform->getDropTemporaryTableSQL($tempTable); |
| 114 | 114 | } |
| 115 | 115 | |