@@ -69,7 +69,7 @@ |
||
69 | 69 | * @param EntityManagerInterface $em The EntityManager the new factory works for. |
70 | 70 | * @param string $proxyDir The directory to use for the proxy classes. It must exist. |
71 | 71 | * @param string $proxyNs The namespace to use for the proxy classes. |
72 | - * @param boolean|int $autoGenerate The strategy for automatically generating proxy classes. Possible |
|
72 | + * @param integer $autoGenerate The strategy for automatically generating proxy classes. Possible |
|
73 | 73 | * values are constants of Doctrine\Common\Proxy\AbstractProxyFactory. |
74 | 74 | */ |
75 | 75 | public function __construct(EntityManagerInterface $em, $proxyDir, $proxyNs, $autoGenerate = AbstractProxyFactory::AUTOGENERATE_NEVER) |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | private function createInitializer(ClassMetadata $classMetadata, EntityPersister $entityPersister) |
125 | 125 | { |
126 | 126 | if ($classMetadata->getReflectionClass()->hasMethod('__wakeup')) { |
127 | - return function (BaseProxy $proxy) use ($entityPersister, $classMetadata) { |
|
127 | + return function(BaseProxy $proxy) use ($entityPersister, $classMetadata) { |
|
128 | 128 | $initializer = $proxy->__getInitializer(); |
129 | 129 | $cloner = $proxy->__getCloner(); |
130 | 130 | |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | }; |
162 | 162 | } |
163 | 163 | |
164 | - return function (BaseProxy $proxy) use ($entityPersister, $classMetadata) { |
|
164 | + return function(BaseProxy $proxy) use ($entityPersister, $classMetadata) { |
|
165 | 165 | $initializer = $proxy->__getInitializer(); |
166 | 166 | $cloner = $proxy->__getCloner(); |
167 | 167 | |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $properties = $proxy->__getLazyProperties(); |
176 | 176 | |
177 | 177 | foreach ($properties as $propertyName => $property) { |
178 | - if (!isset($proxy->$propertyName)) { |
|
178 | + if ( ! isset($proxy->$propertyName)) { |
|
179 | 179 | $proxy->$propertyName = $properties[$propertyName]; |
180 | 180 | } |
181 | 181 | } |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | */ |
210 | 210 | private function createCloner(ClassMetadata $classMetadata, EntityPersister $entityPersister) |
211 | 211 | { |
212 | - return function (BaseProxy $proxy) use ($entityPersister, $classMetadata) { |
|
212 | + return function(BaseProxy $proxy) use ($entityPersister, $classMetadata) { |
|
213 | 213 | if ($proxy->__isInitialized()) { |
214 | 214 | return; |
215 | 215 | } |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | * declarations (from ... x join ... y join ... z ...) appear in the query |
413 | 413 | * as the hydration process relies on that order for proper operation. |
414 | 414 | * |
415 | - * @param AST\SelectStatement|AST\DeleteStatement|AST\UpdateStatement $AST |
|
415 | + * @param AST\SelectStatement $AST |
|
416 | 416 | * |
417 | 417 | * @return void |
418 | 418 | */ |
@@ -748,7 +748,7 @@ discard block |
||
748 | 748 | * SingleValuedAssociationPathExpression ::= IdentificationVariable "." SingleValuedAssociationField |
749 | 749 | * CollectionValuedPathExpression ::= IdentificationVariable "." CollectionValuedAssociationField |
750 | 750 | * |
751 | - * @param mixed $AST |
|
751 | + * @param AST\SelectStatement $AST |
|
752 | 752 | * |
753 | 753 | * @return void |
754 | 754 | */ |
@@ -1622,7 +1622,7 @@ discard block |
||
1622 | 1622 | * accessible is "FROM", prohibiting an easy implementation without larger |
1623 | 1623 | * changes.} |
1624 | 1624 | * |
1625 | - * @return \Doctrine\ORM\Query\AST\SubselectIdentificationVariableDeclaration | |
|
1625 | + * @return AST\IdentificationVariableDeclaration | |
|
1626 | 1626 | * \Doctrine\ORM\Query\AST\IdentificationVariableDeclaration |
1627 | 1627 | */ |
1628 | 1628 | public function SubselectIdentificationVariableDeclaration() |
@@ -1760,7 +1760,7 @@ discard block |
||
1760 | 1760 | /** |
1761 | 1761 | * JoinAssociationDeclaration ::= JoinAssociationPathExpression ["AS"] AliasIdentificationVariable [IndexBy] |
1762 | 1762 | * |
1763 | - * @return \Doctrine\ORM\Query\AST\JoinAssociationPathExpression |
|
1763 | + * @return AST\JoinAssociationDeclaration |
|
1764 | 1764 | */ |
1765 | 1765 | public function JoinAssociationDeclaration() |
1766 | 1766 | { |
@@ -1798,7 +1798,7 @@ discard block |
||
1798 | 1798 | * PartialObjectExpression ::= "PARTIAL" IdentificationVariable "." PartialFieldSet |
1799 | 1799 | * PartialFieldSet ::= "{" SimpleStateField {"," SimpleStateField}* "}" |
1800 | 1800 | * |
1801 | - * @return array |
|
1801 | + * @return AST\PartialObjectExpression |
|
1802 | 1802 | */ |
1803 | 1803 | public function PartialObjectExpression() |
1804 | 1804 | { |
@@ -2877,7 +2877,7 @@ discard block |
||
2877 | 2877 | /** |
2878 | 2878 | * StringExpression ::= StringPrimary | ResultVariable | "(" Subselect ")" |
2879 | 2879 | * |
2880 | - * @return \Doctrine\ORM\Query\AST\StringPrimary | |
|
2880 | + * @return null|AST\Node | |
|
2881 | 2881 | * \Doctrine\ORM\Query\AST\Subselect | |
2882 | 2882 | * string |
2883 | 2883 | */ |
@@ -1923,7 +1923,7 @@ |
||
1923 | 1923 | |
1924 | 1924 | case ($lookahead === Lexer::T_INPUT_PARAMETER): |
1925 | 1925 | switch (true) { |
1926 | - case $this->isMathOperator($peek): |
|
1926 | + case $this->isMathOperator($peek): |
|
1927 | 1927 | // :param + u.value |
1928 | 1928 | return $this->SimpleArithmeticExpression(); |
1929 | 1929 |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | $this->queryComponents = $treeWalkerChain->getQueryComponents(); |
384 | 384 | } |
385 | 385 | |
386 | - $outputWalkerClass = $this->customOutputWalker ?: __NAMESPACE__ . '\SqlWalker'; |
|
386 | + $outputWalkerClass = $this->customOutputWalker ?: __NAMESPACE__.'\SqlWalker'; |
|
387 | 387 | $outputWalker = new $outputWalkerClass($this->query, $this->parserResult, $this->queryComponents); |
388 | 388 | |
389 | 389 | // Assign an SQL executor to the parser result |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | $tokenStr = substr($dql, $token['position'], $length); |
479 | 479 | |
480 | 480 | // Building informative message |
481 | - $message = 'line 0, col ' . $tokenPos . " near '" . $tokenStr . "': Error: " . $message; |
|
481 | + $message = 'line 0, col '.$tokenPos." near '".$tokenStr."': Error: ".$message; |
|
482 | 482 | |
483 | 483 | throw QueryException::semanticalError($message, QueryException::dqlError($this->query->getDQL())); |
484 | 484 | } |
@@ -624,8 +624,8 @@ discard block |
||
624 | 624 | |
625 | 625 | // If the namespace is not given then assumes the first FROM entity namespace |
626 | 626 | if (strpos($className, '\\') === false && ! class_exists($className) && strpos($fromClassName, '\\') !== false) { |
627 | - $namespace = substr($fromClassName, 0 , strrpos($fromClassName, '\\')); |
|
628 | - $fqcn = $namespace . '\\' . $className; |
|
627 | + $namespace = substr($fromClassName, 0, strrpos($fromClassName, '\\')); |
|
628 | + $fqcn = $namespace.'\\'.$className; |
|
629 | 629 | |
630 | 630 | if (class_exists($fqcn)) { |
631 | 631 | $expression->className = $fqcn; |
@@ -677,13 +677,13 @@ discard block |
||
677 | 677 | } |
678 | 678 | |
679 | 679 | $this->semanticalError( |
680 | - "There is no mapped field named '$field' on class " . $class->name . ".", $deferredItem['token'] |
|
680 | + "There is no mapped field named '$field' on class ".$class->name.".", $deferredItem['token'] |
|
681 | 681 | ); |
682 | 682 | } |
683 | 683 | |
684 | 684 | if (array_intersect($class->identifier, $expr->partialFieldSet) != $class->identifier) { |
685 | 685 | $this->semanticalError( |
686 | - "The partial field selection of class " . $class->name . " must contain the identifier.", |
|
686 | + "The partial field selection of class ".$class->name." must contain the identifier.", |
|
687 | 687 | $deferredItem['token'] |
688 | 688 | ); |
689 | 689 | } |
@@ -754,7 +754,7 @@ discard block |
||
754 | 754 | // Check if field or association exists |
755 | 755 | if ( ! isset($class->associationMappings[$field]) && ! isset($class->fieldMappings[$field])) { |
756 | 756 | $this->semanticalError( |
757 | - 'Class ' . $class->name . ' has no field or association named ' . $field, |
|
757 | + 'Class '.$class->name.' has no field or association named '.$field, |
|
758 | 758 | $deferredItem['token'] |
759 | 759 | ); |
760 | 760 | } |
@@ -794,8 +794,8 @@ discard block |
||
794 | 794 | // Build the error message |
795 | 795 | $semanticalError = 'Invalid PathExpression. '; |
796 | 796 | $semanticalError .= (count($expectedStringTypes) == 1) |
797 | - ? 'Must be a ' . $expectedStringTypes[0] . '.' |
|
798 | - : implode(' or ', $expectedStringTypes) . ' expected.'; |
|
797 | + ? 'Must be a '.$expectedStringTypes[0].'.' |
|
798 | + : implode(' or ', $expectedStringTypes).' expected.'; |
|
799 | 799 | |
800 | 800 | $this->semanticalError($semanticalError, $deferredItem['token']); |
801 | 801 | } |
@@ -962,7 +962,7 @@ discard block |
||
962 | 962 | if (strrpos($schemaName, ':') !== false) { |
963 | 963 | list($namespaceAlias, $simpleClassName) = explode(':', $schemaName); |
964 | 964 | |
965 | - $schemaName = $this->em->getConfiguration()->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName; |
|
965 | + $schemaName = $this->em->getConfiguration()->getEntityNamespace($namespaceAlias).'\\'.$simpleClassName; |
|
966 | 966 | } |
967 | 967 | |
968 | 968 | $exists = class_exists($schemaName, true) || interface_exists($schemaName, true); |
@@ -1025,7 +1025,7 @@ discard block |
||
1025 | 1025 | |
1026 | 1026 | if ( ! isset($this->queryComponents[$identVariable])) { |
1027 | 1027 | $this->semanticalError( |
1028 | - 'Identification Variable ' . $identVariable .' used in join path expression but was not defined before.' |
|
1028 | + 'Identification Variable '.$identVariable.' used in join path expression but was not defined before.' |
|
1029 | 1029 | ); |
1030 | 1030 | } |
1031 | 1031 | |
@@ -1039,7 +1039,7 @@ discard block |
||
1039 | 1039 | $class = $qComp['metadata']; |
1040 | 1040 | |
1041 | 1041 | if ( ! $class->hasAssociation($field)) { |
1042 | - $this->semanticalError('Class ' . $class->name . ' has no association named ' . $field); |
|
1042 | + $this->semanticalError('Class '.$class->name.' has no association named '.$field); |
|
1043 | 1043 | } |
1044 | 1044 | |
1045 | 1045 | return new AST\JoinAssociationPathExpression($identVariable, $field); |
@@ -1827,7 +1827,7 @@ discard block |
||
1827 | 1827 | list($namespaceAlias, $simpleClassName) = explode(':', $className); |
1828 | 1828 | |
1829 | 1829 | $className = $this->em->getConfiguration() |
1830 | - ->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName; |
|
1830 | + ->getEntityNamespace($namespaceAlias).'\\'.$simpleClassName; |
|
1831 | 1831 | } |
1832 | 1832 | |
1833 | 1833 | $this->match(Lexer::T_OPEN_PARENTHESIS); |
@@ -2452,7 +2452,7 @@ discard block |
||
2452 | 2452 | // Peek beyond the matching closing parenthesis ')' |
2453 | 2453 | $peek = $this->peekBeyondClosingParenthesis(); |
2454 | 2454 | |
2455 | - if (in_array($peek['value'], array("=", "<", "<=", "<>", ">", ">=", "!=")) || |
|
2455 | + if (in_array($peek['value'], array("=", "<", "<=", "<>", ">", ">=", "!=")) || |
|
2456 | 2456 | in_array($peek['type'], array(Lexer::T_NOT, Lexer::T_BETWEEN, Lexer::T_LIKE, Lexer::T_IN, Lexer::T_IS, Lexer::T_EXISTS)) || |
2457 | 2457 | $this->isMathOperator($peek)) { |
2458 | 2458 | $condPrimary->simpleConditionalExpression = $this->SimpleConditionalExpression(); |
@@ -2557,7 +2557,7 @@ discard block |
||
2557 | 2557 | return $this->NullComparisonExpression(); |
2558 | 2558 | } |
2559 | 2559 | |
2560 | - if ($token['type'] === Lexer::T_IS && $lookahead['type'] === Lexer::T_EMPTY) { |
|
2560 | + if ($token['type'] === Lexer::T_IS && $lookahead['type'] === Lexer::T_EMPTY) { |
|
2561 | 2561 | return $this->EmptyCollectionComparisonExpression(); |
2562 | 2562 | } |
2563 | 2563 |
@@ -20,7 +20,6 @@ |
||
20 | 20 | namespace Doctrine\ORM\Query; |
21 | 21 | |
22 | 22 | use Doctrine\Common\Collections\ArrayCollection; |
23 | - |
|
24 | 23 | use Doctrine\Common\Collections\Expr\ExpressionVisitor; |
25 | 24 | use Doctrine\Common\Collections\Expr\Comparison; |
26 | 25 | use Doctrine\Common\Collections\Expr\CompositeExpression; |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | $expressionList[] = $this->dispatch($child); |
115 | 115 | } |
116 | 116 | |
117 | - switch($expr->getType()) { |
|
117 | + switch ($expr->getType()) { |
|
118 | 118 | case CompositeExpression::TYPE_AND: |
119 | 119 | return new Expr\Andx($expressionList); |
120 | 120 | |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | return new Expr\Orx($expressionList); |
123 | 123 | |
124 | 124 | default: |
125 | - throw new \RuntimeException("Unknown composite " . $expr->getType()); |
|
125 | + throw new \RuntimeException("Unknown composite ".$expr->getType()); |
|
126 | 126 | } |
127 | 127 | } |
128 | 128 | |
@@ -136,10 +136,10 @@ discard block |
||
136 | 136 | throw new QueryException('No aliases are set before invoking walkComparison().'); |
137 | 137 | } |
138 | 138 | |
139 | - $field = $this->queryAliases[0] . '.' . $comparison->getField(); |
|
139 | + $field = $this->queryAliases[0].'.'.$comparison->getField(); |
|
140 | 140 | |
141 | - foreach($this->queryAliases as $alias) { |
|
142 | - if(strpos($comparison->getField() . '.', $alias . '.') === 0) { |
|
141 | + foreach ($this->queryAliases as $alias) { |
|
142 | + if (strpos($comparison->getField().'.', $alias.'.') === 0) { |
|
143 | 143 | $field = $comparison->getField(); |
144 | 144 | break; |
145 | 145 | } |
@@ -147,15 +147,15 @@ discard block |
||
147 | 147 | |
148 | 148 | $parameterName = str_replace('.', '_', $comparison->getField()); |
149 | 149 | |
150 | - foreach($this->parameters as $parameter) { |
|
151 | - if($parameter->getName() === $parameterName) { |
|
152 | - $parameterName .= '_' . count($this->parameters); |
|
150 | + foreach ($this->parameters as $parameter) { |
|
151 | + if ($parameter->getName() === $parameterName) { |
|
152 | + $parameterName .= '_'.count($this->parameters); |
|
153 | 153 | break; |
154 | 154 | } |
155 | 155 | } |
156 | 156 | |
157 | 157 | $parameter = new Parameter($parameterName, $this->walkValue($comparison->getValue())); |
158 | - $placeholder = ':' . $parameterName; |
|
158 | + $placeholder = ':'.$parameterName; |
|
159 | 159 | |
160 | 160 | switch ($comparison->getOperator()) { |
161 | 161 | case Comparison::IN: |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | return $this->expr->neq($field, $placeholder); |
183 | 183 | |
184 | 184 | case Comparison::CONTAINS: |
185 | - $parameter->setValue('%' . $parameter->getValue() . '%', $parameter->getType()); |
|
185 | + $parameter->setValue('%'.$parameter->getValue().'%', $parameter->getType()); |
|
186 | 186 | $this->parameters[] = $parameter; |
187 | 187 | return $this->expr->like($field, $placeholder); |
188 | 188 | |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | ); |
198 | 198 | } |
199 | 199 | |
200 | - throw new \RuntimeException("Unknown comparison operator: " . $comparison->getOperator()); |
|
200 | + throw new \RuntimeException("Unknown comparison operator: ".$comparison->getOperator()); |
|
201 | 201 | } |
202 | 202 | } |
203 | 203 |
@@ -1529,6 +1529,7 @@ |
||
1529 | 1529 | |
1530 | 1530 | /** |
1531 | 1531 | * @param AST\NewObjectExpression $newObjectExpression |
1532 | + * @param string $newObjectResultAlias |
|
1532 | 1533 | * |
1533 | 1534 | * @return string The SQL. |
1534 | 1535 | */ |
@@ -443,7 +443,9 @@ discard block |
||
443 | 443 | foreach ($dqlAliases as $dqlAlias) { |
444 | 444 | $class = $this->queryComponents[$dqlAlias]['metadata']; |
445 | 445 | |
446 | - if ( ! $class->isInheritanceTypeSingleTable()) continue; |
|
446 | + if ( ! $class->isInheritanceTypeSingleTable()) { |
|
447 | + continue; |
|
448 | + } |
|
447 | 449 | |
448 | 450 | $conn = $this->em->getConnection(); |
449 | 451 | $values = array(); |
@@ -783,9 +785,13 @@ discard block |
||
783 | 785 | |
784 | 786 | foreach ($subClass->associationMappings as $assoc) { |
785 | 787 | // Skip if association is inherited |
786 | - if (isset($assoc['inherited'])) continue; |
|
788 | + if (isset($assoc['inherited'])) { |
|
789 | + continue; |
|
790 | + } |
|
787 | 791 | |
788 | - if ( ! ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE)) continue; |
|
792 | + if ( ! ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE)) { |
|
793 | + continue; |
|
794 | + } |
|
789 | 795 | |
790 | 796 | foreach ($assoc['targetToSourceKeyColumns'] as $srcColumn) { |
791 | 797 | $columnAlias = $this->getSQLColumnAlias($srcColumn); |
@@ -288,11 +288,11 @@ discard block |
||
288 | 288 | */ |
289 | 289 | public function getSQLTableAlias($tableName, $dqlAlias = '') |
290 | 290 | { |
291 | - $tableName .= ($dqlAlias) ? '@[' . $dqlAlias . ']' : ''; |
|
291 | + $tableName .= ($dqlAlias) ? '@['.$dqlAlias.']' : ''; |
|
292 | 292 | |
293 | 293 | if ( ! isset($this->tableAliasMap[$tableName])) { |
294 | 294 | $this->tableAliasMap[$tableName] = (preg_match('/[a-z]/i', $tableName[0]) ? strtolower($tableName[0]) : 't') |
295 | - . $this->tableAliasCounter++ . '_'; |
|
295 | + . $this->tableAliasCounter++.'_'; |
|
296 | 296 | } |
297 | 297 | |
298 | 298 | return $this->tableAliasMap[$tableName]; |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | */ |
311 | 311 | public function setSQLTableAlias($tableName, $alias, $dqlAlias = '') |
312 | 312 | { |
313 | - $tableName .= ($dqlAlias) ? '@[' . $dqlAlias . ']' : ''; |
|
313 | + $tableName .= ($dqlAlias) ? '@['.$dqlAlias.']' : ''; |
|
314 | 314 | |
315 | 315 | $this->tableAliasMap[$tableName] = $alias; |
316 | 316 | |
@@ -351,12 +351,12 @@ discard block |
||
351 | 351 | |
352 | 352 | // If this is a joined association we must use left joins to preserve the correct result. |
353 | 353 | $sql .= isset($this->queryComponents[$dqlAlias]['relation']) ? ' LEFT ' : ' INNER '; |
354 | - $sql .= 'JOIN ' . $this->quoteStrategy->getTableName($parentClass, $this->platform) . ' ' . $tableAlias . ' ON '; |
|
354 | + $sql .= 'JOIN '.$this->quoteStrategy->getTableName($parentClass, $this->platform).' '.$tableAlias.' ON '; |
|
355 | 355 | |
356 | 356 | $sqlParts = array(); |
357 | 357 | |
358 | 358 | foreach ($this->quoteStrategy->getIdentifierColumnNames($class, $this->platform) as $columnName) { |
359 | - $sqlParts[] = $baseTableAlias . '.' . $columnName . ' = ' . $tableAlias . '.' . $columnName; |
|
359 | + $sqlParts[] = $baseTableAlias.'.'.$columnName.' = '.$tableAlias.'.'.$columnName; |
|
360 | 360 | } |
361 | 361 | |
362 | 362 | // Add filters on the root class |
@@ -377,12 +377,12 @@ discard block |
||
377 | 377 | $subClass = $this->em->getClassMetadata($subClassName); |
378 | 378 | $tableAlias = $this->getSQLTableAlias($subClass->getTableName(), $dqlAlias); |
379 | 379 | |
380 | - $sql .= ' LEFT JOIN ' . $this->quoteStrategy->getTableName($subClass, $this->platform) . ' ' . $tableAlias . ' ON '; |
|
380 | + $sql .= ' LEFT JOIN '.$this->quoteStrategy->getTableName($subClass, $this->platform).' '.$tableAlias.' ON '; |
|
381 | 381 | |
382 | 382 | $sqlParts = array(); |
383 | 383 | |
384 | 384 | foreach ($this->quoteStrategy->getIdentifierColumnNames($subClass, $this->platform) as $columnName) { |
385 | - $sqlParts[] = $baseTableAlias . '.' . $columnName . ' = ' . $tableAlias . '.' . $columnName; |
|
385 | + $sqlParts[] = $baseTableAlias.'.'.$columnName.' = '.$tableAlias.'.'.$columnName; |
|
386 | 386 | } |
387 | 387 | |
388 | 388 | $sql .= implode(' AND ', $sqlParts); |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | ? $persister->getOwningTable($fieldName) |
415 | 415 | : $qComp['metadata']->getTableName(); |
416 | 416 | |
417 | - $orderedColumn = $this->getSQLTableAlias($tableName, $dqlAlias) . '.' . $columnName; |
|
417 | + $orderedColumn = $this->getSQLTableAlias($tableName, $dqlAlias).'.'.$columnName; |
|
418 | 418 | |
419 | 419 | // OrderByClause should replace an ordered relation. see - DDC-2475 |
420 | 420 | if (isset($this->orderedColumnsMap[$orderedColumn])) { |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | } |
423 | 423 | |
424 | 424 | $this->orderedColumnsMap[$orderedColumn] = $orientation; |
425 | - $orderedColumns[] = $orderedColumn . ' ' . $orientation; |
|
425 | + $orderedColumns[] = $orderedColumn.' '.$orientation; |
|
426 | 426 | } |
427 | 427 | } |
428 | 428 | |
@@ -456,13 +456,13 @@ discard block |
||
456 | 456 | $values[] = $conn->quote($this->em->getClassMetadata($subclassName)->discriminatorValue); |
457 | 457 | } |
458 | 458 | |
459 | - $sqlParts[] = (($this->useSqlTableAliases) ? $this->getSQLTableAlias($class->getTableName(), $dqlAlias) . '.' : '') |
|
460 | - . $class->discriminatorColumn['name'] . ' IN (' . implode(', ', $values) . ')'; |
|
459 | + $sqlParts[] = (($this->useSqlTableAliases) ? $this->getSQLTableAlias($class->getTableName(), $dqlAlias).'.' : '') |
|
460 | + . $class->discriminatorColumn['name'].' IN ('.implode(', ', $values).')'; |
|
461 | 461 | } |
462 | 462 | |
463 | 463 | $sql = implode(' AND ', $sqlParts); |
464 | 464 | |
465 | - return (count($sqlParts) > 1) ? '(' . $sql . ')' : $sql; |
|
465 | + return (count($sqlParts) > 1) ? '('.$sql.')' : $sql; |
|
466 | 466 | } |
467 | 467 | |
468 | 468 | /** |
@@ -475,11 +475,11 @@ discard block |
||
475 | 475 | */ |
476 | 476 | private function generateFilterConditionSQL(ClassMetadata $targetEntity, $targetTableAlias) |
477 | 477 | { |
478 | - if (!$this->em->hasFilters()) { |
|
478 | + if ( ! $this->em->hasFilters()) { |
|
479 | 479 | return ''; |
480 | 480 | } |
481 | 481 | |
482 | - switch($targetEntity->inheritanceType) { |
|
482 | + switch ($targetEntity->inheritanceType) { |
|
483 | 483 | case ClassMetadata::INHERITANCE_TYPE_NONE: |
484 | 484 | break; |
485 | 485 | case ClassMetadata::INHERITANCE_TYPE_JOINED: |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | $filterClauses = array(); |
504 | 504 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
505 | 505 | if ('' !== $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { |
506 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
506 | + $filterClauses[] = '('.$filterExpr.')'; |
|
507 | 507 | } |
508 | 508 | } |
509 | 509 | |
@@ -535,7 +535,7 @@ discard block |
||
535 | 535 | } |
536 | 536 | |
537 | 537 | if ( ! $AST->orderByClause && ($orderBySql = $this->_generateOrderedCollectionOrderByItems())) { |
538 | - $sql .= ' ORDER BY ' . $orderBySql; |
|
538 | + $sql .= ' ORDER BY '.$orderBySql; |
|
539 | 539 | } |
540 | 540 | |
541 | 541 | if ($limit !== null || $offset !== null) { |
@@ -547,11 +547,11 @@ discard block |
||
547 | 547 | } |
548 | 548 | |
549 | 549 | if ($lockMode === LockMode::PESSIMISTIC_READ) { |
550 | - return $sql . ' ' . $this->platform->getReadLockSQL(); |
|
550 | + return $sql.' '.$this->platform->getReadLockSQL(); |
|
551 | 551 | } |
552 | 552 | |
553 | 553 | if ($lockMode === LockMode::PESSIMISTIC_WRITE) { |
554 | - return $sql . ' ' . $this->platform->getWriteLockSQL(); |
|
554 | + return $sql.' '.$this->platform->getWriteLockSQL(); |
|
555 | 555 | } |
556 | 556 | |
557 | 557 | if ($lockMode !== LockMode::OPTIMISTIC) { |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | $sqlParts = array(); |
607 | 607 | |
608 | 608 | foreach ($this->quoteStrategy->getIdentifierColumnNames($class, $this->platform) as $columnName) { |
609 | - $sqlParts[] = $tableAlias . '.' . $columnName; |
|
609 | + $sqlParts[] = $tableAlias.'.'.$columnName; |
|
610 | 610 | } |
611 | 611 | |
612 | 612 | return implode(', ', $sqlParts); |
@@ -649,7 +649,7 @@ discard block |
||
649 | 649 | $col = ''; |
650 | 650 | |
651 | 651 | if ($this->useSqlTableAliases) { |
652 | - $col .= $this->walkIdentificationVariable($dqlAlias, $fieldName) . '.'; |
|
652 | + $col .= $this->walkIdentificationVariable($dqlAlias, $fieldName).'.'; |
|
653 | 653 | } |
654 | 654 | |
655 | 655 | $col .= $this->quoteStrategy->getColumnName($fieldName, $class, $this->platform); |
@@ -685,7 +685,7 @@ discard block |
||
685 | 685 | } |
686 | 686 | |
687 | 687 | if ($this->useSqlTableAliases) { |
688 | - $sql .= $this->getSQLTableAlias($class->getTableName(), $dqlAlias) . '.'; |
|
688 | + $sql .= $this->getSQLTableAlias($class->getTableName(), $dqlAlias).'.'; |
|
689 | 689 | } |
690 | 690 | |
691 | 691 | $sql .= reset($assoc['targetToSourceKeyColumns']); |
@@ -703,7 +703,7 @@ discard block |
||
703 | 703 | */ |
704 | 704 | public function walkSelectClause($selectClause) |
705 | 705 | { |
706 | - $sql = 'SELECT ' . (($selectClause->isDistinct) ? 'DISTINCT ' : ''); |
|
706 | + $sql = 'SELECT '.(($selectClause->isDistinct) ? 'DISTINCT ' : ''); |
|
707 | 707 | $sqlSelectExpressions = array_filter(array_map(array($this, 'walkSelectExpression'), $selectClause->selectExpressions)); |
708 | 708 | |
709 | 709 | if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && $selectClause->isDistinct) { |
@@ -740,7 +740,7 @@ discard block |
||
740 | 740 | $discrColumn = $rootClass->discriminatorColumn; |
741 | 741 | $columnAlias = $this->getSQLColumnAlias($discrColumn['name']); |
742 | 742 | |
743 | - $sqlSelectExpressions[] = $tblAlias . '.' . $discrColumn['name'] . ' AS ' . $columnAlias; |
|
743 | + $sqlSelectExpressions[] = $tblAlias.'.'.$discrColumn['name'].' AS '.$columnAlias; |
|
744 | 744 | |
745 | 745 | $this->rsm->setDiscriminatorColumn($dqlAlias, $columnAlias); |
746 | 746 | $this->rsm->addMetaResult($dqlAlias, $columnAlias, $discrColumn['fieldName']); |
@@ -755,7 +755,7 @@ discard block |
||
755 | 755 | foreach ($class->associationMappings as $assoc) { |
756 | 756 | if ( ! ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE)) { |
757 | 757 | continue; |
758 | - } else if ( !$addMetaColumns && !isset($assoc['id'])) { |
|
758 | + } else if ( ! $addMetaColumns && ! isset($assoc['id'])) { |
|
759 | 759 | continue; |
760 | 760 | } |
761 | 761 | |
@@ -769,7 +769,7 @@ discard block |
||
769 | 769 | |
770 | 770 | $type = null; |
771 | 771 | $isIdentifier = (isset($assoc['id']) && $assoc['id'] === true); |
772 | - $sqlSelectExpressions[] = $sqlTableAlias . '.' . $srcColumn . ' AS ' . $columnAlias; |
|
772 | + $sqlSelectExpressions[] = $sqlTableAlias.'.'.$srcColumn.' AS '.$columnAlias; |
|
773 | 773 | |
774 | 774 | if (isset($targetClass->fieldNames[$targetColumn])) { |
775 | 775 | $type = $targetClass->fieldMappings[$targetClass->fieldNames[$targetColumn]]['type']; |
@@ -798,7 +798,7 @@ discard block |
||
798 | 798 | foreach ($assoc['targetToSourceKeyColumns'] as $srcColumn) { |
799 | 799 | $columnAlias = $this->getSQLColumnAlias($srcColumn); |
800 | 800 | |
801 | - $sqlSelectExpressions[] = $sqlTableAlias . '.' . $srcColumn . ' AS ' . $columnAlias; |
|
801 | + $sqlSelectExpressions[] = $sqlTableAlias.'.'.$srcColumn.' AS '.$columnAlias; |
|
802 | 802 | |
803 | 803 | $this->rsm->addMetaResult($dqlAlias, $columnAlias, $srcColumn); |
804 | 804 | } |
@@ -823,7 +823,7 @@ discard block |
||
823 | 823 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($identificationVariableDecl); |
824 | 824 | } |
825 | 825 | |
826 | - return ' FROM ' . implode(', ', $sqlParts); |
|
826 | + return ' FROM '.implode(', ', $sqlParts); |
|
827 | 827 | } |
828 | 828 | |
829 | 829 | /** |
@@ -900,7 +900,7 @@ discard block |
||
900 | 900 | } |
901 | 901 | |
902 | 902 | $sql = $this->platform->appendLockHint( |
903 | - $this->quoteStrategy->getTableName($class, $this->platform) . ' ' . |
|
903 | + $this->quoteStrategy->getTableName($class, $this->platform).' '. |
|
904 | 904 | $this->getSQLTableAlias($class->getTableName(), $dqlAlias), |
905 | 905 | $this->query->getHint(Query::HINT_LOCK_MODE) |
906 | 906 | ); |
@@ -912,10 +912,10 @@ discard block |
||
912 | 912 | $classTableInheritanceJoins = $this->_generateClassTableInheritanceJoins($class, $dqlAlias); |
913 | 913 | |
914 | 914 | if ( ! $buildNestedJoins) { |
915 | - return $sql . $classTableInheritanceJoins; |
|
915 | + return $sql.$classTableInheritanceJoins; |
|
916 | 916 | } |
917 | 917 | |
918 | - return $classTableInheritanceJoins === '' ? $sql : '(' . $sql . $classTableInheritanceJoins . ')'; |
|
918 | + return $classTableInheritanceJoins === '' ? $sql : '('.$sql.$classTableInheritanceJoins.')'; |
|
919 | 919 | } |
920 | 920 | |
921 | 921 | /** |
@@ -940,7 +940,7 @@ discard block |
||
940 | 940 | $relation = $this->queryComponents[$joinedDqlAlias]['relation']; |
941 | 941 | $targetClass = $this->em->getClassMetadata($relation['targetEntity']); |
942 | 942 | $sourceClass = $this->em->getClassMetadata($relation['sourceEntity']); |
943 | - $targetTableName = $this->quoteStrategy->getTableName($targetClass,$this->platform); |
|
943 | + $targetTableName = $this->quoteStrategy->getTableName($targetClass, $this->platform); |
|
944 | 944 | |
945 | 945 | $targetTableAlias = $this->getSQLTableAlias($targetClass->getTableName(), $joinedDqlAlias); |
946 | 946 | $sourceTableAlias = $this->getSQLTableAlias($sourceClass->getTableName(), $associationPathExpression->identificationVariable); |
@@ -948,7 +948,7 @@ discard block |
||
948 | 948 | // Ensure we got the owning side, since it has all mapping info |
949 | 949 | $assoc = ( ! $relation['isOwningSide']) ? $targetClass->associationMappings[$relation['mappedBy']] : $relation; |
950 | 950 | |
951 | - if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && (!$this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
951 | + if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && ( ! $this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
952 | 952 | if ($relation['type'] == ClassMetadata::ONE_TO_MANY || $relation['type'] == ClassMetadata::MANY_TO_MANY) { |
953 | 953 | throw QueryException::iterateWithFetchJoinNotAllowed($assoc); |
954 | 954 | } |
@@ -968,12 +968,12 @@ discard block |
||
968 | 968 | $quotedTargetColumn = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $targetClass, $this->platform); |
969 | 969 | |
970 | 970 | if ($relation['isOwningSide']) { |
971 | - $conditions[] = $sourceTableAlias . '.' . $quotedSourceColumn . ' = ' . $targetTableAlias . '.' . $quotedTargetColumn; |
|
971 | + $conditions[] = $sourceTableAlias.'.'.$quotedSourceColumn.' = '.$targetTableAlias.'.'.$quotedTargetColumn; |
|
972 | 972 | |
973 | 973 | continue; |
974 | 974 | } |
975 | 975 | |
976 | - $conditions[] = $sourceTableAlias . '.' . $quotedTargetColumn . ' = ' . $targetTableAlias . '.' . $quotedSourceColumn; |
|
976 | + $conditions[] = $sourceTableAlias.'.'.$quotedTargetColumn.' = '.$targetTableAlias.'.'.$quotedSourceColumn; |
|
977 | 977 | } |
978 | 978 | |
979 | 979 | // Apply remaining inheritance restrictions |
@@ -991,7 +991,7 @@ discard block |
||
991 | 991 | } |
992 | 992 | |
993 | 993 | $targetTableJoin = array( |
994 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
994 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
995 | 995 | 'condition' => implode(' AND ', $conditions), |
996 | 996 | ); |
997 | 997 | break; |
@@ -1011,10 +1011,10 @@ discard block |
||
1011 | 1011 | $quotedSourceColumn = $this->quoteStrategy->getJoinColumnName($joinColumn, $targetClass, $this->platform); |
1012 | 1012 | $quotedTargetColumn = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $targetClass, $this->platform); |
1013 | 1013 | |
1014 | - $conditions[] = $sourceTableAlias . '.' . $quotedTargetColumn . ' = ' . $joinTableAlias . '.' . $quotedSourceColumn; |
|
1014 | + $conditions[] = $sourceTableAlias.'.'.$quotedTargetColumn.' = '.$joinTableAlias.'.'.$quotedSourceColumn; |
|
1015 | 1015 | } |
1016 | 1016 | |
1017 | - $sql .= $joinTableName . ' ' . $joinTableAlias . ' ON ' . implode(' AND ', $conditions); |
|
1017 | + $sql .= $joinTableName.' '.$joinTableAlias.' ON '.implode(' AND ', $conditions); |
|
1018 | 1018 | |
1019 | 1019 | // Join target table |
1020 | 1020 | $sql .= ($joinType == AST\Join::JOIN_TYPE_LEFT || $joinType == AST\Join::JOIN_TYPE_LEFTOUTER) ? ' LEFT JOIN ' : ' INNER JOIN '; |
@@ -1028,7 +1028,7 @@ discard block |
||
1028 | 1028 | $quotedSourceColumn = $this->quoteStrategy->getJoinColumnName($joinColumn, $targetClass, $this->platform); |
1029 | 1029 | $quotedTargetColumn = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $targetClass, $this->platform); |
1030 | 1030 | |
1031 | - $conditions[] = $targetTableAlias . '.' . $quotedTargetColumn . ' = ' . $joinTableAlias . '.' . $quotedSourceColumn; |
|
1031 | + $conditions[] = $targetTableAlias.'.'.$quotedTargetColumn.' = '.$joinTableAlias.'.'.$quotedSourceColumn; |
|
1032 | 1032 | } |
1033 | 1033 | |
1034 | 1034 | // Apply remaining inheritance restrictions |
@@ -1046,7 +1046,7 @@ discard block |
||
1046 | 1046 | } |
1047 | 1047 | |
1048 | 1048 | $targetTableJoin = array( |
1049 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
1049 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
1050 | 1050 | 'condition' => implode(' AND ', $conditions), |
1051 | 1051 | ); |
1052 | 1052 | break; |
@@ -1056,22 +1056,22 @@ discard block |
||
1056 | 1056 | } |
1057 | 1057 | |
1058 | 1058 | // Handle WITH clause |
1059 | - $withCondition = (null === $condExpr) ? '' : ('(' . $this->walkConditionalExpression($condExpr) . ')'); |
|
1059 | + $withCondition = (null === $condExpr) ? '' : ('('.$this->walkConditionalExpression($condExpr).')'); |
|
1060 | 1060 | |
1061 | 1061 | if ($targetClass->isInheritanceTypeJoined()) { |
1062 | 1062 | $ctiJoins = $this->_generateClassTableInheritanceJoins($targetClass, $joinedDqlAlias); |
1063 | 1063 | // If we have WITH condition, we need to build nested joins for target class table and cti joins |
1064 | 1064 | if ($withCondition) { |
1065 | - $sql .= '(' . $targetTableJoin['table'] . $ctiJoins . ') ON ' . $targetTableJoin['condition']; |
|
1065 | + $sql .= '('.$targetTableJoin['table'].$ctiJoins.') ON '.$targetTableJoin['condition']; |
|
1066 | 1066 | } else { |
1067 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition'] . $ctiJoins; |
|
1067 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition'].$ctiJoins; |
|
1068 | 1068 | } |
1069 | 1069 | } else { |
1070 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition']; |
|
1070 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition']; |
|
1071 | 1071 | } |
1072 | 1072 | |
1073 | 1073 | if ($withCondition) { |
1074 | - $sql .= ' AND ' . $withCondition; |
|
1074 | + $sql .= ' AND '.$withCondition; |
|
1075 | 1075 | } |
1076 | 1076 | |
1077 | 1077 | // Apply the indexes |
@@ -1104,7 +1104,7 @@ discard block |
||
1104 | 1104 | $orderByItems = array_merge($orderByItems, (array) $collectionOrderByItems); |
1105 | 1105 | } |
1106 | 1106 | |
1107 | - return ' ORDER BY ' . implode(', ', $orderByItems); |
|
1107 | + return ' ORDER BY '.implode(', ', $orderByItems); |
|
1108 | 1108 | } |
1109 | 1109 | |
1110 | 1110 | /** |
@@ -1121,10 +1121,10 @@ discard block |
||
1121 | 1121 | $this->orderedColumnsMap[$sql] = $type; |
1122 | 1122 | |
1123 | 1123 | if ($expr instanceof AST\Subselect) { |
1124 | - return '(' . $sql . ') ' . $type; |
|
1124 | + return '('.$sql.') '.$type; |
|
1125 | 1125 | } |
1126 | 1126 | |
1127 | - return $sql . ' ' . $type; |
|
1127 | + return $sql.' '.$type; |
|
1128 | 1128 | } |
1129 | 1129 | |
1130 | 1130 | /** |
@@ -1132,7 +1132,7 @@ discard block |
||
1132 | 1132 | */ |
1133 | 1133 | public function walkHavingClause($havingClause) |
1134 | 1134 | { |
1135 | - return ' HAVING ' . $this->walkConditionalExpression($havingClause->conditionalExpression); |
|
1135 | + return ' HAVING '.$this->walkConditionalExpression($havingClause->conditionalExpression); |
|
1136 | 1136 | } |
1137 | 1137 | |
1138 | 1138 | /** |
@@ -1152,13 +1152,13 @@ discard block |
||
1152 | 1152 | $class = $this->em->getClassMetadata($joinDeclaration->abstractSchemaName); |
1153 | 1153 | $dqlAlias = $joinDeclaration->aliasIdentificationVariable; |
1154 | 1154 | $tableAlias = $this->getSQLTableAlias($class->table['name'], $dqlAlias); |
1155 | - $condition = '(' . $this->walkConditionalExpression($join->conditionalExpression) . ')'; |
|
1155 | + $condition = '('.$this->walkConditionalExpression($join->conditionalExpression).')'; |
|
1156 | 1156 | $isUnconditionalJoin = empty($condition); |
1157 | 1157 | $condExprConjunction = ($class->isInheritanceTypeJoined() && $joinType != AST\Join::JOIN_TYPE_LEFT && $joinType != AST\Join::JOIN_TYPE_LEFTOUTER && $isUnconditionalJoin) |
1158 | 1158 | ? ' AND ' |
1159 | 1159 | : ' ON '; |
1160 | 1160 | |
1161 | - $sql .= $this->generateRangeVariableDeclarationSQL($joinDeclaration, !$isUnconditionalJoin); |
|
1161 | + $sql .= $this->generateRangeVariableDeclarationSQL($joinDeclaration, ! $isUnconditionalJoin); |
|
1162 | 1162 | |
1163 | 1163 | $conditions = array($condition); |
1164 | 1164 | |
@@ -1176,7 +1176,7 @@ discard block |
||
1176 | 1176 | $conditions[] = $filterExpr; |
1177 | 1177 | } |
1178 | 1178 | |
1179 | - $sql .= $condExprConjunction . implode(' AND ', $conditions); |
|
1179 | + $sql .= $condExprConjunction.implode(' AND ', $conditions); |
|
1180 | 1180 | break; |
1181 | 1181 | |
1182 | 1182 | case ($joinDeclaration instanceof AST\JoinAssociationDeclaration): |
@@ -1231,7 +1231,7 @@ discard block |
||
1231 | 1231 | $scalarExpressions[] = $this->walkSimpleArithmeticExpression($scalarExpression); |
1232 | 1232 | } |
1233 | 1233 | |
1234 | - $sql .= implode(', ', $scalarExpressions) . ')'; |
|
1234 | + $sql .= implode(', ', $scalarExpressions).')'; |
|
1235 | 1235 | |
1236 | 1236 | return $sql; |
1237 | 1237 | } |
@@ -1253,7 +1253,7 @@ discard block |
||
1253 | 1253 | ? $this->conn->quote($nullIfExpression->secondExpression) |
1254 | 1254 | : $this->walkSimpleArithmeticExpression($nullIfExpression->secondExpression); |
1255 | 1255 | |
1256 | - return 'NULLIF(' . $firstExpression . ', ' . $secondExpression . ')'; |
|
1256 | + return 'NULLIF('.$firstExpression.', '.$secondExpression.')'; |
|
1257 | 1257 | } |
1258 | 1258 | |
1259 | 1259 | /** |
@@ -1268,11 +1268,11 @@ discard block |
||
1268 | 1268 | $sql = 'CASE'; |
1269 | 1269 | |
1270 | 1270 | foreach ($generalCaseExpression->whenClauses as $whenClause) { |
1271 | - $sql .= ' WHEN ' . $this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
1272 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
1271 | + $sql .= ' WHEN '.$this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
1272 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
1273 | 1273 | } |
1274 | 1274 | |
1275 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression) . ' END'; |
|
1275 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression).' END'; |
|
1276 | 1276 | |
1277 | 1277 | return $sql; |
1278 | 1278 | } |
@@ -1286,14 +1286,14 @@ discard block |
||
1286 | 1286 | */ |
1287 | 1287 | public function walkSimpleCaseExpression($simpleCaseExpression) |
1288 | 1288 | { |
1289 | - $sql = 'CASE ' . $this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
1289 | + $sql = 'CASE '.$this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
1290 | 1290 | |
1291 | 1291 | foreach ($simpleCaseExpression->simpleWhenClauses as $simpleWhenClause) { |
1292 | - $sql .= ' WHEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
1293 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
1292 | + $sql .= ' WHEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
1293 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
1294 | 1294 | } |
1295 | 1295 | |
1296 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression) . ' END'; |
|
1296 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression).' END'; |
|
1297 | 1297 | |
1298 | 1298 | return $sql; |
1299 | 1299 | } |
@@ -1327,7 +1327,7 @@ discard block |
||
1327 | 1327 | $columnName = $this->quoteStrategy->getColumnName($fieldName, $class, $this->platform); |
1328 | 1328 | $columnAlias = $this->getSQLColumnAlias($class->fieldMappings[$fieldName]['columnName']); |
1329 | 1329 | |
1330 | - $col = $sqlTableAlias . '.' . $columnName; |
|
1330 | + $col = $sqlTableAlias.'.'.$columnName; |
|
1331 | 1331 | |
1332 | 1332 | $fieldType = $class->getTypeOfField($fieldName); |
1333 | 1333 | |
@@ -1336,7 +1336,7 @@ discard block |
||
1336 | 1336 | $col = $type->convertToPHPValueSQL($col, $this->conn->getDatabasePlatform()); |
1337 | 1337 | } |
1338 | 1338 | |
1339 | - $sql .= $col . ' AS ' . $columnAlias; |
|
1339 | + $sql .= $col.' AS '.$columnAlias; |
|
1340 | 1340 | |
1341 | 1341 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1342 | 1342 | |
@@ -1360,7 +1360,7 @@ discard block |
||
1360 | 1360 | $columnAlias = $this->getSQLColumnAlias('sclr'); |
1361 | 1361 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1362 | 1362 | |
1363 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
1363 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
1364 | 1364 | |
1365 | 1365 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1366 | 1366 | |
@@ -1374,7 +1374,7 @@ discard block |
||
1374 | 1374 | $columnAlias = $this->getSQLColumnAlias('sclr'); |
1375 | 1375 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1376 | 1376 | |
1377 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
1377 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
1378 | 1378 | |
1379 | 1379 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1380 | 1380 | |
@@ -1385,7 +1385,7 @@ discard block |
||
1385 | 1385 | break; |
1386 | 1386 | |
1387 | 1387 | case ($expr instanceof AST\NewObjectExpression): |
1388 | - $sql .= $this->walkNewObject($expr,$selectExpression->fieldIdentificationVariable); |
|
1388 | + $sql .= $this->walkNewObject($expr, $selectExpression->fieldIdentificationVariable); |
|
1389 | 1389 | break; |
1390 | 1390 | |
1391 | 1391 | default: |
@@ -1426,14 +1426,14 @@ discard block |
||
1426 | 1426 | $columnAlias = $this->getSQLColumnAlias($mapping['columnName']); |
1427 | 1427 | $quotedColumnName = $this->quoteStrategy->getColumnName($fieldName, $class, $this->platform); |
1428 | 1428 | |
1429 | - $col = $sqlTableAlias . '.' . $quotedColumnName; |
|
1429 | + $col = $sqlTableAlias.'.'.$quotedColumnName; |
|
1430 | 1430 | |
1431 | 1431 | if (isset($class->fieldMappings[$fieldName]['requireSQLConversion'])) { |
1432 | 1432 | $type = Type::getType($class->getTypeOfField($fieldName)); |
1433 | 1433 | $col = $type->convertToPHPValueSQL($col, $this->platform); |
1434 | 1434 | } |
1435 | 1435 | |
1436 | - $sqlParts[] = $col . ' AS '. $columnAlias; |
|
1436 | + $sqlParts[] = $col.' AS '.$columnAlias; |
|
1437 | 1437 | |
1438 | 1438 | $this->scalarResultAliasMap[$resultAlias][] = $columnAlias; |
1439 | 1439 | |
@@ -1450,21 +1450,21 @@ discard block |
||
1450 | 1450 | $sqlTableAlias = $this->getSQLTableAlias($subClass->getTableName(), $dqlAlias); |
1451 | 1451 | |
1452 | 1452 | foreach ($subClass->fieldMappings as $fieldName => $mapping) { |
1453 | - if (isset($mapping['inherited']) || $partialFieldSet && !in_array($fieldName, $partialFieldSet)) { |
|
1453 | + if (isset($mapping['inherited']) || $partialFieldSet && ! in_array($fieldName, $partialFieldSet)) { |
|
1454 | 1454 | continue; |
1455 | 1455 | } |
1456 | 1456 | |
1457 | 1457 | $columnAlias = $this->getSQLColumnAlias($mapping['columnName']); |
1458 | 1458 | $quotedColumnName = $this->quoteStrategy->getColumnName($fieldName, $subClass, $this->platform); |
1459 | 1459 | |
1460 | - $col = $sqlTableAlias . '.' . $quotedColumnName; |
|
1460 | + $col = $sqlTableAlias.'.'.$quotedColumnName; |
|
1461 | 1461 | |
1462 | 1462 | if (isset($subClass->fieldMappings[$fieldName]['requireSQLConversion'])) { |
1463 | 1463 | $type = Type::getType($subClass->getTypeOfField($fieldName)); |
1464 | 1464 | $col = $type->convertToPHPValueSQL($col, $this->platform); |
1465 | 1465 | } |
1466 | 1466 | |
1467 | - $sqlParts[] = $col . ' AS ' . $columnAlias; |
|
1467 | + $sqlParts[] = $col.' AS '.$columnAlias; |
|
1468 | 1468 | |
1469 | 1469 | $this->scalarResultAliasMap[$resultAlias][] = $columnAlias; |
1470 | 1470 | |
@@ -1484,7 +1484,7 @@ discard block |
||
1484 | 1484 | */ |
1485 | 1485 | public function walkQuantifiedExpression($qExpr) |
1486 | 1486 | { |
1487 | - return ' ' . strtoupper($qExpr->type) . '(' . $this->walkSubselect($qExpr->subselect) . ')'; |
|
1487 | + return ' '.strtoupper($qExpr->type).'('.$this->walkSubselect($qExpr->subselect).')'; |
|
1488 | 1488 | } |
1489 | 1489 | |
1490 | 1490 | /** |
@@ -1518,13 +1518,13 @@ discard block |
||
1518 | 1518 | public function walkSubselectFromClause($subselectFromClause) |
1519 | 1519 | { |
1520 | 1520 | $identificationVarDecls = $subselectFromClause->identificationVariableDeclarations; |
1521 | - $sqlParts = array (); |
|
1521 | + $sqlParts = array(); |
|
1522 | 1522 | |
1523 | 1523 | foreach ($identificationVarDecls as $subselectIdVarDecl) { |
1524 | 1524 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($subselectIdVarDecl); |
1525 | 1525 | } |
1526 | 1526 | |
1527 | - return ' FROM ' . implode(', ', $sqlParts); |
|
1527 | + return ' FROM '.implode(', ', $sqlParts); |
|
1528 | 1528 | } |
1529 | 1529 | |
1530 | 1530 | /** |
@@ -1532,7 +1532,7 @@ discard block |
||
1532 | 1532 | */ |
1533 | 1533 | public function walkSimpleSelectClause($simpleSelectClause) |
1534 | 1534 | { |
1535 | - return 'SELECT' . ($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
1535 | + return 'SELECT'.($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
1536 | 1536 | . $this->walkSimpleSelectExpression($simpleSelectClause->simpleSelectExpression); |
1537 | 1537 | } |
1538 | 1538 | |
@@ -1551,10 +1551,10 @@ discard block |
||
1551 | 1551 | * |
1552 | 1552 | * @return string The SQL. |
1553 | 1553 | */ |
1554 | - public function walkNewObject($newObjectExpression, $newObjectResultAlias=null) |
|
1554 | + public function walkNewObject($newObjectExpression, $newObjectResultAlias = null) |
|
1555 | 1555 | { |
1556 | 1556 | $sqlSelectExpressions = array(); |
1557 | - $objIndex = $newObjectResultAlias?:$this->newObjectCounter++; |
|
1557 | + $objIndex = $newObjectResultAlias ?: $this->newObjectCounter++; |
|
1558 | 1558 | |
1559 | 1559 | foreach ($newObjectExpression->args as $argIndex => $e) { |
1560 | 1560 | $resultAlias = $this->scalarResultCounter++; |
@@ -1567,7 +1567,7 @@ discard block |
||
1567 | 1567 | break; |
1568 | 1568 | |
1569 | 1569 | case ($e instanceof AST\Subselect): |
1570 | - $sqlSelectExpressions[] = '(' . $e->dispatch($this) . ') AS ' . $columnAlias; |
|
1570 | + $sqlSelectExpressions[] = '('.$e->dispatch($this).') AS '.$columnAlias; |
|
1571 | 1571 | break; |
1572 | 1572 | |
1573 | 1573 | case ($e instanceof AST\PathExpression): |
@@ -1577,7 +1577,7 @@ discard block |
||
1577 | 1577 | $class = $qComp['metadata']; |
1578 | 1578 | $fieldType = $class->getTypeOfField($fieldName); |
1579 | 1579 | |
1580 | - $sqlSelectExpressions[] = trim($e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1580 | + $sqlSelectExpressions[] = trim($e->dispatch($this)).' AS '.$columnAlias; |
|
1581 | 1581 | break; |
1582 | 1582 | |
1583 | 1583 | case ($e instanceof AST\Literal): |
@@ -1591,11 +1591,11 @@ discard block |
||
1591 | 1591 | break; |
1592 | 1592 | } |
1593 | 1593 | |
1594 | - $sqlSelectExpressions[] = trim($e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1594 | + $sqlSelectExpressions[] = trim($e->dispatch($this)).' AS '.$columnAlias; |
|
1595 | 1595 | break; |
1596 | 1596 | |
1597 | 1597 | default: |
1598 | - $sqlSelectExpressions[] = trim($e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1598 | + $sqlSelectExpressions[] = trim($e->dispatch($this)).' AS '.$columnAlias; |
|
1599 | 1599 | break; |
1600 | 1600 | } |
1601 | 1601 | |
@@ -1628,16 +1628,16 @@ discard block |
||
1628 | 1628 | case ($expr instanceof AST\AggregateExpression): |
1629 | 1629 | $alias = $simpleSelectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1630 | 1630 | |
1631 | - $sql .= $this->walkAggregateExpression($expr) . ' AS dctrn__' . $alias; |
|
1631 | + $sql .= $this->walkAggregateExpression($expr).' AS dctrn__'.$alias; |
|
1632 | 1632 | break; |
1633 | 1633 | |
1634 | 1634 | case ($expr instanceof AST\Subselect): |
1635 | 1635 | $alias = $simpleSelectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1636 | 1636 | |
1637 | - $columnAlias = 'sclr' . $this->aliasCounter++; |
|
1637 | + $columnAlias = 'sclr'.$this->aliasCounter++; |
|
1638 | 1638 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
1639 | 1639 | |
1640 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
1640 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
1641 | 1641 | break; |
1642 | 1642 | |
1643 | 1643 | case ($expr instanceof AST\Functions\FunctionNode): |
@@ -1654,7 +1654,7 @@ discard block |
||
1654 | 1654 | $columnAlias = $this->getSQLColumnAlias('sclr'); |
1655 | 1655 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
1656 | 1656 | |
1657 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
1657 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
1658 | 1658 | break; |
1659 | 1659 | |
1660 | 1660 | case ($expr instanceof AST\ParenthesisExpression): |
@@ -1674,8 +1674,8 @@ discard block |
||
1674 | 1674 | */ |
1675 | 1675 | public function walkAggregateExpression($aggExpression) |
1676 | 1676 | { |
1677 | - return $aggExpression->functionName . '(' . ($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
1678 | - . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression) . ')'; |
|
1677 | + return $aggExpression->functionName.'('.($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
1678 | + . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression).')'; |
|
1679 | 1679 | } |
1680 | 1680 | |
1681 | 1681 | /** |
@@ -1689,7 +1689,7 @@ discard block |
||
1689 | 1689 | $sqlParts[] = $this->walkGroupByItem($groupByItem); |
1690 | 1690 | } |
1691 | 1691 | |
1692 | - return ' GROUP BY ' . implode(', ', $sqlParts); |
|
1692 | + return ' GROUP BY '.implode(', ', $sqlParts); |
|
1693 | 1693 | } |
1694 | 1694 | |
1695 | 1695 | /** |
@@ -1746,7 +1746,7 @@ discard block |
||
1746 | 1746 | { |
1747 | 1747 | $class = $this->em->getClassMetadata($deleteClause->abstractSchemaName); |
1748 | 1748 | $tableName = $class->getTableName(); |
1749 | - $sql = 'DELETE FROM ' . $this->quoteStrategy->getTableName($class, $this->platform); |
|
1749 | + $sql = 'DELETE FROM '.$this->quoteStrategy->getTableName($class, $this->platform); |
|
1750 | 1750 | |
1751 | 1751 | $this->setSQLTableAlias($tableName, $tableName, $deleteClause->aliasIdentificationVariable); |
1752 | 1752 | $this->rootAliases[] = $deleteClause->aliasIdentificationVariable; |
@@ -1761,12 +1761,12 @@ discard block |
||
1761 | 1761 | { |
1762 | 1762 | $class = $this->em->getClassMetadata($updateClause->abstractSchemaName); |
1763 | 1763 | $tableName = $class->getTableName(); |
1764 | - $sql = 'UPDATE ' . $this->quoteStrategy->getTableName($class, $this->platform); |
|
1764 | + $sql = 'UPDATE '.$this->quoteStrategy->getTableName($class, $this->platform); |
|
1765 | 1765 | |
1766 | 1766 | $this->setSQLTableAlias($tableName, $tableName, $updateClause->aliasIdentificationVariable); |
1767 | 1767 | $this->rootAliases[] = $updateClause->aliasIdentificationVariable; |
1768 | 1768 | |
1769 | - $sql .= ' SET ' . implode(', ', array_map(array($this, 'walkUpdateItem'), $updateClause->updateItems)); |
|
1769 | + $sql .= ' SET '.implode(', ', array_map(array($this, 'walkUpdateItem'), $updateClause->updateItems)); |
|
1770 | 1770 | |
1771 | 1771 | return $sql; |
1772 | 1772 | } |
@@ -1779,7 +1779,7 @@ discard block |
||
1779 | 1779 | $useTableAliasesBefore = $this->useSqlTableAliases; |
1780 | 1780 | $this->useSqlTableAliases = false; |
1781 | 1781 | |
1782 | - $sql = $this->walkPathExpression($updateItem->pathExpression) . ' = '; |
|
1782 | + $sql = $this->walkPathExpression($updateItem->pathExpression).' = '; |
|
1783 | 1783 | $newValue = $updateItem->newValue; |
1784 | 1784 | |
1785 | 1785 | switch (true) { |
@@ -1822,7 +1822,7 @@ discard block |
||
1822 | 1822 | |
1823 | 1823 | if (count($filterClauses)) { |
1824 | 1824 | if ($condSql) { |
1825 | - $condSql = '(' . $condSql . ') AND '; |
|
1825 | + $condSql = '('.$condSql.') AND '; |
|
1826 | 1826 | } |
1827 | 1827 | |
1828 | 1828 | $condSql .= implode(' AND ', $filterClauses); |
@@ -1830,11 +1830,11 @@ discard block |
||
1830 | 1830 | } |
1831 | 1831 | |
1832 | 1832 | if ($condSql) { |
1833 | - return ' WHERE ' . (( ! $discrSql) ? $condSql : '(' . $condSql . ') AND ' . $discrSql); |
|
1833 | + return ' WHERE '.(( ! $discrSql) ? $condSql : '('.$condSql.') AND '.$discrSql); |
|
1834 | 1834 | } |
1835 | 1835 | |
1836 | 1836 | if ($discrSql) { |
1837 | - return ' WHERE ' . $discrSql; |
|
1837 | + return ' WHERE '.$discrSql; |
|
1838 | 1838 | } |
1839 | 1839 | |
1840 | 1840 | return ''; |
@@ -1877,7 +1877,7 @@ discard block |
||
1877 | 1877 | // if only one ConditionalPrimary is defined |
1878 | 1878 | return ( ! ($factor instanceof AST\ConditionalFactor)) |
1879 | 1879 | ? $this->walkConditionalPrimary($factor) |
1880 | - : ($factor->not ? 'NOT ' : '') . $this->walkConditionalPrimary($factor->conditionalPrimary); |
|
1880 | + : ($factor->not ? 'NOT ' : '').$this->walkConditionalPrimary($factor->conditionalPrimary); |
|
1881 | 1881 | } |
1882 | 1882 | |
1883 | 1883 | /** |
@@ -1892,7 +1892,7 @@ discard block |
||
1892 | 1892 | if ($primary->isConditionalExpression()) { |
1893 | 1893 | $condExpr = $primary->conditionalExpression; |
1894 | 1894 | |
1895 | - return '(' . $this->walkConditionalExpression($condExpr) . ')'; |
|
1895 | + return '('.$this->walkConditionalExpression($condExpr).')'; |
|
1896 | 1896 | } |
1897 | 1897 | } |
1898 | 1898 | |
@@ -1903,7 +1903,7 @@ discard block |
||
1903 | 1903 | { |
1904 | 1904 | $sql = ($existsExpr->not) ? 'NOT ' : ''; |
1905 | 1905 | |
1906 | - $sql .= 'EXISTS (' . $this->walkSubselect($existsExpr->subselect) . ')'; |
|
1906 | + $sql .= 'EXISTS ('.$this->walkSubselect($existsExpr->subselect).')'; |
|
1907 | 1907 | |
1908 | 1908 | return $sql; |
1909 | 1909 | } |
@@ -1947,7 +1947,7 @@ discard block |
||
1947 | 1947 | $targetTableAlias = $this->getSQLTableAlias($targetClass->getTableName()); |
1948 | 1948 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
1949 | 1949 | |
1950 | - $sql .= $this->quoteStrategy->getTableName($targetClass, $this->platform) . ' ' . $targetTableAlias . ' WHERE '; |
|
1950 | + $sql .= $this->quoteStrategy->getTableName($targetClass, $this->platform).' '.$targetTableAlias.' WHERE '; |
|
1951 | 1951 | |
1952 | 1952 | $owningAssoc = $targetClass->associationMappings[$assoc['mappedBy']]; |
1953 | 1953 | $sqlParts = array(); |
@@ -1955,7 +1955,7 @@ discard block |
||
1955 | 1955 | foreach ($owningAssoc['targetToSourceKeyColumns'] as $targetColumn => $sourceColumn) { |
1956 | 1956 | $targetColumn = $this->quoteStrategy->getColumnName($class->fieldNames[$targetColumn], $class, $this->platform); |
1957 | 1957 | |
1958 | - $sqlParts[] = $sourceTableAlias . '.' . $targetColumn . ' = ' . $targetTableAlias . '.' . $sourceColumn; |
|
1958 | + $sqlParts[] = $sourceTableAlias.'.'.$targetColumn.' = '.$targetTableAlias.'.'.$sourceColumn; |
|
1959 | 1959 | } |
1960 | 1960 | |
1961 | 1961 | foreach ($this->quoteStrategy->getIdentifierColumnNames($targetClass, $this->platform) as $targetColumnName) { |
@@ -1963,7 +1963,7 @@ discard block |
||
1963 | 1963 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
1964 | 1964 | } |
1965 | 1965 | |
1966 | - $sqlParts[] = $targetTableAlias . '.' . $targetColumnName . ' = ' . $entitySql; |
|
1966 | + $sqlParts[] = $targetTableAlias.'.'.$targetColumnName.' = '.$entitySql; |
|
1967 | 1967 | } |
1968 | 1968 | |
1969 | 1969 | $sql .= implode(' AND ', $sqlParts); |
@@ -1979,8 +1979,8 @@ discard block |
||
1979 | 1979 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
1980 | 1980 | |
1981 | 1981 | // join to target table |
1982 | - $sql .= $this->quoteStrategy->getJoinTableName($owningAssoc, $targetClass, $this->platform) . ' ' . $joinTableAlias |
|
1983 | - . ' INNER JOIN ' . $this->quoteStrategy->getTableName($targetClass, $this->platform) . ' ' . $targetTableAlias . ' ON '; |
|
1982 | + $sql .= $this->quoteStrategy->getJoinTableName($owningAssoc, $targetClass, $this->platform).' '.$joinTableAlias |
|
1983 | + . ' INNER JOIN '.$this->quoteStrategy->getTableName($targetClass, $this->platform).' '.$targetTableAlias.' ON '; |
|
1984 | 1984 | |
1985 | 1985 | // join conditions |
1986 | 1986 | $joinColumns = $assoc['isOwningSide'] ? $joinTable['inverseJoinColumns'] : $joinTable['joinColumns']; |
@@ -1989,7 +1989,7 @@ discard block |
||
1989 | 1989 | foreach ($joinColumns as $joinColumn) { |
1990 | 1990 | $targetColumn = $this->quoteStrategy->getColumnName($targetClass->fieldNames[$joinColumn['referencedColumnName']], $targetClass, $this->platform); |
1991 | 1991 | |
1992 | - $joinSqlParts[] = $joinTableAlias . '.' . $joinColumn['name'] . ' = ' . $targetTableAlias . '.' . $targetColumn; |
|
1992 | + $joinSqlParts[] = $joinTableAlias.'.'.$joinColumn['name'].' = '.$targetTableAlias.'.'.$targetColumn; |
|
1993 | 1993 | } |
1994 | 1994 | |
1995 | 1995 | $sql .= implode(' AND ', $joinSqlParts); |
@@ -2001,7 +2001,7 @@ discard block |
||
2001 | 2001 | foreach ($joinColumns as $joinColumn) { |
2002 | 2002 | $targetColumn = $this->quoteStrategy->getColumnName($class->fieldNames[$joinColumn['referencedColumnName']], $class, $this->platform); |
2003 | 2003 | |
2004 | - $sqlParts[] = $joinTableAlias . '.' . $joinColumn['name'] . ' = ' . $sourceTableAlias . '.' . $targetColumn; |
|
2004 | + $sqlParts[] = $joinTableAlias.'.'.$joinColumn['name'].' = '.$sourceTableAlias.'.'.$targetColumn; |
|
2005 | 2005 | } |
2006 | 2006 | |
2007 | 2007 | foreach ($this->quoteStrategy->getIdentifierColumnNames($targetClass, $this->platform) as $targetColumnName) { |
@@ -2009,13 +2009,13 @@ discard block |
||
2009 | 2009 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
2010 | 2010 | } |
2011 | 2011 | |
2012 | - $sqlParts[] = $targetTableAlias . '.' . $targetColumnName . ' IN (' . $entitySql . ')'; |
|
2012 | + $sqlParts[] = $targetTableAlias.'.'.$targetColumnName.' IN ('.$entitySql.')'; |
|
2013 | 2013 | } |
2014 | 2014 | |
2015 | 2015 | $sql .= implode(' AND ', $sqlParts); |
2016 | 2016 | } |
2017 | 2017 | |
2018 | - return $sql . ')'; |
|
2018 | + return $sql.')'; |
|
2019 | 2019 | } |
2020 | 2020 | |
2021 | 2021 | /** |
@@ -2026,7 +2026,7 @@ discard block |
||
2026 | 2026 | $sizeFunc = new AST\Functions\SizeFunction('size'); |
2027 | 2027 | $sizeFunc->collectionPathExpression = $emptyCollCompExpr->expression; |
2028 | 2028 | |
2029 | - return $sizeFunc->getSql($this) . ($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
2029 | + return $sizeFunc->getSql($this).($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
2030 | 2030 | } |
2031 | 2031 | |
2032 | 2032 | /** |
@@ -2035,19 +2035,19 @@ discard block |
||
2035 | 2035 | public function walkNullComparisonExpression($nullCompExpr) |
2036 | 2036 | { |
2037 | 2037 | $expression = $nullCompExpr->expression; |
2038 | - $comparison = ' IS' . ($nullCompExpr->not ? ' NOT' : '') . ' NULL'; |
|
2038 | + $comparison = ' IS'.($nullCompExpr->not ? ' NOT' : '').' NULL'; |
|
2039 | 2039 | |
2040 | 2040 | // Handle ResultVariable |
2041 | 2041 | if (is_string($expression) && isset($this->queryComponents[$expression]['resultVariable'])) { |
2042 | - return $this->walkResultVariable($expression) . $comparison; |
|
2042 | + return $this->walkResultVariable($expression).$comparison; |
|
2043 | 2043 | } |
2044 | 2044 | |
2045 | 2045 | // Handle InputParameter mapping inclusion to ParserResult |
2046 | 2046 | if ($expression instanceof AST\InputParameter) { |
2047 | - return $this->walkInputParameter($expression) . $comparison; |
|
2047 | + return $this->walkInputParameter($expression).$comparison; |
|
2048 | 2048 | } |
2049 | 2049 | |
2050 | - return $expression->dispatch($this) . $comparison; |
|
2050 | + return $expression->dispatch($this).$comparison; |
|
2051 | 2051 | } |
2052 | 2052 | |
2053 | 2053 | /** |
@@ -2055,7 +2055,7 @@ discard block |
||
2055 | 2055 | */ |
2056 | 2056 | public function walkInExpression($inExpr) |
2057 | 2057 | { |
2058 | - $sql = $this->walkArithmeticExpression($inExpr->expression) . ($inExpr->not ? ' NOT' : '') . ' IN ('; |
|
2058 | + $sql = $this->walkArithmeticExpression($inExpr->expression).($inExpr->not ? ' NOT' : '').' IN ('; |
|
2059 | 2059 | |
2060 | 2060 | $sql .= ($inExpr->subselect) |
2061 | 2061 | ? $this->walkSubselect($inExpr->subselect) |
@@ -2081,10 +2081,10 @@ discard block |
||
2081 | 2081 | } |
2082 | 2082 | |
2083 | 2083 | if ($this->useSqlTableAliases) { |
2084 | - $sql .= $this->getSQLTableAlias($discrClass->getTableName(), $dqlAlias) . '.'; |
|
2084 | + $sql .= $this->getSQLTableAlias($discrClass->getTableName(), $dqlAlias).'.'; |
|
2085 | 2085 | } |
2086 | 2086 | |
2087 | - $sql .= $class->discriminatorColumn['name'] . ($instanceOfExpr->not ? ' NOT IN ' : ' IN '); |
|
2087 | + $sql .= $class->discriminatorColumn['name'].($instanceOfExpr->not ? ' NOT IN ' : ' IN '); |
|
2088 | 2088 | |
2089 | 2089 | $sqlParameterList = array(); |
2090 | 2090 | |
@@ -2114,7 +2114,7 @@ discard block |
||
2114 | 2114 | $sqlParameterList[] = $this->conn->quote($discriminatorValue); |
2115 | 2115 | } |
2116 | 2116 | |
2117 | - $sql .= '(' . implode(', ', $sqlParameterList) . ')'; |
|
2117 | + $sql .= '('.implode(', ', $sqlParameterList).')'; |
|
2118 | 2118 | |
2119 | 2119 | return $sql; |
2120 | 2120 | } |
@@ -2163,8 +2163,8 @@ discard block |
||
2163 | 2163 | $sql .= ' NOT'; |
2164 | 2164 | } |
2165 | 2165 | |
2166 | - $sql .= ' BETWEEN ' . $this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
2167 | - . ' AND ' . $this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
2166 | + $sql .= ' BETWEEN '.$this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
2167 | + . ' AND '.$this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
2168 | 2168 | |
2169 | 2169 | return $sql; |
2170 | 2170 | } |
@@ -2179,7 +2179,7 @@ discard block |
||
2179 | 2179 | ? $this->walkResultVariable($stringExpr) |
2180 | 2180 | : $stringExpr->dispatch($this); |
2181 | 2181 | |
2182 | - $sql = $leftExpr . ($likeExpr->not ? ' NOT' : '') . ' LIKE '; |
|
2182 | + $sql = $leftExpr.($likeExpr->not ? ' NOT' : '').' LIKE '; |
|
2183 | 2183 | |
2184 | 2184 | if ($likeExpr->stringPattern instanceof AST\InputParameter) { |
2185 | 2185 | $sql .= $this->walkInputParameter($likeExpr->stringPattern); |
@@ -2192,7 +2192,7 @@ discard block |
||
2192 | 2192 | } |
2193 | 2193 | |
2194 | 2194 | if ($likeExpr->escapeChar) { |
2195 | - $sql .= ' ESCAPE ' . $this->walkLiteral($likeExpr->escapeChar); |
|
2195 | + $sql .= ' ESCAPE '.$this->walkLiteral($likeExpr->escapeChar); |
|
2196 | 2196 | } |
2197 | 2197 | |
2198 | 2198 | return $sql; |
@@ -2219,7 +2219,7 @@ discard block |
||
2219 | 2219 | ? $leftExpr->dispatch($this) |
2220 | 2220 | : (is_numeric($leftExpr) ? $leftExpr : $this->conn->quote($leftExpr)); |
2221 | 2221 | |
2222 | - $sql .= ' ' . $compExpr->operator . ' '; |
|
2222 | + $sql .= ' '.$compExpr->operator.' '; |
|
2223 | 2223 | |
2224 | 2224 | $sql .= ($rightExpr instanceof AST\Node) |
2225 | 2225 | ? $rightExpr->dispatch($this) |
@@ -2251,7 +2251,7 @@ discard block |
||
2251 | 2251 | { |
2252 | 2252 | return ($arithmeticExpr->isSimpleArithmeticExpression()) |
2253 | 2253 | ? $this->walkSimpleArithmeticExpression($arithmeticExpr->simpleArithmeticExpression) |
2254 | - : '(' . $this->walkSubselect($arithmeticExpr->subselect) . ')'; |
|
2254 | + : '('.$this->walkSubselect($arithmeticExpr->subselect).')'; |
|
2255 | 2255 | } |
2256 | 2256 | |
2257 | 2257 | /** |
@@ -2305,7 +2305,7 @@ discard block |
||
2305 | 2305 | |
2306 | 2306 | $sign = $factor->isNegativeSigned() ? '-' : ($factor->isPositiveSigned() ? '+' : ''); |
2307 | 2307 | |
2308 | - return $sign . $this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
2308 | + return $sign.$this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
2309 | 2309 | } |
2310 | 2310 | |
2311 | 2311 | /** |
@@ -2318,7 +2318,7 @@ discard block |
||
2318 | 2318 | public function walkArithmeticPrimary($primary) |
2319 | 2319 | { |
2320 | 2320 | if ($primary instanceof AST\SimpleArithmeticExpression) { |
2321 | - return '(' . $this->walkSimpleArithmeticExpression($primary) . ')'; |
|
2321 | + return '('.$this->walkSimpleArithmeticExpression($primary).')'; |
|
2322 | 2322 | } |
2323 | 2323 | |
2324 | 2324 | if ($primary instanceof AST\Node) { |
@@ -21,7 +21,6 @@ |
||
21 | 21 | |
22 | 22 | use Doctrine\Common\Collections\ArrayCollection; |
23 | 23 | use Doctrine\Common\Collections\Criteria; |
24 | - |
|
25 | 24 | use Doctrine\ORM\Query\Expr; |
26 | 25 | use Doctrine\ORM\Query\QueryExpressionVisitor; |
27 | 26 |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | * |
184 | 184 | * @param boolean $cacheable |
185 | 185 | * |
186 | - * @return \Doctrine\ORM\AbstractQuery This query instance. |
|
186 | + * @return QueryBuilder This query instance. |
|
187 | 187 | */ |
188 | 188 | public function setCacheable($cacheable) |
189 | 189 | { |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | /** |
204 | 204 | * @param string $cacheRegion |
205 | 205 | * |
206 | - * @return \Doctrine\ORM\AbstractQuery This query instance. |
|
206 | + * @return QueryBuilder This query instance. |
|
207 | 207 | */ |
208 | 208 | public function setCacheRegion($cacheRegion) |
209 | 209 | { |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | /** |
216 | 216 | * Obtain the name of the second level query cache region in which query results will be stored |
217 | 217 | * |
218 | - * @return The cache region name; NULL indicates the default region. |
|
218 | + * @return string|null cache region name; NULL indicates the default region. |
|
219 | 219 | */ |
220 | 220 | public function getCacheRegion() |
221 | 221 | { |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | * Sets the life-time for this query into second level cache. |
235 | 235 | * |
236 | 236 | * @param integer $lifetime |
237 | - * @return \Doctrine\ORM\AbstractQuery This query instance. |
|
237 | + * @return QueryBuilder This query instance. |
|
238 | 238 | */ |
239 | 239 | public function setLifetime($lifetime) |
240 | 240 | { |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | |
254 | 254 | /** |
255 | 255 | * @param integer $cacheMode |
256 | - * @return \Doctrine\ORM\AbstractQuery This query instance. |
|
256 | + * @return QueryBuilder This query instance. |
|
257 | 257 | */ |
258 | 258 | public function setCacheMode($cacheMode) |
259 | 259 | { |
@@ -740,7 +740,7 @@ discard block |
||
740 | 740 | * ->leftJoin('u.Phonenumbers', 'p'); |
741 | 741 | * </code> |
742 | 742 | * |
743 | - * @param mixed $select The selection expressions. |
|
743 | + * @param string $select The selection expressions. |
|
744 | 744 | * |
745 | 745 | * @return QueryBuilder This QueryBuilder instance. |
746 | 746 | */ |
@@ -1088,7 +1088,6 @@ discard block |
||
1088 | 1088 | * ->andWhere('u.is_active = 1'); |
1089 | 1089 | * </code> |
1090 | 1090 | * |
1091 | - * @param mixed $where The query restrictions. |
|
1092 | 1091 | * |
1093 | 1092 | * @return QueryBuilder This QueryBuilder instance. |
1094 | 1093 | * |
@@ -1121,7 +1120,6 @@ discard block |
||
1121 | 1120 | * ->orWhere('u.id = 2'); |
1122 | 1121 | * </code> |
1123 | 1122 | * |
1124 | - * @param mixed $where The WHERE statement. |
|
1125 | 1123 | * |
1126 | 1124 | * @return QueryBuilder |
1127 | 1125 | * |
@@ -118,11 +118,11 @@ discard block |
||
118 | 118 | */ |
119 | 119 | private $joinRootAliases = array(); |
120 | 120 | |
121 | - /** |
|
122 | - * Whether to use second level cache, if available. |
|
123 | - * |
|
124 | - * @var boolean |
|
125 | - */ |
|
121 | + /** |
|
122 | + * Whether to use second level cache, if available. |
|
123 | + * |
|
124 | + * @var boolean |
|
125 | + */ |
|
126 | 126 | protected $cacheable = false; |
127 | 127 | |
128 | 128 | /** |
@@ -213,10 +213,10 @@ discard block |
||
213 | 213 | } |
214 | 214 | |
215 | 215 | /** |
216 | - * Obtain the name of the second level query cache region in which query results will be stored |
|
217 | - * |
|
218 | - * @return The cache region name; NULL indicates the default region. |
|
219 | - */ |
|
216 | + * Obtain the name of the second level query cache region in which query results will be stored |
|
217 | + * |
|
218 | + * @return The cache region name; NULL indicates the default region. |
|
219 | + */ |
|
220 | 220 | public function getCacheRegion() |
221 | 221 | { |
222 | 222 | return $this->cacheRegion; |
@@ -1364,10 +1364,10 @@ discard block |
||
1364 | 1364 | */ |
1365 | 1365 | private function _getDQLForDelete() |
1366 | 1366 | { |
1367 | - return 'DELETE' |
|
1368 | - . $this->_getReducedDQLQueryPart('from', array('pre' => ' ', 'separator' => ', ')) |
|
1369 | - . $this->_getReducedDQLQueryPart('where', array('pre' => ' WHERE ')) |
|
1370 | - . $this->_getReducedDQLQueryPart('orderBy', array('pre' => ' ORDER BY ', 'separator' => ', ')); |
|
1367 | + return 'DELETE' |
|
1368 | + . $this->_getReducedDQLQueryPart('from', array('pre' => ' ', 'separator' => ', ')) |
|
1369 | + . $this->_getReducedDQLQueryPart('where', array('pre' => ' WHERE ')) |
|
1370 | + . $this->_getReducedDQLQueryPart('orderBy', array('pre' => ' ORDER BY ', 'separator' => ', ')); |
|
1371 | 1371 | } |
1372 | 1372 | |
1373 | 1373 | /** |
@@ -1375,11 +1375,11 @@ discard block |
||
1375 | 1375 | */ |
1376 | 1376 | private function _getDQLForUpdate() |
1377 | 1377 | { |
1378 | - return 'UPDATE' |
|
1379 | - . $this->_getReducedDQLQueryPart('from', array('pre' => ' ', 'separator' => ', ')) |
|
1380 | - . $this->_getReducedDQLQueryPart('set', array('pre' => ' SET ', 'separator' => ', ')) |
|
1381 | - . $this->_getReducedDQLQueryPart('where', array('pre' => ' WHERE ')) |
|
1382 | - . $this->_getReducedDQLQueryPart('orderBy', array('pre' => ' ORDER BY ', 'separator' => ', ')); |
|
1378 | + return 'UPDATE' |
|
1379 | + . $this->_getReducedDQLQueryPart('from', array('pre' => ' ', 'separator' => ', ')) |
|
1380 | + . $this->_getReducedDQLQueryPart('set', array('pre' => ' SET ', 'separator' => ', ')) |
|
1381 | + . $this->_getReducedDQLQueryPart('where', array('pre' => ' WHERE ')) |
|
1382 | + . $this->_getReducedDQLQueryPart('orderBy', array('pre' => ' ORDER BY ', 'separator' => ', ')); |
|
1383 | 1383 | } |
1384 | 1384 | |
1385 | 1385 | /** |
@@ -1388,8 +1388,8 @@ discard block |
||
1388 | 1388 | private function _getDQLForSelect() |
1389 | 1389 | { |
1390 | 1390 | $dql = 'SELECT' |
1391 | - . ($this->_dqlParts['distinct']===true ? ' DISTINCT' : '') |
|
1392 | - . $this->_getReducedDQLQueryPart('select', array('pre' => ' ', 'separator' => ', ')); |
|
1391 | + . ($this->_dqlParts['distinct']===true ? ' DISTINCT' : '') |
|
1392 | + . $this->_getReducedDQLQueryPart('select', array('pre' => ' ', 'separator' => ', ')); |
|
1393 | 1393 | |
1394 | 1394 | $fromParts = $this->getDQLPart('from'); |
1395 | 1395 | $joinParts = $this->getDQLPart('join'); |
@@ -1413,10 +1413,10 @@ discard block |
||
1413 | 1413 | } |
1414 | 1414 | |
1415 | 1415 | $dql .= implode(', ', $fromClauses) |
1416 | - . $this->_getReducedDQLQueryPart('where', array('pre' => ' WHERE ')) |
|
1417 | - . $this->_getReducedDQLQueryPart('groupBy', array('pre' => ' GROUP BY ', 'separator' => ', ')) |
|
1418 | - . $this->_getReducedDQLQueryPart('having', array('pre' => ' HAVING ')) |
|
1419 | - . $this->_getReducedDQLQueryPart('orderBy', array('pre' => ' ORDER BY ', 'separator' => ', ')); |
|
1416 | + . $this->_getReducedDQLQueryPart('where', array('pre' => ' WHERE ')) |
|
1417 | + . $this->_getReducedDQLQueryPart('groupBy', array('pre' => ' GROUP BY ', 'separator' => ', ')) |
|
1418 | + . $this->_getReducedDQLQueryPart('having', array('pre' => ' HAVING ')) |
|
1419 | + . $this->_getReducedDQLQueryPart('orderBy', array('pre' => ' ORDER BY ', 'separator' => ', ')); |
|
1420 | 1420 | |
1421 | 1421 | return $dql; |
1422 | 1422 | } |
@@ -1436,8 +1436,8 @@ discard block |
||
1436 | 1436 | } |
1437 | 1437 | |
1438 | 1438 | return (isset($options['pre']) ? $options['pre'] : '') |
1439 | - . (is_array($queryPart) ? implode($options['separator'], $queryPart) : $queryPart) |
|
1440 | - . (isset($options['post']) ? $options['post'] : ''); |
|
1439 | + . (is_array($queryPart) ? implode($options['separator'], $queryPart) : $queryPart) |
|
1440 | + . (isset($options['post']) ? $options['post'] : ''); |
|
1441 | 1441 | } |
1442 | 1442 | |
1443 | 1443 | /** |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | * @return array |
475 | 475 | */ |
476 | 476 | public function getAllAliases() { |
477 | - return array_merge($this->getRootAliases(),array_keys($this->joinRootAliases)); |
|
477 | + return array_merge($this->getRootAliases(), array_keys($this->joinRootAliases)); |
|
478 | 478 | } |
479 | 479 | |
480 | 480 | /** |
@@ -600,7 +600,7 @@ discard block |
||
600 | 600 | public function getParameter($key) |
601 | 601 | { |
602 | 602 | $filteredParameters = $this->parameters->filter( |
603 | - function (Query\Parameter $parameter) use ($key) { |
|
603 | + function(Query\Parameter $parameter) use ($key) { |
|
604 | 604 | $parameterName = $parameter->getName(); |
605 | 605 | |
606 | 606 | return $key === $parameterName || (string) $key === (string) $parameterName; |
@@ -682,7 +682,7 @@ discard block |
||
682 | 682 | } |
683 | 683 | |
684 | 684 | $isMultiple = is_array($this->_dqlParts[$dqlPartName]) |
685 | - && !($dqlPartName == 'join' && !$append); |
|
685 | + && ! ($dqlPartName == 'join' && ! $append); |
|
686 | 686 | |
687 | 687 | // Allow adding any part retrieved from self::getDQLParts(). |
688 | 688 | if (is_array($dqlPart) && $dqlPartName != 'join') { |
@@ -899,7 +899,7 @@ discard block |
||
899 | 899 | { |
900 | 900 | $rootAliases = $this->getRootAliases(); |
901 | 901 | |
902 | - if (!in_array($alias, $rootAliases)) { |
|
902 | + if ( ! in_array($alias, $rootAliases)) { |
|
903 | 903 | throw new Query\QueryException( |
904 | 904 | sprintf('Specified root alias %s must be set before invoking indexBy().', $alias) |
905 | 905 | ); |
@@ -1298,15 +1298,15 @@ discard block |
||
1298 | 1298 | foreach ($criteria->getOrderings() as $sort => $order) { |
1299 | 1299 | |
1300 | 1300 | $hasValidAlias = false; |
1301 | - foreach($allAliases as $alias) { |
|
1302 | - if(strpos($sort . '.', $alias . '.') === 0) { |
|
1301 | + foreach ($allAliases as $alias) { |
|
1302 | + if (strpos($sort.'.', $alias.'.') === 0) { |
|
1303 | 1303 | $hasValidAlias = true; |
1304 | 1304 | break; |
1305 | 1305 | } |
1306 | 1306 | } |
1307 | 1307 | |
1308 | - if(!$hasValidAlias) { |
|
1309 | - $sort = $allAliases[0] . '.' . $sort; |
|
1308 | + if ( ! $hasValidAlias) { |
|
1309 | + $sort = $allAliases[0].'.'.$sort; |
|
1310 | 1310 | } |
1311 | 1311 | |
1312 | 1312 | $this->addOrderBy($sort, $order); |
@@ -1379,7 +1379,7 @@ discard block |
||
1379 | 1379 | private function _getDQLForSelect() |
1380 | 1380 | { |
1381 | 1381 | $dql = 'SELECT' |
1382 | - . ($this->_dqlParts['distinct']===true ? ' DISTINCT' : '') |
|
1382 | + . ($this->_dqlParts['distinct'] === true ? ' DISTINCT' : '') |
|
1383 | 1383 | . $this->_getReducedDQLQueryPart('select', array('pre' => ' ', 'separator' => ', ')); |
1384 | 1384 | |
1385 | 1385 | $fromParts = $this->getDQLPart('from'); |
@@ -1395,7 +1395,7 @@ discard block |
||
1395 | 1395 | |
1396 | 1396 | if ($from instanceof Expr\From && isset($joinParts[$from->getAlias()])) { |
1397 | 1397 | foreach ($joinParts[$from->getAlias()] as $join) { |
1398 | - $fromClause .= ' ' . ((string) $join); |
|
1398 | + $fromClause .= ' '.((string) $join); |
|
1399 | 1399 | } |
1400 | 1400 | } |
1401 | 1401 |
@@ -18,18 +18,9 @@ |
||
18 | 18 | use Doctrine\DBAL\Platforms\PostgreSqlPlatform; |
19 | 19 | use Doctrine\DBAL\Platforms\SQLAnywherePlatform; |
20 | 20 | use Doctrine\DBAL\Platforms\SQLServerPlatform; |
21 | -use Doctrine\ORM\Query\AST\ArithmeticExpression; |
|
22 | -use Doctrine\ORM\Query\AST\ArithmeticFactor; |
|
23 | -use Doctrine\ORM\Query\AST\ArithmeticTerm; |
|
24 | -use Doctrine\ORM\Query\AST\Literal; |
|
25 | 21 | use Doctrine\ORM\Query\AST\OrderByClause; |
26 | -use Doctrine\ORM\Query\AST\OrderByItem; |
|
27 | 22 | use Doctrine\ORM\Query\AST\PartialObjectExpression; |
28 | -use Doctrine\ORM\Query\AST\PathExpression; |
|
29 | 23 | use Doctrine\ORM\Query\AST\SelectExpression; |
30 | -use Doctrine\ORM\Query\AST\SimpleArithmeticExpression; |
|
31 | -use Doctrine\ORM\Query\Expr\OrderBy; |
|
32 | -use Doctrine\ORM\Query\Expr\Select; |
|
33 | 24 | use Doctrine\ORM\Query\SqlWalker; |
34 | 25 | use Doctrine\ORM\Query\AST\SelectStatement; |
35 | 26 |
@@ -209,8 +209,8 @@ discard block |
||
209 | 209 | $sqlIdentifier = $this->getSQLIdentifier($AST); |
210 | 210 | |
211 | 211 | if ($hasOrderBy) { |
212 | - $orderGroupBy = ' GROUP BY ' . implode(', ', $sqlIdentifier); |
|
213 | - $sqlIdentifier[] = 'MIN(' . $this->walkResultVariable('dctrn_rownum') . ') AS dctrn_minrownum'; |
|
212 | + $orderGroupBy = ' GROUP BY '.implode(', ', $sqlIdentifier); |
|
213 | + $sqlIdentifier[] = 'MIN('.$this->walkResultVariable('dctrn_rownum').') AS dctrn_minrownum'; |
|
214 | 214 | } |
215 | 215 | |
216 | 216 | // Build the counter query |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | ); |
222 | 222 | |
223 | 223 | if ($hasOrderBy) { |
224 | - $sql .= $orderGroupBy . $outerOrderBy; |
|
224 | + $sql .= $orderGroupBy.$outerOrderBy; |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | // Apply the limit and offset. |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | foreach ($orderByPathExpressions as $pathExpression) { |
325 | 325 | $idVar = $pathExpression->identificationVariable; |
326 | 326 | $field = $pathExpression->field; |
327 | - if (!isset($selects[$idVar])) { |
|
327 | + if ( ! isset($selects[$idVar])) { |
|
328 | 328 | $selects[$idVar] = []; |
329 | 329 | } |
330 | 330 | $selects[$idVar][$field] = true; |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | foreach ($AST->selectClause->selectExpressions as $selectExpression) { |
336 | 336 | if ($selectExpression instanceof SelectExpression) { |
337 | 337 | $idVar = $selectExpression->expression; |
338 | - if (!is_string($idVar)) { |
|
338 | + if ( ! is_string($idVar)) { |
|
339 | 339 | continue; |
340 | 340 | } |
341 | 341 | $field = $selectExpression->fieldIdentificationVariable; |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | { |
369 | 369 | // If the sql statement has an order by clause, we need to wrap it in a new select distinct |
370 | 370 | // statement |
371 | - if (! $orderByClause instanceof OrderByClause) { |
|
371 | + if ( ! $orderByClause instanceof OrderByClause) { |
|
372 | 372 | return $sql; |
373 | 373 | } |
374 | 374 | |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | = []; |
405 | 405 | |
406 | 406 | // Generate DQL alias -> SQL table alias mapping |
407 | - foreach(array_keys($this->rsm->aliasMap) as $dqlAlias) { |
|
407 | + foreach (array_keys($this->rsm->aliasMap) as $dqlAlias) { |
|
408 | 408 | $dqlAliasToClassMap[$dqlAlias] = $class = $this->queryComponents[$dqlAlias]['metadata']; |
409 | 409 | $dqlAliasToSqlTableAliasMap[$dqlAlias] = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
410 | 410 | } |
@@ -413,13 +413,13 @@ discard block |
||
413 | 413 | $fieldSearchPattern = '/(?<![a-z0-9_])%s\.%s(?![a-z0-9_])/i'; |
414 | 414 | |
415 | 415 | // Generate search patterns for each field's path expression in the order by clause |
416 | - foreach($this->rsm->fieldMappings as $fieldAlias => $fieldName) { |
|
416 | + foreach ($this->rsm->fieldMappings as $fieldAlias => $fieldName) { |
|
417 | 417 | $dqlAliasForFieldAlias = $this->rsm->columnOwnerMap[$fieldAlias]; |
418 | 418 | $class = $dqlAliasToClassMap[$dqlAliasForFieldAlias]; |
419 | 419 | |
420 | 420 | // If the field is from a joined child table, we won't be ordering |
421 | 421 | // on it. |
422 | - if (!isset($class->fieldMappings[$fieldName])) { |
|
422 | + if ( ! isset($class->fieldMappings[$fieldName])) { |
|
423 | 423 | continue; |
424 | 424 | } |
425 | 425 | |
@@ -438,7 +438,7 @@ discard block |
||
438 | 438 | // Field was declared in a parent class, so we need to get the proper SQL table alias |
439 | 439 | // for the joined parent table. |
440 | 440 | $otherClassMetadata = $this->em->getClassMetadata($fieldMapping['declared']); |
441 | - if (!$otherClassMetadata->isMappedSuperclass) { |
|
441 | + if ( ! $otherClassMetadata->isMappedSuperclass) { |
|
442 | 442 | $sqlTableAliasForFieldAlias = $this->getSQLTableAlias($otherClassMetadata->getTableName(), $dqlAliasForFieldAlias); |
443 | 443 | |
444 | 444 | } |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | $replacements[] = $fieldAlias; |
450 | 450 | } |
451 | 451 | |
452 | - foreach($orderByClause->orderByItems as $orderByItem) { |
|
452 | + foreach ($orderByClause->orderByItems as $orderByItem) { |
|
453 | 453 | // Walk order by item to get string representation of it |
454 | 454 | $orderByItemString = $this->walkOrderByItem($orderByItem); |
455 | 455 | |
@@ -566,7 +566,7 @@ discard block |
||
566 | 566 | */ |
567 | 567 | public function walkPathExpression($pathExpr) |
568 | 568 | { |
569 | - if (!$this->inSubSelect && !$this->platformSupportsRowNumber() && !in_array($pathExpr, $this->orderByPathExpressions)) { |
|
569 | + if ( ! $this->inSubSelect && ! $this->platformSupportsRowNumber() && ! in_array($pathExpr, $this->orderByPathExpressions)) { |
|
570 | 570 | $this->orderByPathExpressions[] = $pathExpr; |
571 | 571 | } |
572 | 572 |
@@ -20,7 +20,6 @@ |
||
20 | 20 | |
21 | 21 | use Doctrine\DBAL\Types\Type; |
22 | 22 | use Doctrine\ORM\Mapping\ClassMetadataInfo; |
23 | -use Doctrine\ORM\ORMException; |
|
24 | 23 | use Doctrine\ORM\Query; |
25 | 24 | use Doctrine\ORM\Query\TreeWalkerAdapter; |
26 | 25 | use Doctrine\ORM\Query\AST\Functions\IdentityFunction; |
@@ -112,7 +112,7 @@ |
||
112 | 112 | |
113 | 113 | $AST->selectClause->selectExpressions[] = new SelectExpression( |
114 | 114 | $this->createSelectExpressionItem($item->expression), |
115 | - '_dctrn_ord' . $this->_aliasCounter++ |
|
115 | + '_dctrn_ord'.$this->_aliasCounter++ |
|
116 | 116 | ); |
117 | 117 | } |
118 | 118 | } |
@@ -3321,7 +3321,7 @@ |
||
3321 | 3321 | /** |
3322 | 3322 | * Verifies if two given entities actually are the same based on identifier comparison |
3323 | 3323 | * |
3324 | - * @param object $entity1 |
|
3324 | + * @param Proxy $entity1 |
|
3325 | 3325 | * @param object $entity2 |
3326 | 3326 | * |
3327 | 3327 | * @return bool |
@@ -26,7 +26,6 @@ discard block |
||
26 | 26 | use Exception; |
27 | 27 | use InvalidArgumentException; |
28 | 28 | use UnexpectedValueException; |
29 | - |
|
30 | 29 | use Doctrine\Common\Collections\ArrayCollection; |
31 | 30 | use Doctrine\Common\Collections\Collection; |
32 | 31 | use Doctrine\Common\NotifyPropertyChanged; |
@@ -34,14 +33,12 @@ discard block |
||
34 | 33 | use Doctrine\Common\Persistence\ObjectManagerAware; |
35 | 34 | use Doctrine\ORM\Mapping\ClassMetadata; |
36 | 35 | use Doctrine\ORM\Proxy\Proxy; |
37 | - |
|
38 | 36 | use Doctrine\ORM\Event\LifecycleEventArgs; |
39 | 37 | use Doctrine\ORM\Event\PreUpdateEventArgs; |
40 | 38 | use Doctrine\ORM\Event\PreFlushEventArgs; |
41 | 39 | use Doctrine\ORM\Event\OnFlushEventArgs; |
42 | 40 | use Doctrine\ORM\Event\PostFlushEventArgs; |
43 | 41 | use Doctrine\ORM\Event\ListenersInvoker; |
44 | - |
|
45 | 42 | use Doctrine\ORM\Cache\Persister\CachedPersister; |
46 | 43 | use Doctrine\ORM\Persisters\Entity\BasicEntityPersister; |
47 | 44 | use Doctrine\ORM\Persisters\Entity\SingleTablePersister; |
@@ -49,7 +46,6 @@ discard block |
||
49 | 46 | use Doctrine\ORM\Persisters\Collection\OneToManyPersister; |
50 | 47 | use Doctrine\ORM\Persisters\Collection\ManyToManyPersister; |
51 | 48 | use Doctrine\ORM\Utility\IdentifierFlattener; |
52 | -use Doctrine\ORM\Cache\AssociationCacheEntry; |
|
53 | 49 | |
54 | 50 | /** |
55 | 51 | * The UnitOfWork is responsible for tracking changes to objects during an |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | $state = $this->getEntityState($entity); |
473 | 473 | |
474 | 474 | if ($state !== self::STATE_MANAGED && $state !== self::STATE_REMOVED) { |
475 | - throw new \InvalidArgumentException("Entity has to be managed or scheduled for removal for single computation " . self::objToStr($entity)); |
|
475 | + throw new \InvalidArgumentException("Entity has to be managed or scheduled for removal for single computation ".self::objToStr($entity)); |
|
476 | 476 | } |
477 | 477 | |
478 | 478 | $class = $this->em->getClassMetadata(get_class($entity)); |
@@ -690,7 +690,7 @@ discard block |
||
690 | 690 | if ($owner === null) { // cloned |
691 | 691 | $actualValue->setOwner($entity, $assoc); |
692 | 692 | } else if ($owner !== $entity) { // no clone, we have to fix |
693 | - if (!$actualValue->isInitialized()) { |
|
693 | + if ( ! $actualValue->isInitialized()) { |
|
694 | 694 | $actualValue->initialize(); // we have to do this otherwise the cols share state |
695 | 695 | } |
696 | 696 | $newValue = clone $actualValue; |
@@ -836,7 +836,7 @@ discard block |
||
836 | 836 | $targetClass = $this->em->getClassMetadata($assoc['targetEntity']); |
837 | 837 | |
838 | 838 | foreach ($unwrappedValue as $key => $entry) { |
839 | - if (! ($entry instanceof $targetClass->name)) { |
|
839 | + if ( ! ($entry instanceof $targetClass->name)) { |
|
840 | 840 | throw ORMInvalidArgumentException::invalidAssociation($targetClass, $assoc, $entry); |
841 | 841 | } |
842 | 842 | |
@@ -1692,7 +1692,7 @@ discard block |
||
1692 | 1692 | throw ORMInvalidArgumentException::detachedEntityCannot($entity, "persisted"); |
1693 | 1693 | |
1694 | 1694 | default: |
1695 | - throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity)); |
|
1695 | + throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity)); |
|
1696 | 1696 | } |
1697 | 1697 | |
1698 | 1698 | $this->cascadePersist($entity, $visited); |
@@ -1762,7 +1762,7 @@ discard block |
||
1762 | 1762 | case self::STATE_DETACHED: |
1763 | 1763 | throw ORMInvalidArgumentException::detachedEntityCannot($entity, "removed"); |
1764 | 1764 | default: |
1765 | - throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity)); |
|
1765 | + throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity)); |
|
1766 | 1766 | } |
1767 | 1767 | |
1768 | 1768 | } |
@@ -1901,7 +1901,7 @@ discard block |
||
1901 | 1901 | */ |
1902 | 1902 | private function ensureVersionMatch(ClassMetadata $class, $entity, $managedCopy) |
1903 | 1903 | { |
1904 | - if (! ($class->isVersioned && $this->isLoaded($managedCopy) && $this->isLoaded($entity))) { |
|
1904 | + if ( ! ($class->isVersioned && $this->isLoaded($managedCopy) && $this->isLoaded($entity))) { |
|
1905 | 1905 | return; |
1906 | 1906 | } |
1907 | 1907 | |
@@ -1926,7 +1926,7 @@ discard block |
||
1926 | 1926 | */ |
1927 | 1927 | private function isLoaded($entity) |
1928 | 1928 | { |
1929 | - return !($entity instanceof Proxy) || $entity->__isInitialized(); |
|
1929 | + return ! ($entity instanceof Proxy) || $entity->__isInitialized(); |
|
1930 | 1930 | } |
1931 | 1931 | |
1932 | 1932 | /** |
@@ -2084,7 +2084,7 @@ discard block |
||
2084 | 2084 | |
2085 | 2085 | $associationMappings = array_filter( |
2086 | 2086 | $class->associationMappings, |
2087 | - function ($assoc) { return $assoc['isCascadeRefresh']; } |
|
2087 | + function($assoc) { return $assoc['isCascadeRefresh']; } |
|
2088 | 2088 | ); |
2089 | 2089 | |
2090 | 2090 | foreach ($associationMappings as $assoc) { |
@@ -2127,7 +2127,7 @@ discard block |
||
2127 | 2127 | |
2128 | 2128 | $associationMappings = array_filter( |
2129 | 2129 | $class->associationMappings, |
2130 | - function ($assoc) { return $assoc['isCascadeDetach']; } |
|
2130 | + function($assoc) { return $assoc['isCascadeDetach']; } |
|
2131 | 2131 | ); |
2132 | 2132 | |
2133 | 2133 | foreach ($associationMappings as $assoc) { |
@@ -2171,7 +2171,7 @@ discard block |
||
2171 | 2171 | |
2172 | 2172 | $associationMappings = array_filter( |
2173 | 2173 | $class->associationMappings, |
2174 | - function ($assoc) { return $assoc['isCascadeMerge']; } |
|
2174 | + function($assoc) { return $assoc['isCascadeMerge']; } |
|
2175 | 2175 | ); |
2176 | 2176 | |
2177 | 2177 | foreach ($associationMappings as $assoc) { |
@@ -2210,7 +2210,7 @@ discard block |
||
2210 | 2210 | |
2211 | 2211 | $associationMappings = array_filter( |
2212 | 2212 | $class->associationMappings, |
2213 | - function ($assoc) { return $assoc['isCascadePersist']; } |
|
2213 | + function($assoc) { return $assoc['isCascadePersist']; } |
|
2214 | 2214 | ); |
2215 | 2215 | |
2216 | 2216 | foreach ($associationMappings as $assoc) { |
@@ -2239,7 +2239,7 @@ discard block |
||
2239 | 2239 | break; |
2240 | 2240 | |
2241 | 2241 | case ($relatedEntities !== null): |
2242 | - if (! $relatedEntities instanceof $assoc['targetEntity']) { |
|
2242 | + if ( ! $relatedEntities instanceof $assoc['targetEntity']) { |
|
2243 | 2243 | throw ORMInvalidArgumentException::invalidAssociation( |
2244 | 2244 | $this->em->getClassMetadata($assoc['targetEntity']), |
2245 | 2245 | $assoc, |
@@ -2270,13 +2270,13 @@ discard block |
||
2270 | 2270 | |
2271 | 2271 | $associationMappings = array_filter( |
2272 | 2272 | $class->associationMappings, |
2273 | - function ($assoc) { return $assoc['isCascadeRemove']; } |
|
2273 | + function($assoc) { return $assoc['isCascadeRemove']; } |
|
2274 | 2274 | ); |
2275 | 2275 | |
2276 | 2276 | $entitiesToCascade = array(); |
2277 | 2277 | |
2278 | 2278 | foreach ($associationMappings as $assoc) { |
2279 | - if ($entity instanceof Proxy && !$entity->__isInitialized__) { |
|
2279 | + if ($entity instanceof Proxy && ! $entity->__isInitialized__) { |
|
2280 | 2280 | $entity->__load(); |
2281 | 2281 | } |
2282 | 2282 | |
@@ -2340,7 +2340,7 @@ discard block |
||
2340 | 2340 | return; |
2341 | 2341 | } |
2342 | 2342 | |
2343 | - if ($entity instanceof Proxy && !$entity->__isInitialized__) { |
|
2343 | + if ($entity instanceof Proxy && ! $entity->__isInitialized__) { |
|
2344 | 2344 | $entity->__load(); |
2345 | 2345 | } |
2346 | 2346 | |
@@ -2355,7 +2355,7 @@ discard block |
||
2355 | 2355 | case LockMode::NONE === $lockMode: |
2356 | 2356 | case LockMode::PESSIMISTIC_READ === $lockMode: |
2357 | 2357 | case LockMode::PESSIMISTIC_WRITE === $lockMode: |
2358 | - if (!$this->em->getConnection()->isTransactionActive()) { |
|
2358 | + if ( ! $this->em->getConnection()->isTransactionActive()) { |
|
2359 | 2359 | throw TransactionRequiredException::transactionRequired(); |
2360 | 2360 | } |
2361 | 2361 | |
@@ -2684,7 +2684,7 @@ discard block |
||
2684 | 2684 | // then we can append this entity for eager loading! |
2685 | 2685 | if ($hints['fetchMode'][$class->name][$field] == ClassMetadata::FETCH_EAGER && |
2686 | 2686 | isset($hints[self::HINT_DEFEREAGERLOAD]) && |
2687 | - !$targetClass->isIdentifierComposite && |
|
2687 | + ! $targetClass->isIdentifierComposite && |
|
2688 | 2688 | $newValue instanceof Proxy && |
2689 | 2689 | $newValue->__isInitialized__ === false) { |
2690 | 2690 | |
@@ -2996,7 +2996,7 @@ discard block |
||
2996 | 2996 | */ |
2997 | 2997 | public function size() |
2998 | 2998 | { |
2999 | - $countArray = array_map(function ($item) { return count($item); }, $this->identityMap); |
|
2999 | + $countArray = array_map(function($item) { return count($item); }, $this->identityMap); |
|
3000 | 3000 | |
3001 | 3001 | return array_sum($countArray); |
3002 | 3002 | } |
@@ -3055,7 +3055,7 @@ discard block |
||
3055 | 3055 | public function getCollectionPersister(array $association) |
3056 | 3056 | { |
3057 | 3057 | $role = isset($association['cache']) |
3058 | - ? $association['sourceEntity'] . '::' . $association['fieldName'] |
|
3058 | + ? $association['sourceEntity'].'::'.$association['fieldName'] |
|
3059 | 3059 | : $association['type']; |
3060 | 3060 | |
3061 | 3061 | if (isset($this->collectionPersisters[$role])) { |
@@ -3226,7 +3226,7 @@ discard block |
||
3226 | 3226 | */ |
3227 | 3227 | private static function objToStr($obj) |
3228 | 3228 | { |
3229 | - return method_exists($obj, '__toString') ? (string)$obj : get_class($obj).'@'.spl_object_hash($obj); |
|
3229 | + return method_exists($obj, '__toString') ? (string) $obj : get_class($obj).'@'.spl_object_hash($obj); |
|
3230 | 3230 | } |
3231 | 3231 | |
3232 | 3232 | /** |
@@ -3369,11 +3369,11 @@ discard block |
||
3369 | 3369 | */ |
3370 | 3370 | private function mergeEntityStateIntoManagedCopy($entity, $managedCopy) |
3371 | 3371 | { |
3372 | - if (! $this->isLoaded($entity)) { |
|
3372 | + if ( ! $this->isLoaded($entity)) { |
|
3373 | 3373 | return; |
3374 | 3374 | } |
3375 | 3375 | |
3376 | - if (! $this->isLoaded($managedCopy)) { |
|
3376 | + if ( ! $this->isLoaded($managedCopy)) { |
|
3377 | 3377 | $managedCopy->__load(); |
3378 | 3378 | } |
3379 | 3379 | |
@@ -3396,7 +3396,7 @@ discard block |
||
3396 | 3396 | if ($other === null) { |
3397 | 3397 | $prop->setValue($managedCopy, null); |
3398 | 3398 | } else { |
3399 | - if ($other instanceof Proxy && !$other->__isInitialized()) { |
|
3399 | + if ($other instanceof Proxy && ! $other->__isInitialized()) { |
|
3400 | 3400 | // do not merge fields marked lazy that have not been fetched. |
3401 | 3401 | continue; |
3402 | 3402 | } |
@@ -3483,7 +3483,7 @@ discard block |
||
3483 | 3483 | */ |
3484 | 3484 | private function clearIdentityMapForEntityName($entityName) |
3485 | 3485 | { |
3486 | - if (! isset($this->identityMap[$entityName])) { |
|
3486 | + if ( ! isset($this->identityMap[$entityName])) { |
|
3487 | 3487 | return; |
3488 | 3488 | } |
3489 | 3489 |
@@ -12,11 +12,11 @@ |
||
12 | 12 | use Entities\Address; |
13 | 13 | use Entities\User; |
14 | 14 | |
15 | -$em = require_once __DIR__ . '/bootstrap.php'; |
|
15 | +$em = require_once __DIR__.'/bootstrap.php'; |
|
16 | 16 | |
17 | 17 | ## PUT YOUR TEST CODE BELOW |
18 | 18 | |
19 | 19 | $user = new User; |
20 | 20 | $address = new Address; |
21 | 21 | |
22 | -echo 'Hello World!' . PHP_EOL; |
|
22 | +echo 'Hello World!'.PHP_EOL; |