@@ -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 |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | * declarations (from ... x join ... y join ... z ...) appear in the query |
414 | 414 | * as the hydration process relies on that order for proper operation. |
415 | 415 | * |
416 | - * @param AST\SelectStatement|AST\DeleteStatement|AST\UpdateStatement $AST |
|
416 | + * @param AST\SelectStatement $AST |
|
417 | 417 | * |
418 | 418 | * @return void |
419 | 419 | */ |
@@ -1617,7 +1617,7 @@ discard block |
||
1617 | 1617 | * accessible is "FROM", prohibiting an easy implementation without larger |
1618 | 1618 | * changes.} |
1619 | 1619 | * |
1620 | - * @return \Doctrine\ORM\Query\AST\SubselectIdentificationVariableDeclaration | |
|
1620 | + * @return AST\IdentificationVariableDeclaration | |
|
1621 | 1621 | * \Doctrine\ORM\Query\AST\IdentificationVariableDeclaration |
1622 | 1622 | */ |
1623 | 1623 | public function SubselectIdentificationVariableDeclaration() |
@@ -1755,7 +1755,7 @@ discard block |
||
1755 | 1755 | /** |
1756 | 1756 | * JoinAssociationDeclaration ::= JoinAssociationPathExpression ["AS"] AliasIdentificationVariable [IndexBy] |
1757 | 1757 | * |
1758 | - * @return \Doctrine\ORM\Query\AST\JoinAssociationPathExpression |
|
1758 | + * @return AST\JoinAssociationDeclaration |
|
1759 | 1759 | */ |
1760 | 1760 | public function JoinAssociationDeclaration() |
1761 | 1761 | { |
@@ -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 |
@@ -1282,7 +1282,7 @@ discard block |
||
1282 | 1282 | /** |
1283 | 1283 | * Schedules an entity for being updated. |
1284 | 1284 | * |
1285 | - * @param object $entity The entity to schedule for being updated. |
|
1285 | + * @param \Doctrine\Tests\Models\Forum\ForumUser $entity The entity to schedule for being updated. |
|
1286 | 1286 | * |
1287 | 1287 | * @return void |
1288 | 1288 | * |
@@ -1350,7 +1350,7 @@ discard block |
||
1350 | 1350 | /** |
1351 | 1351 | * Checks whether an entity is registered to be checked in the unit of work. |
1352 | 1352 | * |
1353 | - * @param object $entity |
|
1353 | + * @param \Doctrine\Tests\ORM\NotifyChangedEntity $entity |
|
1354 | 1354 | * |
1355 | 1355 | * @return boolean |
1356 | 1356 | */ |
@@ -1603,7 +1603,7 @@ discard block |
||
1603 | 1603 | * |
1604 | 1604 | * @ignore |
1605 | 1605 | * |
1606 | - * @param mixed $idHash (must be possible to cast it to string) |
|
1606 | + * @param string $idHash (must be possible to cast it to string) |
|
1607 | 1607 | * @param string $rootClassName |
1608 | 1608 | * |
1609 | 1609 | * @return object|bool The found entity or FALSE. |
@@ -3160,7 +3160,7 @@ discard block |
||
3160 | 3160 | * |
3161 | 3161 | * @param object $entity The entity that owns the property. |
3162 | 3162 | * @param string $propertyName The name of the property that changed. |
3163 | - * @param mixed $oldValue The old value of the property. |
|
3163 | + * @param null|integer $oldValue The old value of the property. |
|
3164 | 3164 | * @param mixed $newValue The new value of the property. |
3165 | 3165 | * |
3166 | 3166 | * @return void |
@@ -3360,7 +3360,7 @@ discard block |
||
3360 | 3360 | /** |
3361 | 3361 | * Verifies if two given entities actually are the same based on identifier comparison |
3362 | 3362 | * |
3363 | - * @param object $entity1 |
|
3363 | + * @param Proxy $entity1 |
|
3364 | 3364 | * @param object $entity2 |
3365 | 3365 | * |
3366 | 3366 | * @return bool |
@@ -20,10 +20,8 @@ |
||
20 | 20 | namespace Doctrine\ORM\Persisters\Entity; |
21 | 21 | |
22 | 22 | use Doctrine\ORM\Mapping\ClassMetadata; |
23 | - |
|
24 | 23 | use Doctrine\DBAL\LockMode; |
25 | 24 | use Doctrine\DBAL\Types\Type; |
26 | - |
|
27 | 25 | use Doctrine\Common\Collections\Criteria; |
28 | 26 | use Doctrine\ORM\Utility\PersisterHelper; |
29 | 27 |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | } |
208 | 208 | |
209 | 209 | foreach ($data as $columnName => $value) { |
210 | - if (!is_array($id) || !isset($id[$columnName])) { |
|
210 | + if ( ! is_array($id) || ! isset($id[$columnName])) { |
|
211 | 211 | $stmt->bindValue($paramIndex++, $value, $this->columnTypes[$columnName]); |
212 | 212 | } |
213 | 213 | } |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | // If the current class in the root entity, add the filters |
323 | 323 | if ($filterSql = $this->generateFilterConditionSQL($this->em->getClassMetadata($this->class->rootEntityName), $this->getSQLTableAlias($this->class->rootEntityName))) { |
324 | 324 | $conditionSql .= $conditionSql |
325 | - ? ' AND ' . $filterSql |
|
325 | + ? ' AND '.$filterSql |
|
326 | 326 | : $filterSql; |
327 | 327 | } |
328 | 328 | |
@@ -341,29 +341,29 @@ discard block |
||
341 | 341 | switch ($lockMode) { |
342 | 342 | case LockMode::PESSIMISTIC_READ: |
343 | 343 | |
344 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
344 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
345 | 345 | |
346 | 346 | break; |
347 | 347 | |
348 | 348 | case LockMode::PESSIMISTIC_WRITE: |
349 | 349 | |
350 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
350 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
351 | 351 | |
352 | 352 | break; |
353 | 353 | } |
354 | 354 | |
355 | 355 | $tableName = $this->quoteStrategy->getTableName($this->class, $this->platform); |
356 | - $from = ' FROM ' . $tableName . ' ' . $baseTableAlias; |
|
357 | - $where = $conditionSql != '' ? ' WHERE ' . $conditionSql : ''; |
|
356 | + $from = ' FROM '.$tableName.' '.$baseTableAlias; |
|
357 | + $where = $conditionSql != '' ? ' WHERE '.$conditionSql : ''; |
|
358 | 358 | $lock = $this->platform->appendLockHint($from, $lockMode); |
359 | 359 | $columnList = $this->getSelectColumnsSQL(); |
360 | - $query = 'SELECT ' . $columnList |
|
360 | + $query = 'SELECT '.$columnList |
|
361 | 361 | . $lock |
362 | 362 | . $joinSql |
363 | 363 | . $where |
364 | 364 | . $orderBySql; |
365 | 365 | |
366 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
366 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
367 | 367 | } |
368 | 368 | |
369 | 369 | /** |
@@ -383,14 +383,14 @@ discard block |
||
383 | 383 | |
384 | 384 | if ('' !== $filterSql) { |
385 | 385 | $conditionSql = $conditionSql |
386 | - ? $conditionSql . ' AND ' . $filterSql |
|
386 | + ? $conditionSql.' AND '.$filterSql |
|
387 | 387 | : $filterSql; |
388 | 388 | } |
389 | 389 | |
390 | 390 | $sql = 'SELECT COUNT(*) ' |
391 | - . 'FROM ' . $tableName . ' ' . $baseTableAlias |
|
391 | + . 'FROM '.$tableName.' '.$baseTableAlias |
|
392 | 392 | . $joinSql |
393 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
393 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
394 | 394 | |
395 | 395 | return $sql; |
396 | 396 | } |
@@ -409,16 +409,16 @@ discard block |
||
409 | 409 | $conditions = []; |
410 | 410 | $tableAlias = $this->getSQLTableAlias($parentClassName); |
411 | 411 | $parentClass = $this->em->getClassMetadata($parentClassName); |
412 | - $joinSql .= ' INNER JOIN ' . $this->quoteStrategy->getTableName($parentClass, $this->platform) . ' ' . $tableAlias . ' ON '; |
|
412 | + $joinSql .= ' INNER JOIN '.$this->quoteStrategy->getTableName($parentClass, $this->platform).' '.$tableAlias.' ON '; |
|
413 | 413 | |
414 | 414 | foreach ($identifierColumns as $idColumn) { |
415 | - $conditions[] = $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $idColumn; |
|
415 | + $conditions[] = $baseTableAlias.'.'.$idColumn.' = '.$tableAlias.'.'.$idColumn; |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | $joinSql .= implode(' AND ', $conditions); |
419 | 419 | } |
420 | 420 | |
421 | - return parent::getLockTablesSql($lockMode) . $joinSql; |
|
421 | + return parent::getLockTablesSql($lockMode).$joinSql; |
|
422 | 422 | } |
423 | 423 | |
424 | 424 | /** |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | ? $baseTableAlias |
480 | 480 | : $this->getSQLTableAlias($this->class->rootEntityName); |
481 | 481 | |
482 | - $columnList[] = $tableAlias . '.' . $discrColumn; |
|
482 | + $columnList[] = $tableAlias.'.'.$discrColumn; |
|
483 | 483 | |
484 | 484 | // sub tables |
485 | 485 | foreach ($this->class->subClasses as $subClassName) { |
@@ -586,11 +586,11 @@ discard block |
||
586 | 586 | $conditions = []; |
587 | 587 | $parentClass = $this->em->getClassMetadata($parentClassName); |
588 | 588 | $tableAlias = $this->getSQLTableAlias($parentClassName); |
589 | - $joinSql .= ' INNER JOIN ' . $this->quoteStrategy->getTableName($parentClass, $this->platform) . ' ' . $tableAlias . ' ON '; |
|
589 | + $joinSql .= ' INNER JOIN '.$this->quoteStrategy->getTableName($parentClass, $this->platform).' '.$tableAlias.' ON '; |
|
590 | 590 | |
591 | 591 | |
592 | 592 | foreach ($identifierColumn as $idColumn) { |
593 | - $conditions[] = $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $idColumn; |
|
593 | + $conditions[] = $baseTableAlias.'.'.$idColumn.' = '.$tableAlias.'.'.$idColumn; |
|
594 | 594 | } |
595 | 595 | |
596 | 596 | $joinSql .= implode(' AND ', $conditions); |
@@ -601,10 +601,10 @@ discard block |
||
601 | 601 | $conditions = []; |
602 | 602 | $subClass = $this->em->getClassMetadata($subClassName); |
603 | 603 | $tableAlias = $this->getSQLTableAlias($subClassName); |
604 | - $joinSql .= ' LEFT JOIN ' . $this->quoteStrategy->getTableName($subClass, $this->platform) . ' ' . $tableAlias . ' ON '; |
|
604 | + $joinSql .= ' LEFT JOIN '.$this->quoteStrategy->getTableName($subClass, $this->platform).' '.$tableAlias.' ON '; |
|
605 | 605 | |
606 | 606 | foreach ($identifierColumn as $idColumn) { |
607 | - $conditions[] = $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $idColumn; |
|
607 | + $conditions[] = $baseTableAlias.'.'.$idColumn.' = '.$tableAlias.'.'.$idColumn; |
|
608 | 608 | } |
609 | 609 | |
610 | 610 | $joinSql .= implode(' AND ', $conditions); |
@@ -31,6 +31,7 @@ |
||
31 | 31 | |
32 | 32 | /** |
33 | 33 | * {@inheritdoc} |
34 | + * @param \Doctrine\Tests\ORM\NotifyChangedEntity $entity |
|
34 | 35 | */ |
35 | 36 | public function & getEntityChangeSet($entity) |
36 | 37 | { |