@@ -282,7 +282,7 @@ |
||
282 | 282 | /** |
283 | 283 | * Generates a string of currently query |
284 | 284 | * |
285 | - * @param array $query |
|
285 | + * @param string $query |
|
286 | 286 | * @param string $criteria |
287 | 287 | * @param array $orderBy |
288 | 288 | * @param integer $limit |
@@ -41,9 +41,9 @@ discard block |
||
41 | 41 | */ |
42 | 42 | abstract class AbstractEntityPersister implements CachedEntityPersister |
43 | 43 | { |
44 | - /** |
|
45 | - * @var \Doctrine\ORM\UnitOfWork |
|
46 | - */ |
|
44 | + /** |
|
45 | + * @var \Doctrine\ORM\UnitOfWork |
|
46 | + */ |
|
47 | 47 | protected $uow; |
48 | 48 | |
49 | 49 | /** |
@@ -61,9 +61,9 @@ discard block |
||
61 | 61 | */ |
62 | 62 | protected $class; |
63 | 63 | |
64 | - /** |
|
65 | - * @var array |
|
66 | - */ |
|
64 | + /** |
|
65 | + * @var array |
|
66 | + */ |
|
67 | 67 | protected $queuedCache = array(); |
68 | 68 | |
69 | 69 | /** |
@@ -297,7 +297,7 @@ |
||
297 | 297 | ? $this->persister->expandCriteriaParameters($criteria) |
298 | 298 | : $this->persister->expandParameters($criteria); |
299 | 299 | |
300 | - return sha1($query . serialize($params) . serialize($orderBy) . $limit . $offset . $timestamp); |
|
300 | + return sha1($query.serialize($params).serialize($orderBy).$limit.$offset.$timestamp); |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | /** |
@@ -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 |
@@ -70,8 +70,6 @@ |
||
70 | 70 | * Returns a join column name for a property. |
71 | 71 | * |
72 | 72 | * @param string $propertyName A property name. |
73 | - * @param string|null $className The fully-qualified class name. |
|
74 | - * This parameter is omitted from the signature due to BC |
|
75 | 73 | * |
76 | 74 | * @return string A join column name. |
77 | 75 | */ |
@@ -49,7 +49,7 @@ |
||
49 | 49 | /** |
50 | 50 | * Gets the SQL query. |
51 | 51 | * |
52 | - * @return mixed The built SQL query or an array of all SQL queries. |
|
52 | + * @return string The built SQL query or an array of all SQL queries. |
|
53 | 53 | * |
54 | 54 | * @override |
55 | 55 | */ |
@@ -579,7 +579,7 @@ |
||
579 | 579 | * Internal note: Tried to implement Serializable first but that did not work well |
580 | 580 | * with circular references. This solution seems simpler and works well. |
581 | 581 | * |
582 | - * @return array |
|
582 | + * @return string[] |
|
583 | 583 | */ |
584 | 584 | public function __sleep() |
585 | 585 | { |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | */ |
404 | 404 | public function containsKey($key) |
405 | 405 | { |
406 | - if (! $this->initialized && $this->association['fetch'] === ClassMetadata::FETCH_EXTRA_LAZY |
|
406 | + if ( ! $this->initialized && $this->association['fetch'] === ClassMetadata::FETCH_EXTRA_LAZY |
|
407 | 407 | && isset($this->association['indexBy'])) { |
408 | 408 | $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association); |
409 | 409 | |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | && $this->association['fetch'] === ClassMetadata::FETCH_EXTRA_LAZY |
437 | 437 | && isset($this->association['indexBy']) |
438 | 438 | ) { |
439 | - if (!$this->typeClass->isIdentifierComposite && $this->typeClass->isIdentifier($this->association['indexBy'])) { |
|
439 | + if ( ! $this->typeClass->isIdentifierComposite && $this->typeClass->isIdentifier($this->association['indexBy'])) { |
|
440 | 440 | return $this->em->find($this->typeClass->name, $key); |
441 | 441 | } |
442 | 442 |
@@ -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 | */ |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | $this->queryComponents = $treeWalkerChain->getQueryComponents(); |
397 | 397 | } |
398 | 398 | |
399 | - $outputWalkerClass = $this->customOutputWalker ?: __NAMESPACE__ . '\SqlWalker'; |
|
399 | + $outputWalkerClass = $this->customOutputWalker ?: __NAMESPACE__.'\SqlWalker'; |
|
400 | 400 | $outputWalker = new $outputWalkerClass($this->query, $this->parserResult, $this->queryComponents); |
401 | 401 | |
402 | 402 | // Assign an SQL executor to the parser result |
@@ -491,7 +491,7 @@ discard block |
||
491 | 491 | $tokenStr = substr($dql, $token['position'], $length); |
492 | 492 | |
493 | 493 | // Building informative message |
494 | - $message = 'line 0, col ' . $tokenPos . " near '" . $tokenStr . "': Error: " . $message; |
|
494 | + $message = 'line 0, col '.$tokenPos." near '".$tokenStr."': Error: ".$message; |
|
495 | 495 | |
496 | 496 | throw QueryException::semanticalError($message, QueryException::dqlError($this->query->getDQL())); |
497 | 497 | } |
@@ -638,7 +638,7 @@ discard block |
||
638 | 638 | // If the namespace is not given then assumes the first FROM entity namespace |
639 | 639 | if (strpos($className, '\\') === false && ! class_exists($className) && strpos($fromClassName, '\\') !== false) { |
640 | 640 | $namespace = substr($fromClassName, 0, strrpos($fromClassName, '\\')); |
641 | - $fqcn = $namespace . '\\' . $className; |
|
641 | + $fqcn = $namespace.'\\'.$className; |
|
642 | 642 | |
643 | 643 | if (class_exists($fqcn)) { |
644 | 644 | $expression->className = $fqcn; |
@@ -690,13 +690,13 @@ discard block |
||
690 | 690 | } |
691 | 691 | |
692 | 692 | $this->semanticalError( |
693 | - "There is no mapped field named '$field' on class " . $class->name . ".", $deferredItem['token'] |
|
693 | + "There is no mapped field named '$field' on class ".$class->name.".", $deferredItem['token'] |
|
694 | 694 | ); |
695 | 695 | } |
696 | 696 | |
697 | 697 | if (array_intersect($class->identifier, $expr->partialFieldSet) != $class->identifier) { |
698 | 698 | $this->semanticalError( |
699 | - "The partial field selection of class " . $class->name . " must contain the identifier.", |
|
699 | + "The partial field selection of class ".$class->name." must contain the identifier.", |
|
700 | 700 | $deferredItem['token'] |
701 | 701 | ); |
702 | 702 | } |
@@ -767,7 +767,7 @@ discard block |
||
767 | 767 | // Check if field or association exists |
768 | 768 | if ( ! isset($class->associationMappings[$field]) && ! isset($class->fieldMappings[$field])) { |
769 | 769 | $this->semanticalError( |
770 | - 'Class ' . $class->name . ' has no field or association named ' . $field, |
|
770 | + 'Class '.$class->name.' has no field or association named '.$field, |
|
771 | 771 | $deferredItem['token'] |
772 | 772 | ); |
773 | 773 | } |
@@ -807,8 +807,8 @@ discard block |
||
807 | 807 | // Build the error message |
808 | 808 | $semanticalError = 'Invalid PathExpression. '; |
809 | 809 | $semanticalError .= (count($expectedStringTypes) == 1) |
810 | - ? 'Must be a ' . $expectedStringTypes[0] . '.' |
|
811 | - : implode(' or ', $expectedStringTypes) . ' expected.'; |
|
810 | + ? 'Must be a '.$expectedStringTypes[0].'.' |
|
811 | + : implode(' or ', $expectedStringTypes).' expected.'; |
|
812 | 812 | |
813 | 813 | $this->semanticalError($semanticalError, $deferredItem['token']); |
814 | 814 | } |
@@ -981,7 +981,7 @@ discard block |
||
981 | 981 | |
982 | 982 | list($namespaceAlias, $simpleClassName) = explode(':', $this->lexer->token['value']); |
983 | 983 | |
984 | - $schemaName = $this->em->getConfiguration()->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName; |
|
984 | + $schemaName = $this->em->getConfiguration()->getEntityNamespace($namespaceAlias).'\\'.$simpleClassName; |
|
985 | 985 | } |
986 | 986 | |
987 | 987 | return $schemaName; |
@@ -996,7 +996,7 @@ discard block |
||
996 | 996 | */ |
997 | 997 | private function validateAbstractSchemaName($schemaName) |
998 | 998 | { |
999 | - if (! (class_exists($schemaName, true) || interface_exists($schemaName, true))) { |
|
999 | + if ( ! (class_exists($schemaName, true) || interface_exists($schemaName, true))) { |
|
1000 | 1000 | $this->semanticalError("Class '$schemaName' is not defined.", $this->lexer->token); |
1001 | 1001 | } |
1002 | 1002 | } |
@@ -1052,7 +1052,7 @@ discard block |
||
1052 | 1052 | |
1053 | 1053 | if ( ! isset($this->queryComponents[$identVariable])) { |
1054 | 1054 | $this->semanticalError( |
1055 | - 'Identification Variable ' . $identVariable .' used in join path expression but was not defined before.' |
|
1055 | + 'Identification Variable '.$identVariable.' used in join path expression but was not defined before.' |
|
1056 | 1056 | ); |
1057 | 1057 | } |
1058 | 1058 | |
@@ -1066,7 +1066,7 @@ discard block |
||
1066 | 1066 | $class = $qComp['metadata']; |
1067 | 1067 | |
1068 | 1068 | if ( ! $class->hasAssociation($field)) { |
1069 | - $this->semanticalError('Class ' . $class->name . ' has no association named ' . $field); |
|
1069 | + $this->semanticalError('Class '.$class->name.' has no association named '.$field); |
|
1070 | 1070 | } |
1071 | 1071 | |
1072 | 1072 | return new AST\JoinAssociationPathExpression($identVariable, $field); |
@@ -2488,7 +2488,7 @@ discard block |
||
2488 | 2488 | // Peek beyond the matching closing parenthesis ')' |
2489 | 2489 | $peek = $this->peekBeyondClosingParenthesis(); |
2490 | 2490 | |
2491 | - if (in_array($peek['value'], array("=", "<", "<=", "<>", ">", ">=", "!=")) || |
|
2491 | + if (in_array($peek['value'], array("=", "<", "<=", "<>", ">", ">=", "!=")) || |
|
2492 | 2492 | in_array($peek['type'], array(Lexer::T_NOT, Lexer::T_BETWEEN, Lexer::T_LIKE, Lexer::T_IN, Lexer::T_IS, Lexer::T_EXISTS)) || |
2493 | 2493 | $this->isMathOperator($peek)) { |
2494 | 2494 | $condPrimary->simpleConditionalExpression = $this->SimpleConditionalExpression(); |
@@ -2593,7 +2593,7 @@ discard block |
||
2593 | 2593 | return $this->NullComparisonExpression(); |
2594 | 2594 | } |
2595 | 2595 | |
2596 | - if ($token['type'] === Lexer::T_IS && $lookahead['type'] === Lexer::T_EMPTY) { |
|
2596 | + if ($token['type'] === Lexer::T_IS && $lookahead['type'] === Lexer::T_EMPTY) { |
|
2597 | 2597 | return $this->EmptyCollectionComparisonExpression(); |
2598 | 2598 | } |
2599 | 2599 |
@@ -389,7 +389,7 @@ |
||
389 | 389 | /** |
390 | 390 | * Adds a metadata parameter mappings. |
391 | 391 | * |
392 | - * @param mixed $parameter The parameter name in the SQL result set. |
|
392 | + * @param string $parameter The parameter name in the SQL result set. |
|
393 | 393 | * @param string $attribute The metadata attribute. |
394 | 394 | */ |
395 | 395 | public function addMetadataParameterMapping($parameter, $attribute) |
@@ -227,7 +227,9 @@ |
||
227 | 227 | $found = false; |
228 | 228 | |
229 | 229 | foreach (array_merge($this->metaMappings, $this->fieldMappings) as $columnName => $columnFieldName) { |
230 | - if ( ! ($columnFieldName === $fieldName && $this->columnOwnerMap[$columnName] === $alias)) continue; |
|
230 | + if ( ! ($columnFieldName === $fieldName && $this->columnOwnerMap[$columnName] === $alias)) { |
|
231 | + continue; |
|
232 | + } |
|
231 | 233 | |
232 | 234 | $this->addIndexByColumn($alias, $columnName); |
233 | 235 | $found = true; |
@@ -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 | */ |
@@ -289,11 +289,11 @@ discard block |
||
289 | 289 | */ |
290 | 290 | public function getSQLTableAlias($tableName, $dqlAlias = '') |
291 | 291 | { |
292 | - $tableName .= ($dqlAlias) ? '@[' . $dqlAlias . ']' : ''; |
|
292 | + $tableName .= ($dqlAlias) ? '@['.$dqlAlias.']' : ''; |
|
293 | 293 | |
294 | 294 | if ( ! isset($this->tableAliasMap[$tableName])) { |
295 | 295 | $this->tableAliasMap[$tableName] = (preg_match('/[a-z]/i', $tableName[0]) ? strtolower($tableName[0]) : 't') |
296 | - . $this->tableAliasCounter++ . '_'; |
|
296 | + . $this->tableAliasCounter++.'_'; |
|
297 | 297 | } |
298 | 298 | |
299 | 299 | return $this->tableAliasMap[$tableName]; |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | */ |
312 | 312 | public function setSQLTableAlias($tableName, $alias, $dqlAlias = '') |
313 | 313 | { |
314 | - $tableName .= ($dqlAlias) ? '@[' . $dqlAlias . ']' : ''; |
|
314 | + $tableName .= ($dqlAlias) ? '@['.$dqlAlias.']' : ''; |
|
315 | 315 | |
316 | 316 | $this->tableAliasMap[$tableName] = $alias; |
317 | 317 | |
@@ -352,12 +352,12 @@ discard block |
||
352 | 352 | |
353 | 353 | // If this is a joined association we must use left joins to preserve the correct result. |
354 | 354 | $sql .= isset($this->queryComponents[$dqlAlias]['relation']) ? ' LEFT ' : ' INNER '; |
355 | - $sql .= 'JOIN ' . $this->quoteStrategy->getTableName($parentClass, $this->platform) . ' ' . $tableAlias . ' ON '; |
|
355 | + $sql .= 'JOIN '.$this->quoteStrategy->getTableName($parentClass, $this->platform).' '.$tableAlias.' ON '; |
|
356 | 356 | |
357 | 357 | $sqlParts = array(); |
358 | 358 | |
359 | 359 | foreach ($this->quoteStrategy->getIdentifierColumnNames($class, $this->platform) as $columnName) { |
360 | - $sqlParts[] = $baseTableAlias . '.' . $columnName . ' = ' . $tableAlias . '.' . $columnName; |
|
360 | + $sqlParts[] = $baseTableAlias.'.'.$columnName.' = '.$tableAlias.'.'.$columnName; |
|
361 | 361 | } |
362 | 362 | |
363 | 363 | // Add filters on the root class |
@@ -378,12 +378,12 @@ discard block |
||
378 | 378 | $subClass = $this->em->getClassMetadata($subClassName); |
379 | 379 | $tableAlias = $this->getSQLTableAlias($subClass->getTableName(), $dqlAlias); |
380 | 380 | |
381 | - $sql .= ' LEFT JOIN ' . $this->quoteStrategy->getTableName($subClass, $this->platform) . ' ' . $tableAlias . ' ON '; |
|
381 | + $sql .= ' LEFT JOIN '.$this->quoteStrategy->getTableName($subClass, $this->platform).' '.$tableAlias.' ON '; |
|
382 | 382 | |
383 | 383 | $sqlParts = array(); |
384 | 384 | |
385 | 385 | foreach ($this->quoteStrategy->getIdentifierColumnNames($subClass, $this->platform) as $columnName) { |
386 | - $sqlParts[] = $baseTableAlias . '.' . $columnName . ' = ' . $tableAlias . '.' . $columnName; |
|
386 | + $sqlParts[] = $baseTableAlias.'.'.$columnName.' = '.$tableAlias.'.'.$columnName; |
|
387 | 387 | } |
388 | 388 | |
389 | 389 | $sql .= implode(' AND ', $sqlParts); |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | ? $persister->getOwningTable($fieldName) |
416 | 416 | : $qComp['metadata']->getTableName(); |
417 | 417 | |
418 | - $orderedColumn = $this->getSQLTableAlias($tableName, $dqlAlias) . '.' . $columnName; |
|
418 | + $orderedColumn = $this->getSQLTableAlias($tableName, $dqlAlias).'.'.$columnName; |
|
419 | 419 | |
420 | 420 | // OrderByClause should replace an ordered relation. see - DDC-2475 |
421 | 421 | if (isset($this->orderedColumnsMap[$orderedColumn])) { |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | } |
424 | 424 | |
425 | 425 | $this->orderedColumnsMap[$orderedColumn] = $orientation; |
426 | - $orderedColumns[] = $orderedColumn . ' ' . $orientation; |
|
426 | + $orderedColumns[] = $orderedColumn.' '.$orientation; |
|
427 | 427 | } |
428 | 428 | } |
429 | 429 | |
@@ -458,15 +458,15 @@ discard block |
||
458 | 458 | } |
459 | 459 | |
460 | 460 | $sqlTableAlias = ($this->useSqlTableAliases) |
461 | - ? $this->getSQLTableAlias($class->getTableName(), $dqlAlias) . '.' |
|
461 | + ? $this->getSQLTableAlias($class->getTableName(), $dqlAlias).'.' |
|
462 | 462 | : ''; |
463 | 463 | |
464 | - $sqlParts[] = $sqlTableAlias . $class->discriminatorColumn['name'] . ' IN (' . implode(', ', $values) . ')'; |
|
464 | + $sqlParts[] = $sqlTableAlias.$class->discriminatorColumn['name'].' IN ('.implode(', ', $values).')'; |
|
465 | 465 | } |
466 | 466 | |
467 | 467 | $sql = implode(' AND ', $sqlParts); |
468 | 468 | |
469 | - return (count($sqlParts) > 1) ? '(' . $sql . ')' : $sql; |
|
469 | + return (count($sqlParts) > 1) ? '('.$sql.')' : $sql; |
|
470 | 470 | } |
471 | 471 | |
472 | 472 | /** |
@@ -479,11 +479,11 @@ discard block |
||
479 | 479 | */ |
480 | 480 | private function generateFilterConditionSQL(ClassMetadata $targetEntity, $targetTableAlias) |
481 | 481 | { |
482 | - if (!$this->em->hasFilters()) { |
|
482 | + if ( ! $this->em->hasFilters()) { |
|
483 | 483 | return ''; |
484 | 484 | } |
485 | 485 | |
486 | - switch($targetEntity->inheritanceType) { |
|
486 | + switch ($targetEntity->inheritanceType) { |
|
487 | 487 | case ClassMetadata::INHERITANCE_TYPE_NONE: |
488 | 488 | break; |
489 | 489 | case ClassMetadata::INHERITANCE_TYPE_JOINED: |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | $filterClauses = array(); |
508 | 508 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
509 | 509 | if ('' !== $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { |
510 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
510 | + $filterClauses[] = '('.$filterExpr.')'; |
|
511 | 511 | } |
512 | 512 | } |
513 | 513 | |
@@ -539,7 +539,7 @@ discard block |
||
539 | 539 | } |
540 | 540 | |
541 | 541 | if ( ! $AST->orderByClause && ($orderBySql = $this->_generateOrderedCollectionOrderByItems())) { |
542 | - $sql .= ' ORDER BY ' . $orderBySql; |
|
542 | + $sql .= ' ORDER BY '.$orderBySql; |
|
543 | 543 | } |
544 | 544 | |
545 | 545 | if ($limit !== null || $offset !== null) { |
@@ -551,11 +551,11 @@ discard block |
||
551 | 551 | } |
552 | 552 | |
553 | 553 | if ($lockMode === LockMode::PESSIMISTIC_READ) { |
554 | - return $sql . ' ' . $this->platform->getReadLockSQL(); |
|
554 | + return $sql.' '.$this->platform->getReadLockSQL(); |
|
555 | 555 | } |
556 | 556 | |
557 | 557 | if ($lockMode === LockMode::PESSIMISTIC_WRITE) { |
558 | - return $sql . ' ' . $this->platform->getWriteLockSQL(); |
|
558 | + return $sql.' '.$this->platform->getWriteLockSQL(); |
|
559 | 559 | } |
560 | 560 | |
561 | 561 | if ($lockMode !== LockMode::OPTIMISTIC) { |
@@ -610,7 +610,7 @@ discard block |
||
610 | 610 | $sqlParts = array(); |
611 | 611 | |
612 | 612 | foreach ($this->quoteStrategy->getIdentifierColumnNames($class, $this->platform) as $columnName) { |
613 | - $sqlParts[] = $tableAlias . '.' . $columnName; |
|
613 | + $sqlParts[] = $tableAlias.'.'.$columnName; |
|
614 | 614 | } |
615 | 615 | |
616 | 616 | return implode(', ', $sqlParts); |
@@ -652,7 +652,7 @@ discard block |
||
652 | 652 | $class = $this->queryComponents[$dqlAlias]['metadata']; |
653 | 653 | |
654 | 654 | if ($this->useSqlTableAliases) { |
655 | - $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName) . '.'; |
|
655 | + $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName).'.'; |
|
656 | 656 | } |
657 | 657 | |
658 | 658 | $sql .= $this->quoteStrategy->getColumnName($fieldName, $class, $this->platform); |
@@ -681,7 +681,7 @@ discard block |
||
681 | 681 | } |
682 | 682 | |
683 | 683 | if ($this->useSqlTableAliases) { |
684 | - $sql .= $this->getSQLTableAlias($class->getTableName(), $dqlAlias) . '.'; |
|
684 | + $sql .= $this->getSQLTableAlias($class->getTableName(), $dqlAlias).'.'; |
|
685 | 685 | } |
686 | 686 | |
687 | 687 | $sql .= reset($assoc['targetToSourceKeyColumns']); |
@@ -699,7 +699,7 @@ discard block |
||
699 | 699 | */ |
700 | 700 | public function walkSelectClause($selectClause) |
701 | 701 | { |
702 | - $sql = 'SELECT ' . (($selectClause->isDistinct) ? 'DISTINCT ' : ''); |
|
702 | + $sql = 'SELECT '.(($selectClause->isDistinct) ? 'DISTINCT ' : ''); |
|
703 | 703 | $sqlSelectExpressions = array_filter(array_map(array($this, 'walkSelectExpression'), $selectClause->selectExpressions)); |
704 | 704 | |
705 | 705 | if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && $selectClause->isDistinct) { |
@@ -736,7 +736,7 @@ discard block |
||
736 | 736 | $discrColumn = $rootClass->discriminatorColumn; |
737 | 737 | $columnAlias = $this->getSQLColumnAlias($discrColumn['name']); |
738 | 738 | |
739 | - $sqlSelectExpressions[] = $tblAlias . '.' . $discrColumn['name'] . ' AS ' . $columnAlias; |
|
739 | + $sqlSelectExpressions[] = $tblAlias.'.'.$discrColumn['name'].' AS '.$columnAlias; |
|
740 | 740 | |
741 | 741 | $this->rsm->setDiscriminatorColumn($dqlAlias, $columnAlias); |
742 | 742 | $this->rsm->addMetaResult($dqlAlias, $columnAlias, $discrColumn['fieldName'], false, $discrColumn['type']); |
@@ -751,7 +751,7 @@ discard block |
||
751 | 751 | foreach ($class->associationMappings as $assoc) { |
752 | 752 | if ( ! ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE)) { |
753 | 753 | continue; |
754 | - } else if ( !$addMetaColumns && !isset($assoc['id'])) { |
|
754 | + } else if ( ! $addMetaColumns && ! isset($assoc['id'])) { |
|
755 | 755 | continue; |
756 | 756 | } |
757 | 757 | |
@@ -765,7 +765,7 @@ discard block |
||
765 | 765 | $columnAlias = $this->getSQLColumnAlias($columnName); |
766 | 766 | $columnType = PersisterHelper::getTypeOfColumn($joinColumn['referencedColumnName'], $targetClass, $this->em); |
767 | 767 | |
768 | - $sqlSelectExpressions[] = $sqlTableAlias . '.' . $columnName . ' AS ' . $columnAlias; |
|
768 | + $sqlSelectExpressions[] = $sqlTableAlias.'.'.$columnName.' AS '.$columnAlias; |
|
769 | 769 | |
770 | 770 | $this->rsm->addMetaResult($dqlAlias, $columnAlias, $columnName, $isIdentifier, $columnType); |
771 | 771 | } |
@@ -793,7 +793,7 @@ discard block |
||
793 | 793 | $columnAlias = $this->getSQLColumnAlias($columnName); |
794 | 794 | $columnType = PersisterHelper::getTypeOfColumn($joinColumn['referencedColumnName'], $targetClass, $this->em); |
795 | 795 | |
796 | - $sqlSelectExpressions[] = $sqlTableAlias . '.' . $columnName . ' AS ' . $columnAlias; |
|
796 | + $sqlSelectExpressions[] = $sqlTableAlias.'.'.$columnName.' AS '.$columnAlias; |
|
797 | 797 | |
798 | 798 | $this->rsm->addMetaResult($dqlAlias, $columnAlias, $columnName, $subClass->isIdentifier($columnName), $columnType); |
799 | 799 | } |
@@ -819,7 +819,7 @@ discard block |
||
819 | 819 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($identificationVariableDecl); |
820 | 820 | } |
821 | 821 | |
822 | - return ' FROM ' . implode(', ', $sqlParts); |
|
822 | + return ' FROM '.implode(', ', $sqlParts); |
|
823 | 823 | } |
824 | 824 | |
825 | 825 | /** |
@@ -883,7 +883,7 @@ discard block |
||
883 | 883 | } |
884 | 884 | |
885 | 885 | $sql = $this->platform->appendLockHint( |
886 | - $this->quoteStrategy->getTableName($class, $this->platform) . ' ' . |
|
886 | + $this->quoteStrategy->getTableName($class, $this->platform).' '. |
|
887 | 887 | $this->getSQLTableAlias($class->getTableName(), $dqlAlias), |
888 | 888 | $this->query->getHint(Query::HINT_LOCK_MODE) |
889 | 889 | ); |
@@ -925,7 +925,7 @@ discard block |
||
925 | 925 | // Ensure we got the owning side, since it has all mapping info |
926 | 926 | $assoc = ( ! $relation['isOwningSide']) ? $targetClass->associationMappings[$relation['mappedBy']] : $relation; |
927 | 927 | |
928 | - if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && (!$this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
928 | + if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && ( ! $this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
929 | 929 | if ($relation['type'] == ClassMetadata::ONE_TO_MANY || $relation['type'] == ClassMetadata::MANY_TO_MANY) { |
930 | 930 | throw QueryException::iterateWithFetchJoinNotAllowed($assoc); |
931 | 931 | } |
@@ -945,12 +945,12 @@ discard block |
||
945 | 945 | $quotedTargetColumn = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $targetClass, $this->platform); |
946 | 946 | |
947 | 947 | if ($relation['isOwningSide']) { |
948 | - $conditions[] = $sourceTableAlias . '.' . $quotedSourceColumn . ' = ' . $targetTableAlias . '.' . $quotedTargetColumn; |
|
948 | + $conditions[] = $sourceTableAlias.'.'.$quotedSourceColumn.' = '.$targetTableAlias.'.'.$quotedTargetColumn; |
|
949 | 949 | |
950 | 950 | continue; |
951 | 951 | } |
952 | 952 | |
953 | - $conditions[] = $sourceTableAlias . '.' . $quotedTargetColumn . ' = ' . $targetTableAlias . '.' . $quotedSourceColumn; |
|
953 | + $conditions[] = $sourceTableAlias.'.'.$quotedTargetColumn.' = '.$targetTableAlias.'.'.$quotedSourceColumn; |
|
954 | 954 | } |
955 | 955 | |
956 | 956 | // Apply remaining inheritance restrictions |
@@ -968,7 +968,7 @@ discard block |
||
968 | 968 | } |
969 | 969 | |
970 | 970 | $targetTableJoin = array( |
971 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
971 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
972 | 972 | 'condition' => implode(' AND ', $conditions), |
973 | 973 | ); |
974 | 974 | break; |
@@ -988,10 +988,10 @@ discard block |
||
988 | 988 | $quotedSourceColumn = $this->quoteStrategy->getJoinColumnName($joinColumn, $targetClass, $this->platform); |
989 | 989 | $quotedTargetColumn = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $targetClass, $this->platform); |
990 | 990 | |
991 | - $conditions[] = $sourceTableAlias . '.' . $quotedTargetColumn . ' = ' . $joinTableAlias . '.' . $quotedSourceColumn; |
|
991 | + $conditions[] = $sourceTableAlias.'.'.$quotedTargetColumn.' = '.$joinTableAlias.'.'.$quotedSourceColumn; |
|
992 | 992 | } |
993 | 993 | |
994 | - $sql .= $joinTableName . ' ' . $joinTableAlias . ' ON ' . implode(' AND ', $conditions); |
|
994 | + $sql .= $joinTableName.' '.$joinTableAlias.' ON '.implode(' AND ', $conditions); |
|
995 | 995 | |
996 | 996 | // Join target table |
997 | 997 | $sql .= ($joinType == AST\Join::JOIN_TYPE_LEFT || $joinType == AST\Join::JOIN_TYPE_LEFTOUTER) ? ' LEFT JOIN ' : ' INNER JOIN '; |
@@ -1005,7 +1005,7 @@ discard block |
||
1005 | 1005 | $quotedSourceColumn = $this->quoteStrategy->getJoinColumnName($joinColumn, $targetClass, $this->platform); |
1006 | 1006 | $quotedTargetColumn = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $targetClass, $this->platform); |
1007 | 1007 | |
1008 | - $conditions[] = $targetTableAlias . '.' . $quotedTargetColumn . ' = ' . $joinTableAlias . '.' . $quotedSourceColumn; |
|
1008 | + $conditions[] = $targetTableAlias.'.'.$quotedTargetColumn.' = '.$joinTableAlias.'.'.$quotedSourceColumn; |
|
1009 | 1009 | } |
1010 | 1010 | |
1011 | 1011 | // Apply remaining inheritance restrictions |
@@ -1023,7 +1023,7 @@ discard block |
||
1023 | 1023 | } |
1024 | 1024 | |
1025 | 1025 | $targetTableJoin = array( |
1026 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
1026 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
1027 | 1027 | 'condition' => implode(' AND ', $conditions), |
1028 | 1028 | ); |
1029 | 1029 | break; |
@@ -1033,22 +1033,22 @@ discard block |
||
1033 | 1033 | } |
1034 | 1034 | |
1035 | 1035 | // Handle WITH clause |
1036 | - $withCondition = (null === $condExpr) ? '' : ('(' . $this->walkConditionalExpression($condExpr) . ')'); |
|
1036 | + $withCondition = (null === $condExpr) ? '' : ('('.$this->walkConditionalExpression($condExpr).')'); |
|
1037 | 1037 | |
1038 | 1038 | if ($targetClass->isInheritanceTypeJoined()) { |
1039 | 1039 | $ctiJoins = $this->_generateClassTableInheritanceJoins($targetClass, $joinedDqlAlias); |
1040 | 1040 | // If we have WITH condition, we need to build nested joins for target class table and cti joins |
1041 | 1041 | if ($withCondition) { |
1042 | - $sql .= '(' . $targetTableJoin['table'] . $ctiJoins . ') ON ' . $targetTableJoin['condition']; |
|
1042 | + $sql .= '('.$targetTableJoin['table'].$ctiJoins.') ON '.$targetTableJoin['condition']; |
|
1043 | 1043 | } else { |
1044 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition'] . $ctiJoins; |
|
1044 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition'].$ctiJoins; |
|
1045 | 1045 | } |
1046 | 1046 | } else { |
1047 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition']; |
|
1047 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition']; |
|
1048 | 1048 | } |
1049 | 1049 | |
1050 | 1050 | if ($withCondition) { |
1051 | - $sql .= ' AND ' . $withCondition; |
|
1051 | + $sql .= ' AND '.$withCondition; |
|
1052 | 1052 | } |
1053 | 1053 | |
1054 | 1054 | // Apply the indexes |
@@ -1081,7 +1081,7 @@ discard block |
||
1081 | 1081 | $orderByItems = array_merge($orderByItems, (array) $collectionOrderByItems); |
1082 | 1082 | } |
1083 | 1083 | |
1084 | - return ' ORDER BY ' . implode(', ', $orderByItems); |
|
1084 | + return ' ORDER BY '.implode(', ', $orderByItems); |
|
1085 | 1085 | } |
1086 | 1086 | |
1087 | 1087 | /** |
@@ -1098,10 +1098,10 @@ discard block |
||
1098 | 1098 | $this->orderedColumnsMap[$sql] = $type; |
1099 | 1099 | |
1100 | 1100 | if ($expr instanceof AST\Subselect) { |
1101 | - return '(' . $sql . ') ' . $type; |
|
1101 | + return '('.$sql.') '.$type; |
|
1102 | 1102 | } |
1103 | 1103 | |
1104 | - return $sql . ' ' . $type; |
|
1104 | + return $sql.' '.$type; |
|
1105 | 1105 | } |
1106 | 1106 | |
1107 | 1107 | /** |
@@ -1109,7 +1109,7 @@ discard block |
||
1109 | 1109 | */ |
1110 | 1110 | public function walkHavingClause($havingClause) |
1111 | 1111 | { |
1112 | - return ' HAVING ' . $this->walkConditionalExpression($havingClause->conditionalExpression); |
|
1112 | + return ' HAVING '.$this->walkConditionalExpression($havingClause->conditionalExpression); |
|
1113 | 1113 | } |
1114 | 1114 | |
1115 | 1115 | /** |
@@ -1132,7 +1132,7 @@ discard block |
||
1132 | 1132 | $conditions = []; |
1133 | 1133 | |
1134 | 1134 | if ($join->conditionalExpression) { |
1135 | - $conditions[] = '(' . $this->walkConditionalExpression($join->conditionalExpression) . ')'; |
|
1135 | + $conditions[] = '('.$this->walkConditionalExpression($join->conditionalExpression).')'; |
|
1136 | 1136 | } |
1137 | 1137 | |
1138 | 1138 | $condExprConjunction = ($class->isInheritanceTypeJoined() && $joinType != AST\Join::JOIN_TYPE_LEFT && $joinType != AST\Join::JOIN_TYPE_LEFTOUTER) |
@@ -1156,7 +1156,7 @@ discard block |
||
1156 | 1156 | } |
1157 | 1157 | |
1158 | 1158 | if ($conditions) { |
1159 | - $sql .= $condExprConjunction . implode(' AND ', $conditions); |
|
1159 | + $sql .= $condExprConjunction.implode(' AND ', $conditions); |
|
1160 | 1160 | } |
1161 | 1161 | |
1162 | 1162 | break; |
@@ -1213,7 +1213,7 @@ discard block |
||
1213 | 1213 | $scalarExpressions[] = $this->walkSimpleArithmeticExpression($scalarExpression); |
1214 | 1214 | } |
1215 | 1215 | |
1216 | - $sql .= implode(', ', $scalarExpressions) . ')'; |
|
1216 | + $sql .= implode(', ', $scalarExpressions).')'; |
|
1217 | 1217 | |
1218 | 1218 | return $sql; |
1219 | 1219 | } |
@@ -1235,7 +1235,7 @@ discard block |
||
1235 | 1235 | ? $this->conn->quote($nullIfExpression->secondExpression) |
1236 | 1236 | : $this->walkSimpleArithmeticExpression($nullIfExpression->secondExpression); |
1237 | 1237 | |
1238 | - return 'NULLIF(' . $firstExpression . ', ' . $secondExpression . ')'; |
|
1238 | + return 'NULLIF('.$firstExpression.', '.$secondExpression.')'; |
|
1239 | 1239 | } |
1240 | 1240 | |
1241 | 1241 | /** |
@@ -1250,11 +1250,11 @@ discard block |
||
1250 | 1250 | $sql = 'CASE'; |
1251 | 1251 | |
1252 | 1252 | foreach ($generalCaseExpression->whenClauses as $whenClause) { |
1253 | - $sql .= ' WHEN ' . $this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
1254 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
1253 | + $sql .= ' WHEN '.$this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
1254 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
1255 | 1255 | } |
1256 | 1256 | |
1257 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression) . ' END'; |
|
1257 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression).' END'; |
|
1258 | 1258 | |
1259 | 1259 | return $sql; |
1260 | 1260 | } |
@@ -1268,14 +1268,14 @@ discard block |
||
1268 | 1268 | */ |
1269 | 1269 | public function walkSimpleCaseExpression($simpleCaseExpression) |
1270 | 1270 | { |
1271 | - $sql = 'CASE ' . $this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
1271 | + $sql = 'CASE '.$this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
1272 | 1272 | |
1273 | 1273 | foreach ($simpleCaseExpression->simpleWhenClauses as $simpleWhenClause) { |
1274 | - $sql .= ' WHEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
1275 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
1274 | + $sql .= ' WHEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
1275 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
1276 | 1276 | } |
1277 | 1277 | |
1278 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression) . ' END'; |
|
1278 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression).' END'; |
|
1279 | 1279 | |
1280 | 1280 | return $sql; |
1281 | 1281 | } |
@@ -1309,14 +1309,14 @@ discard block |
||
1309 | 1309 | $fieldMapping = $class->fieldMappings[$fieldName]; |
1310 | 1310 | $columnName = $this->quoteStrategy->getColumnName($fieldName, $class, $this->platform); |
1311 | 1311 | $columnAlias = $this->getSQLColumnAlias($fieldMapping['columnName']); |
1312 | - $col = $sqlTableAlias . '.' . $columnName; |
|
1312 | + $col = $sqlTableAlias.'.'.$columnName; |
|
1313 | 1313 | |
1314 | 1314 | if (isset($fieldMapping['requireSQLConversion'])) { |
1315 | 1315 | $type = Type::getType($fieldMapping['type']); |
1316 | 1316 | $col = $type->convertToPHPValueSQL($col, $this->conn->getDatabasePlatform()); |
1317 | 1317 | } |
1318 | 1318 | |
1319 | - $sql .= $col . ' AS ' . $columnAlias; |
|
1319 | + $sql .= $col.' AS '.$columnAlias; |
|
1320 | 1320 | |
1321 | 1321 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1322 | 1322 | |
@@ -1341,7 +1341,7 @@ discard block |
||
1341 | 1341 | $columnAlias = $this->getSQLColumnAlias('sclr'); |
1342 | 1342 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1343 | 1343 | |
1344 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
1344 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
1345 | 1345 | |
1346 | 1346 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1347 | 1347 | |
@@ -1355,7 +1355,7 @@ discard block |
||
1355 | 1355 | $columnAlias = $this->getSQLColumnAlias('sclr'); |
1356 | 1356 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1357 | 1357 | |
1358 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
1358 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
1359 | 1359 | |
1360 | 1360 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1361 | 1361 | |
@@ -1366,7 +1366,7 @@ discard block |
||
1366 | 1366 | break; |
1367 | 1367 | |
1368 | 1368 | case ($expr instanceof AST\NewObjectExpression): |
1369 | - $sql .= $this->walkNewObject($expr,$selectExpression->fieldIdentificationVariable); |
|
1369 | + $sql .= $this->walkNewObject($expr, $selectExpression->fieldIdentificationVariable); |
|
1370 | 1370 | break; |
1371 | 1371 | |
1372 | 1372 | default: |
@@ -1407,14 +1407,14 @@ discard block |
||
1407 | 1407 | $columnAlias = $this->getSQLColumnAlias($mapping['columnName']); |
1408 | 1408 | $quotedColumnName = $this->quoteStrategy->getColumnName($fieldName, $class, $this->platform); |
1409 | 1409 | |
1410 | - $col = $sqlTableAlias . '.' . $quotedColumnName; |
|
1410 | + $col = $sqlTableAlias.'.'.$quotedColumnName; |
|
1411 | 1411 | |
1412 | 1412 | if (isset($mapping['requireSQLConversion'])) { |
1413 | 1413 | $type = Type::getType($mapping['type']); |
1414 | 1414 | $col = $type->convertToPHPValueSQL($col, $this->platform); |
1415 | 1415 | } |
1416 | 1416 | |
1417 | - $sqlParts[] = $col . ' AS '. $columnAlias; |
|
1417 | + $sqlParts[] = $col.' AS '.$columnAlias; |
|
1418 | 1418 | |
1419 | 1419 | $this->scalarResultAliasMap[$resultAlias][] = $columnAlias; |
1420 | 1420 | |
@@ -1431,21 +1431,21 @@ discard block |
||
1431 | 1431 | $sqlTableAlias = $this->getSQLTableAlias($subClass->getTableName(), $dqlAlias); |
1432 | 1432 | |
1433 | 1433 | foreach ($subClass->fieldMappings as $fieldName => $mapping) { |
1434 | - if (isset($mapping['inherited']) || ($partialFieldSet && !in_array($fieldName, $partialFieldSet))) { |
|
1434 | + if (isset($mapping['inherited']) || ($partialFieldSet && ! in_array($fieldName, $partialFieldSet))) { |
|
1435 | 1435 | continue; |
1436 | 1436 | } |
1437 | 1437 | |
1438 | 1438 | $columnAlias = $this->getSQLColumnAlias($mapping['columnName']); |
1439 | 1439 | $quotedColumnName = $this->quoteStrategy->getColumnName($fieldName, $subClass, $this->platform); |
1440 | 1440 | |
1441 | - $col = $sqlTableAlias . '.' . $quotedColumnName; |
|
1441 | + $col = $sqlTableAlias.'.'.$quotedColumnName; |
|
1442 | 1442 | |
1443 | 1443 | if (isset($mapping['requireSQLConversion'])) { |
1444 | 1444 | $type = Type::getType($mapping['type']); |
1445 | 1445 | $col = $type->convertToPHPValueSQL($col, $this->platform); |
1446 | 1446 | } |
1447 | 1447 | |
1448 | - $sqlParts[] = $col . ' AS ' . $columnAlias; |
|
1448 | + $sqlParts[] = $col.' AS '.$columnAlias; |
|
1449 | 1449 | |
1450 | 1450 | $this->scalarResultAliasMap[$resultAlias][] = $columnAlias; |
1451 | 1451 | |
@@ -1465,7 +1465,7 @@ discard block |
||
1465 | 1465 | */ |
1466 | 1466 | public function walkQuantifiedExpression($qExpr) |
1467 | 1467 | { |
1468 | - return ' ' . strtoupper($qExpr->type) . '(' . $this->walkSubselect($qExpr->subselect) . ')'; |
|
1468 | + return ' '.strtoupper($qExpr->type).'('.$this->walkSubselect($qExpr->subselect).')'; |
|
1469 | 1469 | } |
1470 | 1470 | |
1471 | 1471 | /** |
@@ -1499,13 +1499,13 @@ discard block |
||
1499 | 1499 | public function walkSubselectFromClause($subselectFromClause) |
1500 | 1500 | { |
1501 | 1501 | $identificationVarDecls = $subselectFromClause->identificationVariableDeclarations; |
1502 | - $sqlParts = array (); |
|
1502 | + $sqlParts = array(); |
|
1503 | 1503 | |
1504 | 1504 | foreach ($identificationVarDecls as $subselectIdVarDecl) { |
1505 | 1505 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($subselectIdVarDecl); |
1506 | 1506 | } |
1507 | 1507 | |
1508 | - return ' FROM ' . implode(', ', $sqlParts); |
|
1508 | + return ' FROM '.implode(', ', $sqlParts); |
|
1509 | 1509 | } |
1510 | 1510 | |
1511 | 1511 | /** |
@@ -1513,7 +1513,7 @@ discard block |
||
1513 | 1513 | */ |
1514 | 1514 | public function walkSimpleSelectClause($simpleSelectClause) |
1515 | 1515 | { |
1516 | - return 'SELECT' . ($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
1516 | + return 'SELECT'.($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
1517 | 1517 | . $this->walkSimpleSelectExpression($simpleSelectClause->simpleSelectExpression); |
1518 | 1518 | } |
1519 | 1519 | |
@@ -1532,10 +1532,10 @@ discard block |
||
1532 | 1532 | * |
1533 | 1533 | * @return string The SQL. |
1534 | 1534 | */ |
1535 | - public function walkNewObject($newObjectExpression, $newObjectResultAlias=null) |
|
1535 | + public function walkNewObject($newObjectExpression, $newObjectResultAlias = null) |
|
1536 | 1536 | { |
1537 | 1537 | $sqlSelectExpressions = array(); |
1538 | - $objIndex = $newObjectResultAlias?:$this->newObjectCounter++; |
|
1538 | + $objIndex = $newObjectResultAlias ?: $this->newObjectCounter++; |
|
1539 | 1539 | |
1540 | 1540 | foreach ($newObjectExpression->args as $argIndex => $e) { |
1541 | 1541 | $resultAlias = $this->scalarResultCounter++; |
@@ -1548,7 +1548,7 @@ discard block |
||
1548 | 1548 | break; |
1549 | 1549 | |
1550 | 1550 | case ($e instanceof AST\Subselect): |
1551 | - $sqlSelectExpressions[] = '(' . $e->dispatch($this) . ') AS ' . $columnAlias; |
|
1551 | + $sqlSelectExpressions[] = '('.$e->dispatch($this).') AS '.$columnAlias; |
|
1552 | 1552 | break; |
1553 | 1553 | |
1554 | 1554 | case ($e instanceof AST\PathExpression): |
@@ -1557,7 +1557,7 @@ discard block |
||
1557 | 1557 | $class = $qComp['metadata']; |
1558 | 1558 | $fieldType = $class->fieldMappings[$e->field]['type']; |
1559 | 1559 | |
1560 | - $sqlSelectExpressions[] = trim($e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1560 | + $sqlSelectExpressions[] = trim($e->dispatch($this)).' AS '.$columnAlias; |
|
1561 | 1561 | break; |
1562 | 1562 | |
1563 | 1563 | case ($e instanceof AST\Literal): |
@@ -1571,11 +1571,11 @@ discard block |
||
1571 | 1571 | break; |
1572 | 1572 | } |
1573 | 1573 | |
1574 | - $sqlSelectExpressions[] = trim($e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1574 | + $sqlSelectExpressions[] = trim($e->dispatch($this)).' AS '.$columnAlias; |
|
1575 | 1575 | break; |
1576 | 1576 | |
1577 | 1577 | default: |
1578 | - $sqlSelectExpressions[] = trim($e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1578 | + $sqlSelectExpressions[] = trim($e->dispatch($this)).' AS '.$columnAlias; |
|
1579 | 1579 | break; |
1580 | 1580 | } |
1581 | 1581 | |
@@ -1608,16 +1608,16 @@ discard block |
||
1608 | 1608 | case ($expr instanceof AST\AggregateExpression): |
1609 | 1609 | $alias = $simpleSelectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1610 | 1610 | |
1611 | - $sql .= $this->walkAggregateExpression($expr) . ' AS dctrn__' . $alias; |
|
1611 | + $sql .= $this->walkAggregateExpression($expr).' AS dctrn__'.$alias; |
|
1612 | 1612 | break; |
1613 | 1613 | |
1614 | 1614 | case ($expr instanceof AST\Subselect): |
1615 | 1615 | $alias = $simpleSelectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1616 | 1616 | |
1617 | - $columnAlias = 'sclr' . $this->aliasCounter++; |
|
1617 | + $columnAlias = 'sclr'.$this->aliasCounter++; |
|
1618 | 1618 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
1619 | 1619 | |
1620 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
1620 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
1621 | 1621 | break; |
1622 | 1622 | |
1623 | 1623 | case ($expr instanceof AST\Functions\FunctionNode): |
@@ -1634,7 +1634,7 @@ discard block |
||
1634 | 1634 | $columnAlias = $this->getSQLColumnAlias('sclr'); |
1635 | 1635 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
1636 | 1636 | |
1637 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
1637 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
1638 | 1638 | break; |
1639 | 1639 | |
1640 | 1640 | case ($expr instanceof AST\ParenthesisExpression): |
@@ -1654,8 +1654,8 @@ discard block |
||
1654 | 1654 | */ |
1655 | 1655 | public function walkAggregateExpression($aggExpression) |
1656 | 1656 | { |
1657 | - return $aggExpression->functionName . '(' . ($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
1658 | - . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression) . ')'; |
|
1657 | + return $aggExpression->functionName.'('.($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
1658 | + . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression).')'; |
|
1659 | 1659 | } |
1660 | 1660 | |
1661 | 1661 | /** |
@@ -1669,7 +1669,7 @@ discard block |
||
1669 | 1669 | $sqlParts[] = $this->walkGroupByItem($groupByItem); |
1670 | 1670 | } |
1671 | 1671 | |
1672 | - return ' GROUP BY ' . implode(', ', $sqlParts); |
|
1672 | + return ' GROUP BY '.implode(', ', $sqlParts); |
|
1673 | 1673 | } |
1674 | 1674 | |
1675 | 1675 | /** |
@@ -1726,7 +1726,7 @@ discard block |
||
1726 | 1726 | { |
1727 | 1727 | $class = $this->em->getClassMetadata($deleteClause->abstractSchemaName); |
1728 | 1728 | $tableName = $class->getTableName(); |
1729 | - $sql = 'DELETE FROM ' . $this->quoteStrategy->getTableName($class, $this->platform); |
|
1729 | + $sql = 'DELETE FROM '.$this->quoteStrategy->getTableName($class, $this->platform); |
|
1730 | 1730 | |
1731 | 1731 | $this->setSQLTableAlias($tableName, $tableName, $deleteClause->aliasIdentificationVariable); |
1732 | 1732 | $this->rootAliases[] = $deleteClause->aliasIdentificationVariable; |
@@ -1741,12 +1741,12 @@ discard block |
||
1741 | 1741 | { |
1742 | 1742 | $class = $this->em->getClassMetadata($updateClause->abstractSchemaName); |
1743 | 1743 | $tableName = $class->getTableName(); |
1744 | - $sql = 'UPDATE ' . $this->quoteStrategy->getTableName($class, $this->platform); |
|
1744 | + $sql = 'UPDATE '.$this->quoteStrategy->getTableName($class, $this->platform); |
|
1745 | 1745 | |
1746 | 1746 | $this->setSQLTableAlias($tableName, $tableName, $updateClause->aliasIdentificationVariable); |
1747 | 1747 | $this->rootAliases[] = $updateClause->aliasIdentificationVariable; |
1748 | 1748 | |
1749 | - $sql .= ' SET ' . implode(', ', array_map(array($this, 'walkUpdateItem'), $updateClause->updateItems)); |
|
1749 | + $sql .= ' SET '.implode(', ', array_map(array($this, 'walkUpdateItem'), $updateClause->updateItems)); |
|
1750 | 1750 | |
1751 | 1751 | return $sql; |
1752 | 1752 | } |
@@ -1759,7 +1759,7 @@ discard block |
||
1759 | 1759 | $useTableAliasesBefore = $this->useSqlTableAliases; |
1760 | 1760 | $this->useSqlTableAliases = false; |
1761 | 1761 | |
1762 | - $sql = $this->walkPathExpression($updateItem->pathExpression) . ' = '; |
|
1762 | + $sql = $this->walkPathExpression($updateItem->pathExpression).' = '; |
|
1763 | 1763 | $newValue = $updateItem->newValue; |
1764 | 1764 | |
1765 | 1765 | switch (true) { |
@@ -1802,7 +1802,7 @@ discard block |
||
1802 | 1802 | |
1803 | 1803 | if (count($filterClauses)) { |
1804 | 1804 | if ($condSql) { |
1805 | - $condSql = '(' . $condSql . ') AND '; |
|
1805 | + $condSql = '('.$condSql.') AND '; |
|
1806 | 1806 | } |
1807 | 1807 | |
1808 | 1808 | $condSql .= implode(' AND ', $filterClauses); |
@@ -1810,11 +1810,11 @@ discard block |
||
1810 | 1810 | } |
1811 | 1811 | |
1812 | 1812 | if ($condSql) { |
1813 | - return ' WHERE ' . (( ! $discrSql) ? $condSql : '(' . $condSql . ') AND ' . $discrSql); |
|
1813 | + return ' WHERE '.(( ! $discrSql) ? $condSql : '('.$condSql.') AND '.$discrSql); |
|
1814 | 1814 | } |
1815 | 1815 | |
1816 | 1816 | if ($discrSql) { |
1817 | - return ' WHERE ' . $discrSql; |
|
1817 | + return ' WHERE '.$discrSql; |
|
1818 | 1818 | } |
1819 | 1819 | |
1820 | 1820 | return ''; |
@@ -1857,7 +1857,7 @@ discard block |
||
1857 | 1857 | // if only one ConditionalPrimary is defined |
1858 | 1858 | return ( ! ($factor instanceof AST\ConditionalFactor)) |
1859 | 1859 | ? $this->walkConditionalPrimary($factor) |
1860 | - : ($factor->not ? 'NOT ' : '') . $this->walkConditionalPrimary($factor->conditionalPrimary); |
|
1860 | + : ($factor->not ? 'NOT ' : '').$this->walkConditionalPrimary($factor->conditionalPrimary); |
|
1861 | 1861 | } |
1862 | 1862 | |
1863 | 1863 | /** |
@@ -1872,7 +1872,7 @@ discard block |
||
1872 | 1872 | if ($primary->isConditionalExpression()) { |
1873 | 1873 | $condExpr = $primary->conditionalExpression; |
1874 | 1874 | |
1875 | - return '(' . $this->walkConditionalExpression($condExpr) . ')'; |
|
1875 | + return '('.$this->walkConditionalExpression($condExpr).')'; |
|
1876 | 1876 | } |
1877 | 1877 | } |
1878 | 1878 | |
@@ -1883,7 +1883,7 @@ discard block |
||
1883 | 1883 | { |
1884 | 1884 | $sql = ($existsExpr->not) ? 'NOT ' : ''; |
1885 | 1885 | |
1886 | - $sql .= 'EXISTS (' . $this->walkSubselect($existsExpr->subselect) . ')'; |
|
1886 | + $sql .= 'EXISTS ('.$this->walkSubselect($existsExpr->subselect).')'; |
|
1887 | 1887 | |
1888 | 1888 | return $sql; |
1889 | 1889 | } |
@@ -1927,7 +1927,7 @@ discard block |
||
1927 | 1927 | $targetTableAlias = $this->getSQLTableAlias($targetClass->getTableName()); |
1928 | 1928 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
1929 | 1929 | |
1930 | - $sql .= $this->quoteStrategy->getTableName($targetClass, $this->platform) . ' ' . $targetTableAlias . ' WHERE '; |
|
1930 | + $sql .= $this->quoteStrategy->getTableName($targetClass, $this->platform).' '.$targetTableAlias.' WHERE '; |
|
1931 | 1931 | |
1932 | 1932 | $owningAssoc = $targetClass->associationMappings[$assoc['mappedBy']]; |
1933 | 1933 | $sqlParts = array(); |
@@ -1935,7 +1935,7 @@ discard block |
||
1935 | 1935 | foreach ($owningAssoc['targetToSourceKeyColumns'] as $targetColumn => $sourceColumn) { |
1936 | 1936 | $targetColumn = $this->quoteStrategy->getColumnName($class->fieldNames[$targetColumn], $class, $this->platform); |
1937 | 1937 | |
1938 | - $sqlParts[] = $sourceTableAlias . '.' . $targetColumn . ' = ' . $targetTableAlias . '.' . $sourceColumn; |
|
1938 | + $sqlParts[] = $sourceTableAlias.'.'.$targetColumn.' = '.$targetTableAlias.'.'.$sourceColumn; |
|
1939 | 1939 | } |
1940 | 1940 | |
1941 | 1941 | foreach ($this->quoteStrategy->getIdentifierColumnNames($targetClass, $this->platform) as $targetColumnName) { |
@@ -1943,7 +1943,7 @@ discard block |
||
1943 | 1943 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
1944 | 1944 | } |
1945 | 1945 | |
1946 | - $sqlParts[] = $targetTableAlias . '.' . $targetColumnName . ' = ' . $entitySql; |
|
1946 | + $sqlParts[] = $targetTableAlias.'.'.$targetColumnName.' = '.$entitySql; |
|
1947 | 1947 | } |
1948 | 1948 | |
1949 | 1949 | $sql .= implode(' AND ', $sqlParts); |
@@ -1959,8 +1959,8 @@ discard block |
||
1959 | 1959 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
1960 | 1960 | |
1961 | 1961 | // join to target table |
1962 | - $sql .= $this->quoteStrategy->getJoinTableName($owningAssoc, $targetClass, $this->platform) . ' ' . $joinTableAlias |
|
1963 | - . ' INNER JOIN ' . $this->quoteStrategy->getTableName($targetClass, $this->platform) . ' ' . $targetTableAlias . ' ON '; |
|
1962 | + $sql .= $this->quoteStrategy->getJoinTableName($owningAssoc, $targetClass, $this->platform).' '.$joinTableAlias |
|
1963 | + . ' INNER JOIN '.$this->quoteStrategy->getTableName($targetClass, $this->platform).' '.$targetTableAlias.' ON '; |
|
1964 | 1964 | |
1965 | 1965 | // join conditions |
1966 | 1966 | $joinColumns = $assoc['isOwningSide'] ? $joinTable['inverseJoinColumns'] : $joinTable['joinColumns']; |
@@ -1969,7 +1969,7 @@ discard block |
||
1969 | 1969 | foreach ($joinColumns as $joinColumn) { |
1970 | 1970 | $targetColumn = $this->quoteStrategy->getColumnName($targetClass->fieldNames[$joinColumn['referencedColumnName']], $targetClass, $this->platform); |
1971 | 1971 | |
1972 | - $joinSqlParts[] = $joinTableAlias . '.' . $joinColumn['name'] . ' = ' . $targetTableAlias . '.' . $targetColumn; |
|
1972 | + $joinSqlParts[] = $joinTableAlias.'.'.$joinColumn['name'].' = '.$targetTableAlias.'.'.$targetColumn; |
|
1973 | 1973 | } |
1974 | 1974 | |
1975 | 1975 | $sql .= implode(' AND ', $joinSqlParts); |
@@ -1981,7 +1981,7 @@ discard block |
||
1981 | 1981 | foreach ($joinColumns as $joinColumn) { |
1982 | 1982 | $targetColumn = $this->quoteStrategy->getColumnName($class->fieldNames[$joinColumn['referencedColumnName']], $class, $this->platform); |
1983 | 1983 | |
1984 | - $sqlParts[] = $joinTableAlias . '.' . $joinColumn['name'] . ' = ' . $sourceTableAlias . '.' . $targetColumn; |
|
1984 | + $sqlParts[] = $joinTableAlias.'.'.$joinColumn['name'].' = '.$sourceTableAlias.'.'.$targetColumn; |
|
1985 | 1985 | } |
1986 | 1986 | |
1987 | 1987 | foreach ($this->quoteStrategy->getIdentifierColumnNames($targetClass, $this->platform) as $targetColumnName) { |
@@ -1989,13 +1989,13 @@ discard block |
||
1989 | 1989 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
1990 | 1990 | } |
1991 | 1991 | |
1992 | - $sqlParts[] = $targetTableAlias . '.' . $targetColumnName . ' IN (' . $entitySql . ')'; |
|
1992 | + $sqlParts[] = $targetTableAlias.'.'.$targetColumnName.' IN ('.$entitySql.')'; |
|
1993 | 1993 | } |
1994 | 1994 | |
1995 | 1995 | $sql .= implode(' AND ', $sqlParts); |
1996 | 1996 | } |
1997 | 1997 | |
1998 | - return $sql . ')'; |
|
1998 | + return $sql.')'; |
|
1999 | 1999 | } |
2000 | 2000 | |
2001 | 2001 | /** |
@@ -2006,7 +2006,7 @@ discard block |
||
2006 | 2006 | $sizeFunc = new AST\Functions\SizeFunction('size'); |
2007 | 2007 | $sizeFunc->collectionPathExpression = $emptyCollCompExpr->expression; |
2008 | 2008 | |
2009 | - return $sizeFunc->getSql($this) . ($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
2009 | + return $sizeFunc->getSql($this).($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
2010 | 2010 | } |
2011 | 2011 | |
2012 | 2012 | /** |
@@ -2015,19 +2015,19 @@ discard block |
||
2015 | 2015 | public function walkNullComparisonExpression($nullCompExpr) |
2016 | 2016 | { |
2017 | 2017 | $expression = $nullCompExpr->expression; |
2018 | - $comparison = ' IS' . ($nullCompExpr->not ? ' NOT' : '') . ' NULL'; |
|
2018 | + $comparison = ' IS'.($nullCompExpr->not ? ' NOT' : '').' NULL'; |
|
2019 | 2019 | |
2020 | 2020 | // Handle ResultVariable |
2021 | 2021 | if (is_string($expression) && isset($this->queryComponents[$expression]['resultVariable'])) { |
2022 | - return $this->walkResultVariable($expression) . $comparison; |
|
2022 | + return $this->walkResultVariable($expression).$comparison; |
|
2023 | 2023 | } |
2024 | 2024 | |
2025 | 2025 | // Handle InputParameter mapping inclusion to ParserResult |
2026 | 2026 | if ($expression instanceof AST\InputParameter) { |
2027 | - return $this->walkInputParameter($expression) . $comparison; |
|
2027 | + return $this->walkInputParameter($expression).$comparison; |
|
2028 | 2028 | } |
2029 | 2029 | |
2030 | - return $expression->dispatch($this) . $comparison; |
|
2030 | + return $expression->dispatch($this).$comparison; |
|
2031 | 2031 | } |
2032 | 2032 | |
2033 | 2033 | /** |
@@ -2035,7 +2035,7 @@ discard block |
||
2035 | 2035 | */ |
2036 | 2036 | public function walkInExpression($inExpr) |
2037 | 2037 | { |
2038 | - $sql = $this->walkArithmeticExpression($inExpr->expression) . ($inExpr->not ? ' NOT' : '') . ' IN ('; |
|
2038 | + $sql = $this->walkArithmeticExpression($inExpr->expression).($inExpr->not ? ' NOT' : '').' IN ('; |
|
2039 | 2039 | |
2040 | 2040 | $sql .= ($inExpr->subselect) |
2041 | 2041 | ? $this->walkSubselect($inExpr->subselect) |
@@ -2061,10 +2061,10 @@ discard block |
||
2061 | 2061 | } |
2062 | 2062 | |
2063 | 2063 | if ($this->useSqlTableAliases) { |
2064 | - $sql .= $this->getSQLTableAlias($discrClass->getTableName(), $dqlAlias) . '.'; |
|
2064 | + $sql .= $this->getSQLTableAlias($discrClass->getTableName(), $dqlAlias).'.'; |
|
2065 | 2065 | } |
2066 | 2066 | |
2067 | - $sql .= $class->discriminatorColumn['name'] . ($instanceOfExpr->not ? ' NOT IN ' : ' IN '); |
|
2067 | + $sql .= $class->discriminatorColumn['name'].($instanceOfExpr->not ? ' NOT IN ' : ' IN '); |
|
2068 | 2068 | |
2069 | 2069 | $sqlParameterList = array(); |
2070 | 2070 | |
@@ -2094,7 +2094,7 @@ discard block |
||
2094 | 2094 | $sqlParameterList[] = $this->conn->quote($discriminatorValue); |
2095 | 2095 | } |
2096 | 2096 | |
2097 | - $sql .= '(' . implode(', ', $sqlParameterList) . ')'; |
|
2097 | + $sql .= '('.implode(', ', $sqlParameterList).')'; |
|
2098 | 2098 | |
2099 | 2099 | return $sql; |
2100 | 2100 | } |
@@ -2143,8 +2143,8 @@ discard block |
||
2143 | 2143 | $sql .= ' NOT'; |
2144 | 2144 | } |
2145 | 2145 | |
2146 | - $sql .= ' BETWEEN ' . $this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
2147 | - . ' AND ' . $this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
2146 | + $sql .= ' BETWEEN '.$this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
2147 | + . ' AND '.$this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
2148 | 2148 | |
2149 | 2149 | return $sql; |
2150 | 2150 | } |
@@ -2159,7 +2159,7 @@ discard block |
||
2159 | 2159 | ? $this->walkResultVariable($stringExpr) |
2160 | 2160 | : $stringExpr->dispatch($this); |
2161 | 2161 | |
2162 | - $sql = $leftExpr . ($likeExpr->not ? ' NOT' : '') . ' LIKE '; |
|
2162 | + $sql = $leftExpr.($likeExpr->not ? ' NOT' : '').' LIKE '; |
|
2163 | 2163 | |
2164 | 2164 | if ($likeExpr->stringPattern instanceof AST\InputParameter) { |
2165 | 2165 | $sql .= $this->walkInputParameter($likeExpr->stringPattern); |
@@ -2172,7 +2172,7 @@ discard block |
||
2172 | 2172 | } |
2173 | 2173 | |
2174 | 2174 | if ($likeExpr->escapeChar) { |
2175 | - $sql .= ' ESCAPE ' . $this->walkLiteral($likeExpr->escapeChar); |
|
2175 | + $sql .= ' ESCAPE '.$this->walkLiteral($likeExpr->escapeChar); |
|
2176 | 2176 | } |
2177 | 2177 | |
2178 | 2178 | return $sql; |
@@ -2199,7 +2199,7 @@ discard block |
||
2199 | 2199 | ? $leftExpr->dispatch($this) |
2200 | 2200 | : (is_numeric($leftExpr) ? $leftExpr : $this->conn->quote($leftExpr)); |
2201 | 2201 | |
2202 | - $sql .= ' ' . $compExpr->operator . ' '; |
|
2202 | + $sql .= ' '.$compExpr->operator.' '; |
|
2203 | 2203 | |
2204 | 2204 | $sql .= ($rightExpr instanceof AST\Node) |
2205 | 2205 | ? $rightExpr->dispatch($this) |
@@ -2231,7 +2231,7 @@ discard block |
||
2231 | 2231 | { |
2232 | 2232 | return ($arithmeticExpr->isSimpleArithmeticExpression()) |
2233 | 2233 | ? $this->walkSimpleArithmeticExpression($arithmeticExpr->simpleArithmeticExpression) |
2234 | - : '(' . $this->walkSubselect($arithmeticExpr->subselect) . ')'; |
|
2234 | + : '('.$this->walkSubselect($arithmeticExpr->subselect).')'; |
|
2235 | 2235 | } |
2236 | 2236 | |
2237 | 2237 | /** |
@@ -2283,7 +2283,7 @@ discard block |
||
2283 | 2283 | |
2284 | 2284 | $sign = $factor->isNegativeSigned() ? '-' : ($factor->isPositiveSigned() ? '+' : ''); |
2285 | 2285 | |
2286 | - return $sign . $this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
2286 | + return $sign.$this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
2287 | 2287 | } |
2288 | 2288 | |
2289 | 2289 | /** |
@@ -2296,7 +2296,7 @@ discard block |
||
2296 | 2296 | public function walkArithmeticPrimary($primary) |
2297 | 2297 | { |
2298 | 2298 | if ($primary instanceof AST\SimpleArithmeticExpression) { |
2299 | - return '(' . $this->walkSimpleArithmeticExpression($primary) . ')'; |
|
2299 | + return '('.$this->walkSimpleArithmeticExpression($primary).')'; |
|
2300 | 2300 | } |
2301 | 2301 | |
2302 | 2302 | if ($primary instanceof AST\Node) { |
@@ -444,7 +444,9 @@ discard block |
||
444 | 444 | foreach ($dqlAliases as $dqlAlias) { |
445 | 445 | $class = $this->queryComponents[$dqlAlias]['metadata']; |
446 | 446 | |
447 | - if ( ! $class->isInheritanceTypeSingleTable()) continue; |
|
447 | + if ( ! $class->isInheritanceTypeSingleTable()) { |
|
448 | + continue; |
|
449 | + } |
|
448 | 450 | |
449 | 451 | $conn = $this->em->getConnection(); |
450 | 452 | $values = array(); |
@@ -783,7 +785,9 @@ 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 | 792 | if ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE) { |
789 | 793 | $targetClass = $this->em->getClassMetadata($assoc['targetEntity']); |
@@ -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 |
@@ -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 string|null 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 string|null The cache region name; NULL indicates the default region. |
|
219 | + */ |
|
220 | 220 | public function getCacheRegion() |
221 | 221 | { |
222 | 222 | return $this->cacheRegion; |
@@ -1372,10 +1372,10 @@ discard block |
||
1372 | 1372 | */ |
1373 | 1373 | private function _getDQLForDelete() |
1374 | 1374 | { |
1375 | - return 'DELETE' |
|
1376 | - . $this->_getReducedDQLQueryPart('from', array('pre' => ' ', 'separator' => ', ')) |
|
1377 | - . $this->_getReducedDQLQueryPart('where', array('pre' => ' WHERE ')) |
|
1378 | - . $this->_getReducedDQLQueryPart('orderBy', array('pre' => ' ORDER BY ', 'separator' => ', ')); |
|
1375 | + return 'DELETE' |
|
1376 | + . $this->_getReducedDQLQueryPart('from', array('pre' => ' ', 'separator' => ', ')) |
|
1377 | + . $this->_getReducedDQLQueryPart('where', array('pre' => ' WHERE ')) |
|
1378 | + . $this->_getReducedDQLQueryPart('orderBy', array('pre' => ' ORDER BY ', 'separator' => ', ')); |
|
1379 | 1379 | } |
1380 | 1380 | |
1381 | 1381 | /** |
@@ -1383,11 +1383,11 @@ discard block |
||
1383 | 1383 | */ |
1384 | 1384 | private function _getDQLForUpdate() |
1385 | 1385 | { |
1386 | - return 'UPDATE' |
|
1387 | - . $this->_getReducedDQLQueryPart('from', array('pre' => ' ', 'separator' => ', ')) |
|
1388 | - . $this->_getReducedDQLQueryPart('set', array('pre' => ' SET ', 'separator' => ', ')) |
|
1389 | - . $this->_getReducedDQLQueryPart('where', array('pre' => ' WHERE ')) |
|
1390 | - . $this->_getReducedDQLQueryPart('orderBy', array('pre' => ' ORDER BY ', 'separator' => ', ')); |
|
1386 | + return 'UPDATE' |
|
1387 | + . $this->_getReducedDQLQueryPart('from', array('pre' => ' ', 'separator' => ', ')) |
|
1388 | + . $this->_getReducedDQLQueryPart('set', array('pre' => ' SET ', 'separator' => ', ')) |
|
1389 | + . $this->_getReducedDQLQueryPart('where', array('pre' => ' WHERE ')) |
|
1390 | + . $this->_getReducedDQLQueryPart('orderBy', array('pre' => ' ORDER BY ', 'separator' => ', ')); |
|
1391 | 1391 | } |
1392 | 1392 | |
1393 | 1393 | /** |
@@ -1396,8 +1396,8 @@ discard block |
||
1396 | 1396 | private function _getDQLForSelect() |
1397 | 1397 | { |
1398 | 1398 | $dql = 'SELECT' |
1399 | - . ($this->_dqlParts['distinct']===true ? ' DISTINCT' : '') |
|
1400 | - . $this->_getReducedDQLQueryPart('select', array('pre' => ' ', 'separator' => ', ')); |
|
1399 | + . ($this->_dqlParts['distinct']===true ? ' DISTINCT' : '') |
|
1400 | + . $this->_getReducedDQLQueryPart('select', array('pre' => ' ', 'separator' => ', ')); |
|
1401 | 1401 | |
1402 | 1402 | $fromParts = $this->getDQLPart('from'); |
1403 | 1403 | $joinParts = $this->getDQLPart('join'); |
@@ -1421,10 +1421,10 @@ discard block |
||
1421 | 1421 | } |
1422 | 1422 | |
1423 | 1423 | $dql .= implode(', ', $fromClauses) |
1424 | - . $this->_getReducedDQLQueryPart('where', array('pre' => ' WHERE ')) |
|
1425 | - . $this->_getReducedDQLQueryPart('groupBy', array('pre' => ' GROUP BY ', 'separator' => ', ')) |
|
1426 | - . $this->_getReducedDQLQueryPart('having', array('pre' => ' HAVING ')) |
|
1427 | - . $this->_getReducedDQLQueryPart('orderBy', array('pre' => ' ORDER BY ', 'separator' => ', ')); |
|
1424 | + . $this->_getReducedDQLQueryPart('where', array('pre' => ' WHERE ')) |
|
1425 | + . $this->_getReducedDQLQueryPart('groupBy', array('pre' => ' GROUP BY ', 'separator' => ', ')) |
|
1426 | + . $this->_getReducedDQLQueryPart('having', array('pre' => ' HAVING ')) |
|
1427 | + . $this->_getReducedDQLQueryPart('orderBy', array('pre' => ' ORDER BY ', 'separator' => ', ')); |
|
1428 | 1428 | |
1429 | 1429 | return $dql; |
1430 | 1430 | } |
@@ -1444,8 +1444,8 @@ discard block |
||
1444 | 1444 | } |
1445 | 1445 | |
1446 | 1446 | return (isset($options['pre']) ? $options['pre'] : '') |
1447 | - . (is_array($queryPart) ? implode($options['separator'], $queryPart) : $queryPart) |
|
1448 | - . (isset($options['post']) ? $options['post'] : ''); |
|
1447 | + . (is_array($queryPart) ? implode($options['separator'], $queryPart) : $queryPart) |
|
1448 | + . (isset($options['post']) ? $options['post'] : ''); |
|
1449 | 1449 | } |
1450 | 1450 | |
1451 | 1451 | /** |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | /** |
607 | 607 | * Gets a (previously set) query parameter of the query being constructed. |
608 | 608 | * |
609 | - * @param mixed $key The key (index or name) of the bound parameter. |
|
609 | + * @param string $key The key (index or name) of the bound parameter. |
|
610 | 610 | * |
611 | 611 | * @return Query\Parameter|null The value of the bound parameter. |
612 | 612 | */ |
@@ -794,7 +794,7 @@ discard block |
||
794 | 794 | * ->leftJoin('u.Phonenumbers', 'p'); |
795 | 795 | * </code> |
796 | 796 | * |
797 | - * @param mixed $select The selection expression. |
|
797 | + * @param string $select The selection expression. |
|
798 | 798 | * |
799 | 799 | * @return self |
800 | 800 | */ |
@@ -1094,7 +1094,6 @@ discard block |
||
1094 | 1094 | * ->andWhere('u.is_active = 1'); |
1095 | 1095 | * </code> |
1096 | 1096 | * |
1097 | - * @param mixed $where The query restrictions. |
|
1098 | 1097 | * |
1099 | 1098 | * @return self |
1100 | 1099 | * |
@@ -1127,7 +1126,6 @@ discard block |
||
1127 | 1126 | * ->orWhere('u.id = 2'); |
1128 | 1127 | * </code> |
1129 | 1128 | * |
1130 | - * @param mixed $where The WHERE statement. |
|
1131 | 1129 | * |
1132 | 1130 | * @return self |
1133 | 1131 | * |
@@ -1192,7 +1190,7 @@ discard block |
||
1192 | 1190 | * Specifies a restriction over the groups of the query. |
1193 | 1191 | * Replaces any previous having restrictions, if any. |
1194 | 1192 | * |
1195 | - * @param mixed $having The restriction over the groups. |
|
1193 | + * @param string $having The restriction over the groups. |
|
1196 | 1194 | * |
1197 | 1195 | * @return self |
1198 | 1196 | */ |
@@ -1209,7 +1207,7 @@ discard block |
||
1209 | 1207 | * Adds a restriction over the groups of the query, forming a logical |
1210 | 1208 | * conjunction with any existing having restrictions. |
1211 | 1209 | * |
1212 | - * @param mixed $having The restriction to append. |
|
1210 | + * @param string $having The restriction to append. |
|
1213 | 1211 | * |
1214 | 1212 | * @return self |
1215 | 1213 | */ |
@@ -1232,7 +1230,7 @@ discard block |
||
1232 | 1230 | * Adds a restriction over the groups of the query, forming a logical |
1233 | 1231 | * disjunction with any existing having restrictions. |
1234 | 1232 | * |
1235 | - * @param mixed $having The restriction to add. |
|
1233 | + * @param string $having The restriction to add. |
|
1236 | 1234 | * |
1237 | 1235 | * @return self |
1238 | 1236 | */ |
@@ -1451,7 +1449,7 @@ discard block |
||
1451 | 1449 | /** |
1452 | 1450 | * Resets DQL parts. |
1453 | 1451 | * |
1454 | - * @param array|null $parts |
|
1452 | + * @param string[] $parts |
|
1455 | 1453 | * |
1456 | 1454 | * @return self |
1457 | 1455 | */ |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | public function setParameter($key, $value, $type = null) |
534 | 534 | { |
535 | 535 | $filteredParameters = $this->parameters->filter( |
536 | - function ($parameter) use ($key) |
|
536 | + function($parameter) use ($key) |
|
537 | 537 | { |
538 | 538 | /* @var Query\Parameter $parameter */ |
539 | 539 | // Must not be identical because of string to integer conversion |
@@ -614,7 +614,7 @@ discard block |
||
614 | 614 | public function getParameter($key) |
615 | 615 | { |
616 | 616 | $filteredParameters = $this->parameters->filter( |
617 | - function ($parameter) use ($key) |
|
617 | + function($parameter) use ($key) |
|
618 | 618 | { |
619 | 619 | /* @var Query\Parameter $parameter */ |
620 | 620 | // Must not be identical because of string to integer conversion |
@@ -697,7 +697,7 @@ discard block |
||
697 | 697 | } |
698 | 698 | |
699 | 699 | $isMultiple = is_array($this->_dqlParts[$dqlPartName]) |
700 | - && !($dqlPartName == 'join' && !$append); |
|
700 | + && ! ($dqlPartName == 'join' && ! $append); |
|
701 | 701 | |
702 | 702 | // Allow adding any part retrieved from self::getDQLParts(). |
703 | 703 | if (is_array($dqlPart) && $dqlPartName != 'join') { |
@@ -914,7 +914,7 @@ discard block |
||
914 | 914 | { |
915 | 915 | $rootAliases = $this->getRootAliases(); |
916 | 916 | |
917 | - if (!in_array($alias, $rootAliases)) { |
|
917 | + if ( ! in_array($alias, $rootAliases)) { |
|
918 | 918 | throw new Query\QueryException( |
919 | 919 | sprintf('Specified root alias %s must be set before invoking indexBy().', $alias) |
920 | 920 | ); |
@@ -1316,15 +1316,15 @@ discard block |
||
1316 | 1316 | foreach ($criteria->getOrderings() as $sort => $order) { |
1317 | 1317 | |
1318 | 1318 | $hasValidAlias = false; |
1319 | - foreach($allAliases as $alias) { |
|
1320 | - if(strpos($sort . '.', $alias . '.') === 0) { |
|
1319 | + foreach ($allAliases as $alias) { |
|
1320 | + if (strpos($sort.'.', $alias.'.') === 0) { |
|
1321 | 1321 | $hasValidAlias = true; |
1322 | 1322 | break; |
1323 | 1323 | } |
1324 | 1324 | } |
1325 | 1325 | |
1326 | - if(!$hasValidAlias) { |
|
1327 | - $sort = $allAliases[0] . '.' . $sort; |
|
1326 | + if ( ! $hasValidAlias) { |
|
1327 | + $sort = $allAliases[0].'.'.$sort; |
|
1328 | 1328 | } |
1329 | 1329 | |
1330 | 1330 | $this->addOrderBy($sort, $order); |
@@ -1397,7 +1397,7 @@ discard block |
||
1397 | 1397 | private function _getDQLForSelect() |
1398 | 1398 | { |
1399 | 1399 | $dql = 'SELECT' |
1400 | - . ($this->_dqlParts['distinct']===true ? ' DISTINCT' : '') |
|
1400 | + . ($this->_dqlParts['distinct'] === true ? ' DISTINCT' : '') |
|
1401 | 1401 | . $this->_getReducedDQLQueryPart('select', array('pre' => ' ', 'separator' => ', ')); |
1402 | 1402 | |
1403 | 1403 | $fromParts = $this->getDQLPart('from'); |
@@ -1413,7 +1413,7 @@ discard block |
||
1413 | 1413 | |
1414 | 1414 | if ($from instanceof Expr\From && isset($joinParts[$from->getAlias()])) { |
1415 | 1415 | foreach ($joinParts[$from->getAlias()] as $join) { |
1416 | - $fromClause .= ' ' . ((string) $join); |
|
1416 | + $fromClause .= ' '.((string) $join); |
|
1417 | 1417 | } |
1418 | 1418 | } |
1419 | 1419 |
@@ -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; |