@@ -176,6 +176,9 @@ discard block |
||
176 | 176 | $this->assertFalse($em->getFilters()->isEnabled("foo_filter")); |
177 | 177 | } |
178 | 178 | |
179 | + /** |
|
180 | + * @param EntityManager $em |
|
181 | + */ |
|
179 | 182 | protected function configureFilters($em) |
180 | 183 | { |
181 | 184 | // Add filters to the configuration of the EM |
@@ -889,6 +892,9 @@ discard block |
||
889 | 892 | $this->assertEquals(2, count($manager->managedContracts->slice(0, 10))); |
890 | 893 | } |
891 | 894 | |
895 | + /** |
|
896 | + * @param string $name |
|
897 | + */ |
|
892 | 898 | private function usePersonNameFilter($name) |
893 | 899 | { |
894 | 900 | // Enable the filter |
@@ -568,11 +568,11 @@ discard block |
||
568 | 568 | $user = $this->_em->find(CmsUser::class, $this->userId); |
569 | 569 | |
570 | 570 | $this->assertFalse($user->articles->isInitialized()); |
571 | - $this->assertEquals(2, count($user->articles->slice(0,10))); |
|
571 | + $this->assertEquals(2, count($user->articles->slice(0, 10))); |
|
572 | 572 | |
573 | 573 | $this->useCMSArticleTopicFilter(); |
574 | 574 | |
575 | - $this->assertEquals(1, count($user->articles->slice(0,10))); |
|
575 | + $this->assertEquals(1, count($user->articles->slice(0, 10))); |
|
576 | 576 | } |
577 | 577 | |
578 | 578 | private function useCMSGroupPrefixFilter() |
@@ -616,11 +616,11 @@ discard block |
||
616 | 616 | $user = $this->_em->find(CmsUser::class, $this->userId2); |
617 | 617 | |
618 | 618 | $this->assertFalse($user->groups->isInitialized()); |
619 | - $this->assertEquals(2, count($user->groups->slice(0,10))); |
|
619 | + $this->assertEquals(2, count($user->groups->slice(0, 10))); |
|
620 | 620 | |
621 | 621 | $this->useCMSGroupPrefixFilter(); |
622 | 622 | |
623 | - $this->assertEquals(1, count($user->groups->slice(0,10))); |
|
623 | + $this->assertEquals(1, count($user->groups->slice(0, 10))); |
|
624 | 624 | } |
625 | 625 | |
626 | 626 | private function loadFixtureData() |
@@ -1106,11 +1106,11 @@ discard block |
||
1106 | 1106 | { |
1107 | 1107 | public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias) |
1108 | 1108 | { |
1109 | - if (!in_array("LocaleAware", $targetEntity->reflClass->getInterfaceNames())) { |
|
1109 | + if ( ! in_array("LocaleAware", $targetEntity->reflClass->getInterfaceNames())) { |
|
1110 | 1110 | return ""; |
1111 | 1111 | } |
1112 | 1112 | |
1113 | - return $targetTableAlias.'.locale = ' . $this->getParameter('locale'); // getParam uses connection to quote the value. |
|
1113 | + return $targetTableAlias.'.locale = '.$this->getParameter('locale'); // getParam uses connection to quote the value. |
|
1114 | 1114 | } |
1115 | 1115 | } |
1116 | 1116 | |
@@ -1122,7 +1122,7 @@ discard block |
||
1122 | 1122 | return ""; |
1123 | 1123 | } |
1124 | 1124 | |
1125 | - return $targetTableAlias.'.country = ' . $this->getParameter('country'); // getParam uses connection to quote the value. |
|
1125 | + return $targetTableAlias.'.country = '.$this->getParameter('country'); // getParam uses connection to quote the value. |
|
1126 | 1126 | } |
1127 | 1127 | } |
1128 | 1128 | |
@@ -1134,7 +1134,7 @@ discard block |
||
1134 | 1134 | return ""; |
1135 | 1135 | } |
1136 | 1136 | |
1137 | - return $targetTableAlias.'.name LIKE ' . $this->getParameter('prefix'); // getParam uses connection to quote the value. |
|
1137 | + return $targetTableAlias.'.name LIKE '.$this->getParameter('prefix'); // getParam uses connection to quote the value. |
|
1138 | 1138 | } |
1139 | 1139 | } |
1140 | 1140 | |
@@ -1146,7 +1146,7 @@ discard block |
||
1146 | 1146 | return ""; |
1147 | 1147 | } |
1148 | 1148 | |
1149 | - return $targetTableAlias.'.topic = ' . $this->getParameter('topic'); // getParam uses connection to quote the value. |
|
1149 | + return $targetTableAlias.'.topic = '.$this->getParameter('topic'); // getParam uses connection to quote the value. |
|
1150 | 1150 | } |
1151 | 1151 | } |
1152 | 1152 | |
@@ -1158,7 +1158,7 @@ discard block |
||
1158 | 1158 | return ""; |
1159 | 1159 | } |
1160 | 1160 | |
1161 | - return $targetTableAlias.'.name LIKE ' . $this->getParameter('name'); |
|
1161 | + return $targetTableAlias.'.name LIKE '.$this->getParameter('name'); |
|
1162 | 1162 | } |
1163 | 1163 | } |
1164 | 1164 | |
@@ -1170,7 +1170,7 @@ discard block |
||
1170 | 1170 | return ""; |
1171 | 1171 | } |
1172 | 1172 | |
1173 | - return $targetTableAlias.'.completed = ' . $this->getParameter('completed'); |
|
1173 | + return $targetTableAlias.'.completed = '.$this->getParameter('completed'); |
|
1174 | 1174 | } |
1175 | 1175 | } |
1176 | 1176 | |
@@ -1182,6 +1182,6 @@ discard block |
||
1182 | 1182 | return ""; |
1183 | 1183 | } |
1184 | 1184 | |
1185 | - return $targetTableAlias.'.id = ' . $this->getParameter('id'); |
|
1185 | + return $targetTableAlias.'.id = '.$this->getParameter('id'); |
|
1186 | 1186 | } |
1187 | 1187 | } |
@@ -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 |
@@ -212,12 +212,12 @@ discard block |
||
212 | 212 | |
213 | 213 | if ( ! $this->fileLockRegionDirectory) { |
214 | 214 | throw new \LogicException( |
215 | - 'If you want to use a "READ_WRITE" cache an implementation of "Doctrine\ORM\Cache\ConcurrentRegion" is required, ' . |
|
215 | + 'If you want to use a "READ_WRITE" cache an implementation of "Doctrine\ORM\Cache\ConcurrentRegion" is required, '. |
|
216 | 216 | 'The default implementation provided by doctrine is "Doctrine\ORM\Cache\Region\FileLockRegion" if you want to use it please provide a valid directory, DefaultCacheFactory#setFileLockRegionDirectory(). ' |
217 | 217 | ); |
218 | 218 | } |
219 | 219 | |
220 | - $directory = $this->fileLockRegionDirectory . DIRECTORY_SEPARATOR . $cache['region']; |
|
220 | + $directory = $this->fileLockRegionDirectory.DIRECTORY_SEPARATOR.$cache['region']; |
|
221 | 221 | $region = new FileLockRegion($region, $directory, $this->regionsConfig->getLockLifetime($cache['region'])); |
222 | 222 | } |
223 | 223 | |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | { |
234 | 234 | $cacheAdapter = clone $this->cache; |
235 | 235 | |
236 | - if (!$cacheAdapter instanceof CacheProvider) { |
|
236 | + if ( ! $cacheAdapter instanceof CacheProvider) { |
|
237 | 237 | return $cacheAdapter; |
238 | 238 | } |
239 | 239 | |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | $namespace .= ':'; |
244 | 244 | } |
245 | 245 | |
246 | - $cacheAdapter->setNamespace($namespace . $name); |
|
246 | + $cacheAdapter->setNamespace($namespace.$name); |
|
247 | 247 | |
248 | 248 | return $cacheAdapter; |
249 | 249 | } |
@@ -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); |