@@ -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); |
@@ -648,7 +648,7 @@ discard block |
||
648 | 648 | $class = $this->queryComponents[$dqlAlias]['metadata']; |
649 | 649 | |
650 | 650 | if ($this->useSqlTableAliases) { |
651 | - $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName) . '.'; |
|
651 | + $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName).'.'; |
|
652 | 652 | } |
653 | 653 | |
654 | 654 | $sql .= $this->quoteStrategy->getColumnName($fieldName, $class, $this->platform); |
@@ -677,7 +677,7 @@ discard block |
||
677 | 677 | } |
678 | 678 | |
679 | 679 | if ($this->useSqlTableAliases) { |
680 | - $sql .= $this->getSQLTableAlias($class->getTableName(), $dqlAlias) . '.'; |
|
680 | + $sql .= $this->getSQLTableAlias($class->getTableName(), $dqlAlias).'.'; |
|
681 | 681 | } |
682 | 682 | |
683 | 683 | $sql .= reset($assoc['targetToSourceKeyColumns']); |
@@ -695,7 +695,7 @@ discard block |
||
695 | 695 | */ |
696 | 696 | public function walkSelectClause($selectClause) |
697 | 697 | { |
698 | - $sql = 'SELECT ' . (($selectClause->isDistinct) ? 'DISTINCT ' : ''); |
|
698 | + $sql = 'SELECT '.(($selectClause->isDistinct) ? 'DISTINCT ' : ''); |
|
699 | 699 | $sqlSelectExpressions = array_filter(array_map(array($this, 'walkSelectExpression'), $selectClause->selectExpressions)); |
700 | 700 | |
701 | 701 | if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && $selectClause->isDistinct) { |
@@ -732,7 +732,7 @@ discard block |
||
732 | 732 | $discrColumn = $rootClass->discriminatorColumn; |
733 | 733 | $columnAlias = $this->getSQLColumnAlias($discrColumn['name']); |
734 | 734 | |
735 | - $sqlSelectExpressions[] = $tblAlias . '.' . $discrColumn['name'] . ' AS ' . $columnAlias; |
|
735 | + $sqlSelectExpressions[] = $tblAlias.'.'.$discrColumn['name'].' AS '.$columnAlias; |
|
736 | 736 | |
737 | 737 | $this->rsm->setDiscriminatorColumn($dqlAlias, $columnAlias); |
738 | 738 | $this->rsm->addMetaResult($dqlAlias, $columnAlias, $discrColumn['fieldName']); |
@@ -747,7 +747,7 @@ discard block |
||
747 | 747 | foreach ($class->associationMappings as $assoc) { |
748 | 748 | if ( ! ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE)) { |
749 | 749 | continue; |
750 | - } else if ( !$addMetaColumns && !isset($assoc['id'])) { |
|
750 | + } else if ( ! $addMetaColumns && ! isset($assoc['id'])) { |
|
751 | 751 | continue; |
752 | 752 | } |
753 | 753 | |
@@ -761,7 +761,7 @@ discard block |
||
761 | 761 | |
762 | 762 | $type = null; |
763 | 763 | $isIdentifier = (isset($assoc['id']) && $assoc['id'] === true); |
764 | - $sqlSelectExpressions[] = $sqlTableAlias . '.' . $srcColumn . ' AS ' . $columnAlias; |
|
764 | + $sqlSelectExpressions[] = $sqlTableAlias.'.'.$srcColumn.' AS '.$columnAlias; |
|
765 | 765 | |
766 | 766 | if (isset($targetClass->fieldNames[$targetColumn])) { |
767 | 767 | $type = $targetClass->fieldMappings[$targetClass->fieldNames[$targetColumn]]['type']; |
@@ -790,7 +790,7 @@ discard block |
||
790 | 790 | foreach ($assoc['targetToSourceKeyColumns'] as $srcColumn) { |
791 | 791 | $columnAlias = $this->getSQLColumnAlias($srcColumn); |
792 | 792 | |
793 | - $sqlSelectExpressions[] = $sqlTableAlias . '.' . $srcColumn . ' AS ' . $columnAlias; |
|
793 | + $sqlSelectExpressions[] = $sqlTableAlias.'.'.$srcColumn.' AS '.$columnAlias; |
|
794 | 794 | |
795 | 795 | $this->rsm->addMetaResult($dqlAlias, $columnAlias, $srcColumn); |
796 | 796 | } |
@@ -815,7 +815,7 @@ discard block |
||
815 | 815 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($identificationVariableDecl); |
816 | 816 | } |
817 | 817 | |
818 | - return ' FROM ' . implode(', ', $sqlParts); |
|
818 | + return ' FROM '.implode(', ', $sqlParts); |
|
819 | 819 | } |
820 | 820 | |
821 | 821 | /** |
@@ -892,7 +892,7 @@ discard block |
||
892 | 892 | } |
893 | 893 | |
894 | 894 | $sql = $this->platform->appendLockHint( |
895 | - $this->quoteStrategy->getTableName($class, $this->platform) . ' ' . |
|
895 | + $this->quoteStrategy->getTableName($class, $this->platform).' '. |
|
896 | 896 | $this->getSQLTableAlias($class->getTableName(), $dqlAlias), |
897 | 897 | $this->query->getHint(Query::HINT_LOCK_MODE) |
898 | 898 | ); |
@@ -904,10 +904,10 @@ discard block |
||
904 | 904 | $classTableInheritanceJoins = $this->_generateClassTableInheritanceJoins($class, $dqlAlias); |
905 | 905 | |
906 | 906 | if ( ! $buildNestedJoins) { |
907 | - return $sql . $classTableInheritanceJoins; |
|
907 | + return $sql.$classTableInheritanceJoins; |
|
908 | 908 | } |
909 | 909 | |
910 | - return $classTableInheritanceJoins === '' ? $sql : '(' . $sql . $classTableInheritanceJoins . ')'; |
|
910 | + return $classTableInheritanceJoins === '' ? $sql : '('.$sql.$classTableInheritanceJoins.')'; |
|
911 | 911 | } |
912 | 912 | |
913 | 913 | /** |
@@ -932,7 +932,7 @@ discard block |
||
932 | 932 | $relation = $this->queryComponents[$joinedDqlAlias]['relation']; |
933 | 933 | $targetClass = $this->em->getClassMetadata($relation['targetEntity']); |
934 | 934 | $sourceClass = $this->em->getClassMetadata($relation['sourceEntity']); |
935 | - $targetTableName = $this->quoteStrategy->getTableName($targetClass,$this->platform); |
|
935 | + $targetTableName = $this->quoteStrategy->getTableName($targetClass, $this->platform); |
|
936 | 936 | |
937 | 937 | $targetTableAlias = $this->getSQLTableAlias($targetClass->getTableName(), $joinedDqlAlias); |
938 | 938 | $sourceTableAlias = $this->getSQLTableAlias($sourceClass->getTableName(), $associationPathExpression->identificationVariable); |
@@ -940,7 +940,7 @@ discard block |
||
940 | 940 | // Ensure we got the owning side, since it has all mapping info |
941 | 941 | $assoc = ( ! $relation['isOwningSide']) ? $targetClass->associationMappings[$relation['mappedBy']] : $relation; |
942 | 942 | |
943 | - if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && (!$this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
943 | + if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && ( ! $this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
944 | 944 | if ($relation['type'] == ClassMetadata::ONE_TO_MANY || $relation['type'] == ClassMetadata::MANY_TO_MANY) { |
945 | 945 | throw QueryException::iterateWithFetchJoinNotAllowed($assoc); |
946 | 946 | } |
@@ -960,12 +960,12 @@ discard block |
||
960 | 960 | $quotedTargetColumn = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $targetClass, $this->platform); |
961 | 961 | |
962 | 962 | if ($relation['isOwningSide']) { |
963 | - $conditions[] = $sourceTableAlias . '.' . $quotedSourceColumn . ' = ' . $targetTableAlias . '.' . $quotedTargetColumn; |
|
963 | + $conditions[] = $sourceTableAlias.'.'.$quotedSourceColumn.' = '.$targetTableAlias.'.'.$quotedTargetColumn; |
|
964 | 964 | |
965 | 965 | continue; |
966 | 966 | } |
967 | 967 | |
968 | - $conditions[] = $sourceTableAlias . '.' . $quotedTargetColumn . ' = ' . $targetTableAlias . '.' . $quotedSourceColumn; |
|
968 | + $conditions[] = $sourceTableAlias.'.'.$quotedTargetColumn.' = '.$targetTableAlias.'.'.$quotedSourceColumn; |
|
969 | 969 | } |
970 | 970 | |
971 | 971 | // Apply remaining inheritance restrictions |
@@ -983,7 +983,7 @@ discard block |
||
983 | 983 | } |
984 | 984 | |
985 | 985 | $targetTableJoin = array( |
986 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
986 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
987 | 987 | 'condition' => implode(' AND ', $conditions), |
988 | 988 | ); |
989 | 989 | break; |
@@ -1003,10 +1003,10 @@ discard block |
||
1003 | 1003 | $quotedSourceColumn = $this->quoteStrategy->getJoinColumnName($joinColumn, $targetClass, $this->platform); |
1004 | 1004 | $quotedTargetColumn = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $targetClass, $this->platform); |
1005 | 1005 | |
1006 | - $conditions[] = $sourceTableAlias . '.' . $quotedTargetColumn . ' = ' . $joinTableAlias . '.' . $quotedSourceColumn; |
|
1006 | + $conditions[] = $sourceTableAlias.'.'.$quotedTargetColumn.' = '.$joinTableAlias.'.'.$quotedSourceColumn; |
|
1007 | 1007 | } |
1008 | 1008 | |
1009 | - $sql .= $joinTableName . ' ' . $joinTableAlias . ' ON ' . implode(' AND ', $conditions); |
|
1009 | + $sql .= $joinTableName.' '.$joinTableAlias.' ON '.implode(' AND ', $conditions); |
|
1010 | 1010 | |
1011 | 1011 | // Join target table |
1012 | 1012 | $sql .= ($joinType == AST\Join::JOIN_TYPE_LEFT || $joinType == AST\Join::JOIN_TYPE_LEFTOUTER) ? ' LEFT JOIN ' : ' INNER JOIN '; |
@@ -1020,7 +1020,7 @@ discard block |
||
1020 | 1020 | $quotedSourceColumn = $this->quoteStrategy->getJoinColumnName($joinColumn, $targetClass, $this->platform); |
1021 | 1021 | $quotedTargetColumn = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $targetClass, $this->platform); |
1022 | 1022 | |
1023 | - $conditions[] = $targetTableAlias . '.' . $quotedTargetColumn . ' = ' . $joinTableAlias . '.' . $quotedSourceColumn; |
|
1023 | + $conditions[] = $targetTableAlias.'.'.$quotedTargetColumn.' = '.$joinTableAlias.'.'.$quotedSourceColumn; |
|
1024 | 1024 | } |
1025 | 1025 | |
1026 | 1026 | // Apply remaining inheritance restrictions |
@@ -1038,7 +1038,7 @@ discard block |
||
1038 | 1038 | } |
1039 | 1039 | |
1040 | 1040 | $targetTableJoin = array( |
1041 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
1041 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
1042 | 1042 | 'condition' => implode(' AND ', $conditions), |
1043 | 1043 | ); |
1044 | 1044 | break; |
@@ -1048,22 +1048,22 @@ discard block |
||
1048 | 1048 | } |
1049 | 1049 | |
1050 | 1050 | // Handle WITH clause |
1051 | - $withCondition = (null === $condExpr) ? '' : ('(' . $this->walkConditionalExpression($condExpr) . ')'); |
|
1051 | + $withCondition = (null === $condExpr) ? '' : ('('.$this->walkConditionalExpression($condExpr).')'); |
|
1052 | 1052 | |
1053 | 1053 | if ($targetClass->isInheritanceTypeJoined()) { |
1054 | 1054 | $ctiJoins = $this->_generateClassTableInheritanceJoins($targetClass, $joinedDqlAlias); |
1055 | 1055 | // If we have WITH condition, we need to build nested joins for target class table and cti joins |
1056 | 1056 | if ($withCondition) { |
1057 | - $sql .= '(' . $targetTableJoin['table'] . $ctiJoins . ') ON ' . $targetTableJoin['condition']; |
|
1057 | + $sql .= '('.$targetTableJoin['table'].$ctiJoins.') ON '.$targetTableJoin['condition']; |
|
1058 | 1058 | } else { |
1059 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition'] . $ctiJoins; |
|
1059 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition'].$ctiJoins; |
|
1060 | 1060 | } |
1061 | 1061 | } else { |
1062 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition']; |
|
1062 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition']; |
|
1063 | 1063 | } |
1064 | 1064 | |
1065 | 1065 | if ($withCondition) { |
1066 | - $sql .= ' AND ' . $withCondition; |
|
1066 | + $sql .= ' AND '.$withCondition; |
|
1067 | 1067 | } |
1068 | 1068 | |
1069 | 1069 | // Apply the indexes |
@@ -1096,7 +1096,7 @@ discard block |
||
1096 | 1096 | $orderByItems = array_merge($orderByItems, (array) $collectionOrderByItems); |
1097 | 1097 | } |
1098 | 1098 | |
1099 | - return ' ORDER BY ' . implode(', ', $orderByItems); |
|
1099 | + return ' ORDER BY '.implode(', ', $orderByItems); |
|
1100 | 1100 | } |
1101 | 1101 | |
1102 | 1102 | /** |
@@ -1113,10 +1113,10 @@ discard block |
||
1113 | 1113 | $this->orderedColumnsMap[$sql] = $type; |
1114 | 1114 | |
1115 | 1115 | if ($expr instanceof AST\Subselect) { |
1116 | - return '(' . $sql . ') ' . $type; |
|
1116 | + return '('.$sql.') '.$type; |
|
1117 | 1117 | } |
1118 | 1118 | |
1119 | - return $sql . ' ' . $type; |
|
1119 | + return $sql.' '.$type; |
|
1120 | 1120 | } |
1121 | 1121 | |
1122 | 1122 | /** |
@@ -1124,7 +1124,7 @@ discard block |
||
1124 | 1124 | */ |
1125 | 1125 | public function walkHavingClause($havingClause) |
1126 | 1126 | { |
1127 | - return ' HAVING ' . $this->walkConditionalExpression($havingClause->conditionalExpression); |
|
1127 | + return ' HAVING '.$this->walkConditionalExpression($havingClause->conditionalExpression); |
|
1128 | 1128 | } |
1129 | 1129 | |
1130 | 1130 | /** |
@@ -1144,13 +1144,13 @@ discard block |
||
1144 | 1144 | $class = $this->em->getClassMetadata($joinDeclaration->abstractSchemaName); |
1145 | 1145 | $dqlAlias = $joinDeclaration->aliasIdentificationVariable; |
1146 | 1146 | $tableAlias = $this->getSQLTableAlias($class->table['name'], $dqlAlias); |
1147 | - $condition = '(' . $this->walkConditionalExpression($join->conditionalExpression) . ')'; |
|
1147 | + $condition = '('.$this->walkConditionalExpression($join->conditionalExpression).')'; |
|
1148 | 1148 | $isUnconditionalJoin = empty($condition); |
1149 | 1149 | $condExprConjunction = ($class->isInheritanceTypeJoined() && $joinType != AST\Join::JOIN_TYPE_LEFT && $joinType != AST\Join::JOIN_TYPE_LEFTOUTER && $isUnconditionalJoin) |
1150 | 1150 | ? ' AND ' |
1151 | 1151 | : ' ON '; |
1152 | 1152 | |
1153 | - $sql .= $this->generateRangeVariableDeclarationSQL($joinDeclaration, !$isUnconditionalJoin); |
|
1153 | + $sql .= $this->generateRangeVariableDeclarationSQL($joinDeclaration, ! $isUnconditionalJoin); |
|
1154 | 1154 | |
1155 | 1155 | $conditions = array($condition); |
1156 | 1156 | |
@@ -1168,7 +1168,7 @@ discard block |
||
1168 | 1168 | $conditions[] = $filterExpr; |
1169 | 1169 | } |
1170 | 1170 | |
1171 | - $sql .= $condExprConjunction . implode(' AND ', $conditions); |
|
1171 | + $sql .= $condExprConjunction.implode(' AND ', $conditions); |
|
1172 | 1172 | break; |
1173 | 1173 | |
1174 | 1174 | case ($joinDeclaration instanceof AST\JoinAssociationDeclaration): |
@@ -1223,7 +1223,7 @@ discard block |
||
1223 | 1223 | $scalarExpressions[] = $this->walkSimpleArithmeticExpression($scalarExpression); |
1224 | 1224 | } |
1225 | 1225 | |
1226 | - $sql .= implode(', ', $scalarExpressions) . ')'; |
|
1226 | + $sql .= implode(', ', $scalarExpressions).')'; |
|
1227 | 1227 | |
1228 | 1228 | return $sql; |
1229 | 1229 | } |
@@ -1245,7 +1245,7 @@ discard block |
||
1245 | 1245 | ? $this->conn->quote($nullIfExpression->secondExpression) |
1246 | 1246 | : $this->walkSimpleArithmeticExpression($nullIfExpression->secondExpression); |
1247 | 1247 | |
1248 | - return 'NULLIF(' . $firstExpression . ', ' . $secondExpression . ')'; |
|
1248 | + return 'NULLIF('.$firstExpression.', '.$secondExpression.')'; |
|
1249 | 1249 | } |
1250 | 1250 | |
1251 | 1251 | /** |
@@ -1260,11 +1260,11 @@ discard block |
||
1260 | 1260 | $sql = 'CASE'; |
1261 | 1261 | |
1262 | 1262 | foreach ($generalCaseExpression->whenClauses as $whenClause) { |
1263 | - $sql .= ' WHEN ' . $this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
1264 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
1263 | + $sql .= ' WHEN '.$this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
1264 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
1265 | 1265 | } |
1266 | 1266 | |
1267 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression) . ' END'; |
|
1267 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression).' END'; |
|
1268 | 1268 | |
1269 | 1269 | return $sql; |
1270 | 1270 | } |
@@ -1278,14 +1278,14 @@ discard block |
||
1278 | 1278 | */ |
1279 | 1279 | public function walkSimpleCaseExpression($simpleCaseExpression) |
1280 | 1280 | { |
1281 | - $sql = 'CASE ' . $this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
1281 | + $sql = 'CASE '.$this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
1282 | 1282 | |
1283 | 1283 | foreach ($simpleCaseExpression->simpleWhenClauses as $simpleWhenClause) { |
1284 | - $sql .= ' WHEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
1285 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
1284 | + $sql .= ' WHEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
1285 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
1286 | 1286 | } |
1287 | 1287 | |
1288 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression) . ' END'; |
|
1288 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression).' END'; |
|
1289 | 1289 | |
1290 | 1290 | return $sql; |
1291 | 1291 | } |
@@ -1319,7 +1319,7 @@ discard block |
||
1319 | 1319 | $columnName = $this->quoteStrategy->getColumnName($fieldName, $class, $this->platform); |
1320 | 1320 | $columnAlias = $this->getSQLColumnAlias($class->fieldMappings[$fieldName]['columnName']); |
1321 | 1321 | |
1322 | - $col = $sqlTableAlias . '.' . $columnName; |
|
1322 | + $col = $sqlTableAlias.'.'.$columnName; |
|
1323 | 1323 | |
1324 | 1324 | $fieldType = $class->getTypeOfField($fieldName); |
1325 | 1325 | |
@@ -1328,7 +1328,7 @@ discard block |
||
1328 | 1328 | $col = $type->convertToPHPValueSQL($col, $this->conn->getDatabasePlatform()); |
1329 | 1329 | } |
1330 | 1330 | |
1331 | - $sql .= $col . ' AS ' . $columnAlias; |
|
1331 | + $sql .= $col.' AS '.$columnAlias; |
|
1332 | 1332 | |
1333 | 1333 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1334 | 1334 | |
@@ -1352,7 +1352,7 @@ discard block |
||
1352 | 1352 | $columnAlias = $this->getSQLColumnAlias('sclr'); |
1353 | 1353 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1354 | 1354 | |
1355 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
1355 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
1356 | 1356 | |
1357 | 1357 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1358 | 1358 | |
@@ -1366,7 +1366,7 @@ discard block |
||
1366 | 1366 | $columnAlias = $this->getSQLColumnAlias('sclr'); |
1367 | 1367 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1368 | 1368 | |
1369 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
1369 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
1370 | 1370 | |
1371 | 1371 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1372 | 1372 | |
@@ -1377,7 +1377,7 @@ discard block |
||
1377 | 1377 | break; |
1378 | 1378 | |
1379 | 1379 | case ($expr instanceof AST\NewObjectExpression): |
1380 | - $sql .= $this->walkNewObject($expr,$selectExpression->fieldIdentificationVariable); |
|
1380 | + $sql .= $this->walkNewObject($expr, $selectExpression->fieldIdentificationVariable); |
|
1381 | 1381 | break; |
1382 | 1382 | |
1383 | 1383 | default: |
@@ -1418,14 +1418,14 @@ discard block |
||
1418 | 1418 | $columnAlias = $this->getSQLColumnAlias($mapping['columnName']); |
1419 | 1419 | $quotedColumnName = $this->quoteStrategy->getColumnName($fieldName, $class, $this->platform); |
1420 | 1420 | |
1421 | - $col = $sqlTableAlias . '.' . $quotedColumnName; |
|
1421 | + $col = $sqlTableAlias.'.'.$quotedColumnName; |
|
1422 | 1422 | |
1423 | 1423 | if (isset($class->fieldMappings[$fieldName]['requireSQLConversion'])) { |
1424 | 1424 | $type = Type::getType($class->getTypeOfField($fieldName)); |
1425 | 1425 | $col = $type->convertToPHPValueSQL($col, $this->platform); |
1426 | 1426 | } |
1427 | 1427 | |
1428 | - $sqlParts[] = $col . ' AS '. $columnAlias; |
|
1428 | + $sqlParts[] = $col.' AS '.$columnAlias; |
|
1429 | 1429 | |
1430 | 1430 | $this->scalarResultAliasMap[$resultAlias][] = $columnAlias; |
1431 | 1431 | |
@@ -1442,21 +1442,21 @@ discard block |
||
1442 | 1442 | $sqlTableAlias = $this->getSQLTableAlias($subClass->getTableName(), $dqlAlias); |
1443 | 1443 | |
1444 | 1444 | foreach ($subClass->fieldMappings as $fieldName => $mapping) { |
1445 | - if (isset($mapping['inherited']) || $partialFieldSet && !in_array($fieldName, $partialFieldSet)) { |
|
1445 | + if (isset($mapping['inherited']) || $partialFieldSet && ! in_array($fieldName, $partialFieldSet)) { |
|
1446 | 1446 | continue; |
1447 | 1447 | } |
1448 | 1448 | |
1449 | 1449 | $columnAlias = $this->getSQLColumnAlias($mapping['columnName']); |
1450 | 1450 | $quotedColumnName = $this->quoteStrategy->getColumnName($fieldName, $subClass, $this->platform); |
1451 | 1451 | |
1452 | - $col = $sqlTableAlias . '.' . $quotedColumnName; |
|
1452 | + $col = $sqlTableAlias.'.'.$quotedColumnName; |
|
1453 | 1453 | |
1454 | 1454 | if (isset($subClass->fieldMappings[$fieldName]['requireSQLConversion'])) { |
1455 | 1455 | $type = Type::getType($subClass->getTypeOfField($fieldName)); |
1456 | 1456 | $col = $type->convertToPHPValueSQL($col, $this->platform); |
1457 | 1457 | } |
1458 | 1458 | |
1459 | - $sqlParts[] = $col . ' AS ' . $columnAlias; |
|
1459 | + $sqlParts[] = $col.' AS '.$columnAlias; |
|
1460 | 1460 | |
1461 | 1461 | $this->scalarResultAliasMap[$resultAlias][] = $columnAlias; |
1462 | 1462 | |
@@ -1476,7 +1476,7 @@ discard block |
||
1476 | 1476 | */ |
1477 | 1477 | public function walkQuantifiedExpression($qExpr) |
1478 | 1478 | { |
1479 | - return ' ' . strtoupper($qExpr->type) . '(' . $this->walkSubselect($qExpr->subselect) . ')'; |
|
1479 | + return ' '.strtoupper($qExpr->type).'('.$this->walkSubselect($qExpr->subselect).')'; |
|
1480 | 1480 | } |
1481 | 1481 | |
1482 | 1482 | /** |
@@ -1510,13 +1510,13 @@ discard block |
||
1510 | 1510 | public function walkSubselectFromClause($subselectFromClause) |
1511 | 1511 | { |
1512 | 1512 | $identificationVarDecls = $subselectFromClause->identificationVariableDeclarations; |
1513 | - $sqlParts = array (); |
|
1513 | + $sqlParts = array(); |
|
1514 | 1514 | |
1515 | 1515 | foreach ($identificationVarDecls as $subselectIdVarDecl) { |
1516 | 1516 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($subselectIdVarDecl); |
1517 | 1517 | } |
1518 | 1518 | |
1519 | - return ' FROM ' . implode(', ', $sqlParts); |
|
1519 | + return ' FROM '.implode(', ', $sqlParts); |
|
1520 | 1520 | } |
1521 | 1521 | |
1522 | 1522 | /** |
@@ -1524,7 +1524,7 @@ discard block |
||
1524 | 1524 | */ |
1525 | 1525 | public function walkSimpleSelectClause($simpleSelectClause) |
1526 | 1526 | { |
1527 | - return 'SELECT' . ($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
1527 | + return 'SELECT'.($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
1528 | 1528 | . $this->walkSimpleSelectExpression($simpleSelectClause->simpleSelectExpression); |
1529 | 1529 | } |
1530 | 1530 | |
@@ -1543,10 +1543,10 @@ discard block |
||
1543 | 1543 | * |
1544 | 1544 | * @return string The SQL. |
1545 | 1545 | */ |
1546 | - public function walkNewObject($newObjectExpression, $newObjectResultAlias=null) |
|
1546 | + public function walkNewObject($newObjectExpression, $newObjectResultAlias = null) |
|
1547 | 1547 | { |
1548 | 1548 | $sqlSelectExpressions = array(); |
1549 | - $objIndex = $newObjectResultAlias?:$this->newObjectCounter++; |
|
1549 | + $objIndex = $newObjectResultAlias ?: $this->newObjectCounter++; |
|
1550 | 1550 | |
1551 | 1551 | foreach ($newObjectExpression->args as $argIndex => $e) { |
1552 | 1552 | $resultAlias = $this->scalarResultCounter++; |
@@ -1559,7 +1559,7 @@ discard block |
||
1559 | 1559 | break; |
1560 | 1560 | |
1561 | 1561 | case ($e instanceof AST\Subselect): |
1562 | - $sqlSelectExpressions[] = '(' . $e->dispatch($this) . ') AS ' . $columnAlias; |
|
1562 | + $sqlSelectExpressions[] = '('.$e->dispatch($this).') AS '.$columnAlias; |
|
1563 | 1563 | break; |
1564 | 1564 | |
1565 | 1565 | case ($e instanceof AST\PathExpression): |
@@ -1569,7 +1569,7 @@ discard block |
||
1569 | 1569 | $class = $qComp['metadata']; |
1570 | 1570 | $fieldType = $class->getTypeOfField($fieldName); |
1571 | 1571 | |
1572 | - $sqlSelectExpressions[] = trim($e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1572 | + $sqlSelectExpressions[] = trim($e->dispatch($this)).' AS '.$columnAlias; |
|
1573 | 1573 | break; |
1574 | 1574 | |
1575 | 1575 | case ($e instanceof AST\Literal): |
@@ -1583,11 +1583,11 @@ discard block |
||
1583 | 1583 | break; |
1584 | 1584 | } |
1585 | 1585 | |
1586 | - $sqlSelectExpressions[] = trim($e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1586 | + $sqlSelectExpressions[] = trim($e->dispatch($this)).' AS '.$columnAlias; |
|
1587 | 1587 | break; |
1588 | 1588 | |
1589 | 1589 | default: |
1590 | - $sqlSelectExpressions[] = trim($e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1590 | + $sqlSelectExpressions[] = trim($e->dispatch($this)).' AS '.$columnAlias; |
|
1591 | 1591 | break; |
1592 | 1592 | } |
1593 | 1593 | |
@@ -1620,16 +1620,16 @@ discard block |
||
1620 | 1620 | case ($expr instanceof AST\AggregateExpression): |
1621 | 1621 | $alias = $simpleSelectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1622 | 1622 | |
1623 | - $sql .= $this->walkAggregateExpression($expr) . ' AS dctrn__' . $alias; |
|
1623 | + $sql .= $this->walkAggregateExpression($expr).' AS dctrn__'.$alias; |
|
1624 | 1624 | break; |
1625 | 1625 | |
1626 | 1626 | case ($expr instanceof AST\Subselect): |
1627 | 1627 | $alias = $simpleSelectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1628 | 1628 | |
1629 | - $columnAlias = 'sclr' . $this->aliasCounter++; |
|
1629 | + $columnAlias = 'sclr'.$this->aliasCounter++; |
|
1630 | 1630 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
1631 | 1631 | |
1632 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
1632 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
1633 | 1633 | break; |
1634 | 1634 | |
1635 | 1635 | case ($expr instanceof AST\Functions\FunctionNode): |
@@ -1646,7 +1646,7 @@ discard block |
||
1646 | 1646 | $columnAlias = $this->getSQLColumnAlias('sclr'); |
1647 | 1647 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
1648 | 1648 | |
1649 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
1649 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
1650 | 1650 | break; |
1651 | 1651 | |
1652 | 1652 | case ($expr instanceof AST\ParenthesisExpression): |
@@ -1666,8 +1666,8 @@ discard block |
||
1666 | 1666 | */ |
1667 | 1667 | public function walkAggregateExpression($aggExpression) |
1668 | 1668 | { |
1669 | - return $aggExpression->functionName . '(' . ($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
1670 | - . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression) . ')'; |
|
1669 | + return $aggExpression->functionName.'('.($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
1670 | + . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression).')'; |
|
1671 | 1671 | } |
1672 | 1672 | |
1673 | 1673 | /** |
@@ -1681,7 +1681,7 @@ discard block |
||
1681 | 1681 | $sqlParts[] = $this->walkGroupByItem($groupByItem); |
1682 | 1682 | } |
1683 | 1683 | |
1684 | - return ' GROUP BY ' . implode(', ', $sqlParts); |
|
1684 | + return ' GROUP BY '.implode(', ', $sqlParts); |
|
1685 | 1685 | } |
1686 | 1686 | |
1687 | 1687 | /** |
@@ -1738,7 +1738,7 @@ discard block |
||
1738 | 1738 | { |
1739 | 1739 | $class = $this->em->getClassMetadata($deleteClause->abstractSchemaName); |
1740 | 1740 | $tableName = $class->getTableName(); |
1741 | - $sql = 'DELETE FROM ' . $this->quoteStrategy->getTableName($class, $this->platform); |
|
1741 | + $sql = 'DELETE FROM '.$this->quoteStrategy->getTableName($class, $this->platform); |
|
1742 | 1742 | |
1743 | 1743 | $this->setSQLTableAlias($tableName, $tableName, $deleteClause->aliasIdentificationVariable); |
1744 | 1744 | $this->rootAliases[] = $deleteClause->aliasIdentificationVariable; |
@@ -1753,12 +1753,12 @@ discard block |
||
1753 | 1753 | { |
1754 | 1754 | $class = $this->em->getClassMetadata($updateClause->abstractSchemaName); |
1755 | 1755 | $tableName = $class->getTableName(); |
1756 | - $sql = 'UPDATE ' . $this->quoteStrategy->getTableName($class, $this->platform); |
|
1756 | + $sql = 'UPDATE '.$this->quoteStrategy->getTableName($class, $this->platform); |
|
1757 | 1757 | |
1758 | 1758 | $this->setSQLTableAlias($tableName, $tableName, $updateClause->aliasIdentificationVariable); |
1759 | 1759 | $this->rootAliases[] = $updateClause->aliasIdentificationVariable; |
1760 | 1760 | |
1761 | - $sql .= ' SET ' . implode(', ', array_map(array($this, 'walkUpdateItem'), $updateClause->updateItems)); |
|
1761 | + $sql .= ' SET '.implode(', ', array_map(array($this, 'walkUpdateItem'), $updateClause->updateItems)); |
|
1762 | 1762 | |
1763 | 1763 | return $sql; |
1764 | 1764 | } |
@@ -1771,7 +1771,7 @@ discard block |
||
1771 | 1771 | $useTableAliasesBefore = $this->useSqlTableAliases; |
1772 | 1772 | $this->useSqlTableAliases = false; |
1773 | 1773 | |
1774 | - $sql = $this->walkPathExpression($updateItem->pathExpression) . ' = '; |
|
1774 | + $sql = $this->walkPathExpression($updateItem->pathExpression).' = '; |
|
1775 | 1775 | $newValue = $updateItem->newValue; |
1776 | 1776 | |
1777 | 1777 | switch (true) { |
@@ -1814,7 +1814,7 @@ discard block |
||
1814 | 1814 | |
1815 | 1815 | if (count($filterClauses)) { |
1816 | 1816 | if ($condSql) { |
1817 | - $condSql = '(' . $condSql . ') AND '; |
|
1817 | + $condSql = '('.$condSql.') AND '; |
|
1818 | 1818 | } |
1819 | 1819 | |
1820 | 1820 | $condSql .= implode(' AND ', $filterClauses); |
@@ -1822,11 +1822,11 @@ discard block |
||
1822 | 1822 | } |
1823 | 1823 | |
1824 | 1824 | if ($condSql) { |
1825 | - return ' WHERE ' . (( ! $discrSql) ? $condSql : '(' . $condSql . ') AND ' . $discrSql); |
|
1825 | + return ' WHERE '.(( ! $discrSql) ? $condSql : '('.$condSql.') AND '.$discrSql); |
|
1826 | 1826 | } |
1827 | 1827 | |
1828 | 1828 | if ($discrSql) { |
1829 | - return ' WHERE ' . $discrSql; |
|
1829 | + return ' WHERE '.$discrSql; |
|
1830 | 1830 | } |
1831 | 1831 | |
1832 | 1832 | return ''; |
@@ -1869,7 +1869,7 @@ discard block |
||
1869 | 1869 | // if only one ConditionalPrimary is defined |
1870 | 1870 | return ( ! ($factor instanceof AST\ConditionalFactor)) |
1871 | 1871 | ? $this->walkConditionalPrimary($factor) |
1872 | - : ($factor->not ? 'NOT ' : '') . $this->walkConditionalPrimary($factor->conditionalPrimary); |
|
1872 | + : ($factor->not ? 'NOT ' : '').$this->walkConditionalPrimary($factor->conditionalPrimary); |
|
1873 | 1873 | } |
1874 | 1874 | |
1875 | 1875 | /** |
@@ -1884,7 +1884,7 @@ discard block |
||
1884 | 1884 | if ($primary->isConditionalExpression()) { |
1885 | 1885 | $condExpr = $primary->conditionalExpression; |
1886 | 1886 | |
1887 | - return '(' . $this->walkConditionalExpression($condExpr) . ')'; |
|
1887 | + return '('.$this->walkConditionalExpression($condExpr).')'; |
|
1888 | 1888 | } |
1889 | 1889 | } |
1890 | 1890 | |
@@ -1895,7 +1895,7 @@ discard block |
||
1895 | 1895 | { |
1896 | 1896 | $sql = ($existsExpr->not) ? 'NOT ' : ''; |
1897 | 1897 | |
1898 | - $sql .= 'EXISTS (' . $this->walkSubselect($existsExpr->subselect) . ')'; |
|
1898 | + $sql .= 'EXISTS ('.$this->walkSubselect($existsExpr->subselect).')'; |
|
1899 | 1899 | |
1900 | 1900 | return $sql; |
1901 | 1901 | } |
@@ -1939,7 +1939,7 @@ discard block |
||
1939 | 1939 | $targetTableAlias = $this->getSQLTableAlias($targetClass->getTableName()); |
1940 | 1940 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
1941 | 1941 | |
1942 | - $sql .= $this->quoteStrategy->getTableName($targetClass, $this->platform) . ' ' . $targetTableAlias . ' WHERE '; |
|
1942 | + $sql .= $this->quoteStrategy->getTableName($targetClass, $this->platform).' '.$targetTableAlias.' WHERE '; |
|
1943 | 1943 | |
1944 | 1944 | $owningAssoc = $targetClass->associationMappings[$assoc['mappedBy']]; |
1945 | 1945 | $sqlParts = array(); |
@@ -1947,7 +1947,7 @@ discard block |
||
1947 | 1947 | foreach ($owningAssoc['targetToSourceKeyColumns'] as $targetColumn => $sourceColumn) { |
1948 | 1948 | $targetColumn = $this->quoteStrategy->getColumnName($class->fieldNames[$targetColumn], $class, $this->platform); |
1949 | 1949 | |
1950 | - $sqlParts[] = $sourceTableAlias . '.' . $targetColumn . ' = ' . $targetTableAlias . '.' . $sourceColumn; |
|
1950 | + $sqlParts[] = $sourceTableAlias.'.'.$targetColumn.' = '.$targetTableAlias.'.'.$sourceColumn; |
|
1951 | 1951 | } |
1952 | 1952 | |
1953 | 1953 | foreach ($this->quoteStrategy->getIdentifierColumnNames($targetClass, $this->platform) as $targetColumnName) { |
@@ -1955,7 +1955,7 @@ discard block |
||
1955 | 1955 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
1956 | 1956 | } |
1957 | 1957 | |
1958 | - $sqlParts[] = $targetTableAlias . '.' . $targetColumnName . ' = ' . $entitySql; |
|
1958 | + $sqlParts[] = $targetTableAlias.'.'.$targetColumnName.' = '.$entitySql; |
|
1959 | 1959 | } |
1960 | 1960 | |
1961 | 1961 | $sql .= implode(' AND ', $sqlParts); |
@@ -1971,8 +1971,8 @@ discard block |
||
1971 | 1971 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
1972 | 1972 | |
1973 | 1973 | // join to target table |
1974 | - $sql .= $this->quoteStrategy->getJoinTableName($owningAssoc, $targetClass, $this->platform) . ' ' . $joinTableAlias |
|
1975 | - . ' INNER JOIN ' . $this->quoteStrategy->getTableName($targetClass, $this->platform) . ' ' . $targetTableAlias . ' ON '; |
|
1974 | + $sql .= $this->quoteStrategy->getJoinTableName($owningAssoc, $targetClass, $this->platform).' '.$joinTableAlias |
|
1975 | + . ' INNER JOIN '.$this->quoteStrategy->getTableName($targetClass, $this->platform).' '.$targetTableAlias.' ON '; |
|
1976 | 1976 | |
1977 | 1977 | // join conditions |
1978 | 1978 | $joinColumns = $assoc['isOwningSide'] ? $joinTable['inverseJoinColumns'] : $joinTable['joinColumns']; |
@@ -1981,7 +1981,7 @@ discard block |
||
1981 | 1981 | foreach ($joinColumns as $joinColumn) { |
1982 | 1982 | $targetColumn = $this->quoteStrategy->getColumnName($targetClass->fieldNames[$joinColumn['referencedColumnName']], $targetClass, $this->platform); |
1983 | 1983 | |
1984 | - $joinSqlParts[] = $joinTableAlias . '.' . $joinColumn['name'] . ' = ' . $targetTableAlias . '.' . $targetColumn; |
|
1984 | + $joinSqlParts[] = $joinTableAlias.'.'.$joinColumn['name'].' = '.$targetTableAlias.'.'.$targetColumn; |
|
1985 | 1985 | } |
1986 | 1986 | |
1987 | 1987 | $sql .= implode(' AND ', $joinSqlParts); |
@@ -1993,7 +1993,7 @@ discard block |
||
1993 | 1993 | foreach ($joinColumns as $joinColumn) { |
1994 | 1994 | $targetColumn = $this->quoteStrategy->getColumnName($class->fieldNames[$joinColumn['referencedColumnName']], $class, $this->platform); |
1995 | 1995 | |
1996 | - $sqlParts[] = $joinTableAlias . '.' . $joinColumn['name'] . ' = ' . $sourceTableAlias . '.' . $targetColumn; |
|
1996 | + $sqlParts[] = $joinTableAlias.'.'.$joinColumn['name'].' = '.$sourceTableAlias.'.'.$targetColumn; |
|
1997 | 1997 | } |
1998 | 1998 | |
1999 | 1999 | foreach ($this->quoteStrategy->getIdentifierColumnNames($targetClass, $this->platform) as $targetColumnName) { |
@@ -2001,13 +2001,13 @@ discard block |
||
2001 | 2001 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
2002 | 2002 | } |
2003 | 2003 | |
2004 | - $sqlParts[] = $targetTableAlias . '.' . $targetColumnName . ' IN (' . $entitySql . ')'; |
|
2004 | + $sqlParts[] = $targetTableAlias.'.'.$targetColumnName.' IN ('.$entitySql.')'; |
|
2005 | 2005 | } |
2006 | 2006 | |
2007 | 2007 | $sql .= implode(' AND ', $sqlParts); |
2008 | 2008 | } |
2009 | 2009 | |
2010 | - return $sql . ')'; |
|
2010 | + return $sql.')'; |
|
2011 | 2011 | } |
2012 | 2012 | |
2013 | 2013 | /** |
@@ -2018,7 +2018,7 @@ discard block |
||
2018 | 2018 | $sizeFunc = new AST\Functions\SizeFunction('size'); |
2019 | 2019 | $sizeFunc->collectionPathExpression = $emptyCollCompExpr->expression; |
2020 | 2020 | |
2021 | - return $sizeFunc->getSql($this) . ($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
2021 | + return $sizeFunc->getSql($this).($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
2022 | 2022 | } |
2023 | 2023 | |
2024 | 2024 | /** |
@@ -2027,19 +2027,19 @@ discard block |
||
2027 | 2027 | public function walkNullComparisonExpression($nullCompExpr) |
2028 | 2028 | { |
2029 | 2029 | $expression = $nullCompExpr->expression; |
2030 | - $comparison = ' IS' . ($nullCompExpr->not ? ' NOT' : '') . ' NULL'; |
|
2030 | + $comparison = ' IS'.($nullCompExpr->not ? ' NOT' : '').' NULL'; |
|
2031 | 2031 | |
2032 | 2032 | // Handle ResultVariable |
2033 | 2033 | if (is_string($expression) && isset($this->queryComponents[$expression]['resultVariable'])) { |
2034 | - return $this->walkResultVariable($expression) . $comparison; |
|
2034 | + return $this->walkResultVariable($expression).$comparison; |
|
2035 | 2035 | } |
2036 | 2036 | |
2037 | 2037 | // Handle InputParameter mapping inclusion to ParserResult |
2038 | 2038 | if ($expression instanceof AST\InputParameter) { |
2039 | - return $this->walkInputParameter($expression) . $comparison; |
|
2039 | + return $this->walkInputParameter($expression).$comparison; |
|
2040 | 2040 | } |
2041 | 2041 | |
2042 | - return $expression->dispatch($this) . $comparison; |
|
2042 | + return $expression->dispatch($this).$comparison; |
|
2043 | 2043 | } |
2044 | 2044 | |
2045 | 2045 | /** |
@@ -2047,7 +2047,7 @@ discard block |
||
2047 | 2047 | */ |
2048 | 2048 | public function walkInExpression($inExpr) |
2049 | 2049 | { |
2050 | - $sql = $this->walkArithmeticExpression($inExpr->expression) . ($inExpr->not ? ' NOT' : '') . ' IN ('; |
|
2050 | + $sql = $this->walkArithmeticExpression($inExpr->expression).($inExpr->not ? ' NOT' : '').' IN ('; |
|
2051 | 2051 | |
2052 | 2052 | $sql .= ($inExpr->subselect) |
2053 | 2053 | ? $this->walkSubselect($inExpr->subselect) |
@@ -2073,10 +2073,10 @@ discard block |
||
2073 | 2073 | } |
2074 | 2074 | |
2075 | 2075 | if ($this->useSqlTableAliases) { |
2076 | - $sql .= $this->getSQLTableAlias($discrClass->getTableName(), $dqlAlias) . '.'; |
|
2076 | + $sql .= $this->getSQLTableAlias($discrClass->getTableName(), $dqlAlias).'.'; |
|
2077 | 2077 | } |
2078 | 2078 | |
2079 | - $sql .= $class->discriminatorColumn['name'] . ($instanceOfExpr->not ? ' NOT IN ' : ' IN '); |
|
2079 | + $sql .= $class->discriminatorColumn['name'].($instanceOfExpr->not ? ' NOT IN ' : ' IN '); |
|
2080 | 2080 | |
2081 | 2081 | $sqlParameterList = array(); |
2082 | 2082 | |
@@ -2106,7 +2106,7 @@ discard block |
||
2106 | 2106 | $sqlParameterList[] = $this->conn->quote($discriminatorValue); |
2107 | 2107 | } |
2108 | 2108 | |
2109 | - $sql .= '(' . implode(', ', $sqlParameterList) . ')'; |
|
2109 | + $sql .= '('.implode(', ', $sqlParameterList).')'; |
|
2110 | 2110 | |
2111 | 2111 | return $sql; |
2112 | 2112 | } |
@@ -2155,8 +2155,8 @@ discard block |
||
2155 | 2155 | $sql .= ' NOT'; |
2156 | 2156 | } |
2157 | 2157 | |
2158 | - $sql .= ' BETWEEN ' . $this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
2159 | - . ' AND ' . $this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
2158 | + $sql .= ' BETWEEN '.$this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
2159 | + . ' AND '.$this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
2160 | 2160 | |
2161 | 2161 | return $sql; |
2162 | 2162 | } |
@@ -2171,7 +2171,7 @@ discard block |
||
2171 | 2171 | ? $this->walkResultVariable($stringExpr) |
2172 | 2172 | : $stringExpr->dispatch($this); |
2173 | 2173 | |
2174 | - $sql = $leftExpr . ($likeExpr->not ? ' NOT' : '') . ' LIKE '; |
|
2174 | + $sql = $leftExpr.($likeExpr->not ? ' NOT' : '').' LIKE '; |
|
2175 | 2175 | |
2176 | 2176 | if ($likeExpr->stringPattern instanceof AST\InputParameter) { |
2177 | 2177 | $sql .= $this->walkInputParameter($likeExpr->stringPattern); |
@@ -2184,7 +2184,7 @@ discard block |
||
2184 | 2184 | } |
2185 | 2185 | |
2186 | 2186 | if ($likeExpr->escapeChar) { |
2187 | - $sql .= ' ESCAPE ' . $this->walkLiteral($likeExpr->escapeChar); |
|
2187 | + $sql .= ' ESCAPE '.$this->walkLiteral($likeExpr->escapeChar); |
|
2188 | 2188 | } |
2189 | 2189 | |
2190 | 2190 | return $sql; |
@@ -2211,7 +2211,7 @@ discard block |
||
2211 | 2211 | ? $leftExpr->dispatch($this) |
2212 | 2212 | : (is_numeric($leftExpr) ? $leftExpr : $this->conn->quote($leftExpr)); |
2213 | 2213 | |
2214 | - $sql .= ' ' . $compExpr->operator . ' '; |
|
2214 | + $sql .= ' '.$compExpr->operator.' '; |
|
2215 | 2215 | |
2216 | 2216 | $sql .= ($rightExpr instanceof AST\Node) |
2217 | 2217 | ? $rightExpr->dispatch($this) |
@@ -2243,7 +2243,7 @@ discard block |
||
2243 | 2243 | { |
2244 | 2244 | return ($arithmeticExpr->isSimpleArithmeticExpression()) |
2245 | 2245 | ? $this->walkSimpleArithmeticExpression($arithmeticExpr->simpleArithmeticExpression) |
2246 | - : '(' . $this->walkSubselect($arithmeticExpr->subselect) . ')'; |
|
2246 | + : '('.$this->walkSubselect($arithmeticExpr->subselect).')'; |
|
2247 | 2247 | } |
2248 | 2248 | |
2249 | 2249 | /** |
@@ -2297,7 +2297,7 @@ discard block |
||
2297 | 2297 | |
2298 | 2298 | $sign = $factor->isNegativeSigned() ? '-' : ($factor->isPositiveSigned() ? '+' : ''); |
2299 | 2299 | |
2300 | - return $sign . $this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
2300 | + return $sign.$this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
2301 | 2301 | } |
2302 | 2302 | |
2303 | 2303 | /** |
@@ -2310,7 +2310,7 @@ discard block |
||
2310 | 2310 | public function walkArithmeticPrimary($primary) |
2311 | 2311 | { |
2312 | 2312 | if ($primary instanceof AST\SimpleArithmeticExpression) { |
2313 | - return '(' . $this->walkSimpleArithmeticExpression($primary) . ')'; |
|
2313 | + return '('.$this->walkSimpleArithmeticExpression($primary).')'; |
|
2314 | 2314 | } |
2315 | 2315 | |
2316 | 2316 | 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; |