@@ -77,8 +77,8 @@ discard block |
||
77 | 77 | // 1. Create an INSERT INTO temptable ... SELECT identifiers WHERE $AST->getWhereClause() |
78 | 78 | $sqlWalker->setSQLTableAlias($primaryClass->getTableName(), 't0', $primaryDqlAlias); |
79 | 79 | |
80 | - $this->_insertSql = 'INSERT INTO ' . $tempTable . ' (' . $idColumnList . ')' |
|
81 | - . ' SELECT t0.' . implode(', t0.', $idColumnNames); |
|
80 | + $this->_insertSql = 'INSERT INTO '.$tempTable.' ('.$idColumnList.')' |
|
81 | + . ' SELECT t0.'.implode(', t0.', $idColumnNames); |
|
82 | 82 | |
83 | 83 | $rangeDecl = new AST\RangeVariableDeclaration($primaryClass->name, $primaryDqlAlias); |
84 | 84 | $fromClause = new AST\FromClause(array(new AST\IdentificationVariableDeclaration($rangeDecl, null, array()))); |
@@ -90,14 +90,14 @@ discard block |
||
90 | 90 | } |
91 | 91 | |
92 | 92 | // 2. Create ID subselect statement used in DELETE ... WHERE ... IN (subselect) |
93 | - $idSubselect = 'SELECT ' . $idColumnList . ' FROM ' . $tempTable; |
|
93 | + $idSubselect = 'SELECT '.$idColumnList.' FROM '.$tempTable; |
|
94 | 94 | |
95 | 95 | // 3. Create and store DELETE statements |
96 | 96 | $classNames = array_merge($primaryClass->parentClasses, array($primaryClass->name), $primaryClass->subClasses); |
97 | 97 | foreach (array_reverse($classNames) as $className) { |
98 | 98 | $tableName = $quoteStrategy->getTableName($em->getClassMetadata($className), $platform); |
99 | - $this->_sqlStatements[] = 'DELETE FROM ' . $tableName |
|
100 | - . ' WHERE (' . $idColumnList . ') IN (' . $idSubselect . ')'; |
|
99 | + $this->_sqlStatements[] = 'DELETE FROM '.$tableName |
|
100 | + . ' WHERE ('.$idColumnList.') IN ('.$idSubselect.')'; |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | // 4. Store DDL for temporary identifier table. |
@@ -108,8 +108,8 @@ discard block |
||
108 | 108 | 'type' => Type::getType(PersisterHelper::getTypeOfColumn($idColumnName, $rootClass, $em)), |
109 | 109 | ); |
110 | 110 | } |
111 | - $this->_createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable . ' (' |
|
112 | - . $platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; |
|
111 | + $this->_createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable.' (' |
|
112 | + . $platform->getColumnDeclarationListSQL($columnDefinitions).')'; |
|
113 | 113 | $this->_dropTempTableSql = $platform->getDropTemporaryTableSQL($tempTable); |
114 | 114 | } |
115 | 115 |
@@ -88,8 +88,8 @@ discard block |
||
88 | 88 | // 1. Create an INSERT INTO temptable ... SELECT identifiers WHERE $AST->getWhereClause() |
89 | 89 | $sqlWalker->setSQLTableAlias($primaryClass->getTableName(), 't0', $updateClause->aliasIdentificationVariable); |
90 | 90 | |
91 | - $this->_insertSql = 'INSERT INTO ' . $tempTable . ' (' . $idColumnList . ')' |
|
92 | - . ' SELECT t0.' . implode(', t0.', $idColumnNames); |
|
91 | + $this->_insertSql = 'INSERT INTO '.$tempTable.' ('.$idColumnList.')' |
|
92 | + . ' SELECT t0.'.implode(', t0.', $idColumnNames); |
|
93 | 93 | |
94 | 94 | $rangeDecl = new AST\RangeVariableDeclaration($primaryClass->name, $updateClause->aliasIdentificationVariable); |
95 | 95 | $fromClause = new AST\FromClause(array(new AST\IdentificationVariableDeclaration($rangeDecl, null, array()))); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $this->_insertSql .= $sqlWalker->walkFromClause($fromClause); |
98 | 98 | |
99 | 99 | // 2. Create ID subselect statement used in UPDATE ... WHERE ... IN (subselect) |
100 | - $idSubselect = 'SELECT ' . $idColumnList . ' FROM ' . $tempTable; |
|
100 | + $idSubselect = 'SELECT '.$idColumnList.' FROM '.$tempTable; |
|
101 | 101 | |
102 | 102 | // 3. Create and store UPDATE statements |
103 | 103 | $classNames = array_merge($primaryClass->parentClasses, array($primaryClass->name), $primaryClass->subClasses); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | foreach (array_reverse($classNames) as $className) { |
107 | 107 | $affected = false; |
108 | 108 | $class = $em->getClassMetadata($className); |
109 | - $updateSql = 'UPDATE ' . $quoteStrategy->getTableName($class, $platform) . ' SET '; |
|
109 | + $updateSql = 'UPDATE '.$quoteStrategy->getTableName($class, $platform).' SET '; |
|
110 | 110 | |
111 | 111 | foreach ($updateItems as $updateItem) { |
112 | 112 | $field = $updateItem->pathExpression->field; |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | } |
134 | 134 | |
135 | 135 | if ($affected) { |
136 | - $this->_sqlStatements[$i] = $updateSql . ' WHERE (' . $idColumnList . ') IN (' . $idSubselect . ')'; |
|
136 | + $this->_sqlStatements[$i] = $updateSql.' WHERE ('.$idColumnList.') IN ('.$idSubselect.')'; |
|
137 | 137 | } |
138 | 138 | } |
139 | 139 | |
@@ -152,8 +152,8 @@ discard block |
||
152 | 152 | ); |
153 | 153 | } |
154 | 154 | |
155 | - $this->_createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable . ' (' |
|
156 | - . $platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; |
|
155 | + $this->_createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable.' (' |
|
156 | + . $platform->getColumnDeclarationListSQL($columnDefinitions).')'; |
|
157 | 157 | |
158 | 158 | $this->_dropTempTableSql = $platform->getDropTemporaryTableSQL($tempTable); |
159 | 159 | } |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | { |
205 | 205 | switch ($mode) { |
206 | 206 | case self::COLUMN_RENAMING_INCREMENT: |
207 | - return $columnName . $this->sqlCounter++; |
|
207 | + return $columnName.$this->sqlCounter++; |
|
208 | 208 | |
209 | 209 | case self::COLUMN_RENAMING_CUSTOM: |
210 | 210 | return isset($customRenameColumns[$columnName]) |
@@ -327,19 +327,19 @@ discard block |
||
327 | 327 | $counter = 0; |
328 | 328 | $resultMapping = $class->getSqlResultSetMapping($resultSetMappingName); |
329 | 329 | $rootShortName = $class->reflClass->getShortName(); |
330 | - $rootAlias = strtolower($rootShortName[0]) . $counter; |
|
330 | + $rootAlias = strtolower($rootShortName[0]).$counter; |
|
331 | 331 | |
332 | 332 | |
333 | 333 | if (isset($resultMapping['entities'])) { |
334 | 334 | foreach ($resultMapping['entities'] as $key => $entityMapping) { |
335 | - $classMetadata = $this->em->getClassMetadata($entityMapping['entityClass']); |
|
335 | + $classMetadata = $this->em->getClassMetadata($entityMapping['entityClass']); |
|
336 | 336 | |
337 | 337 | if ($class->reflClass->name == $classMetadata->reflClass->name) { |
338 | 338 | $this->addEntityResult($classMetadata->name, $rootAlias); |
339 | 339 | $this->addNamedNativeQueryEntityResultMapping($classMetadata, $entityMapping, $rootAlias); |
340 | 340 | } else { |
341 | 341 | $shortName = $classMetadata->reflClass->getShortName(); |
342 | - $joinAlias = strtolower($shortName[0]) . ++ $counter; |
|
342 | + $joinAlias = strtolower($shortName[0]).++ $counter; |
|
343 | 343 | $associations = $class->getAssociationsByTargetClass($classMetadata->name); |
344 | 344 | |
345 | 345 | $this->addNamedNativeQueryEntityResultMapping($classMetadata, $entityMapping, $joinAlias); |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | $this->addMetaResult($alias, $discriminatorColumn, $discriminatorColumn, false, $discriminatorType); |
388 | 388 | } |
389 | 389 | |
390 | - if (isset($entityMapping['fields']) && !empty($entityMapping['fields'])) { |
|
390 | + if (isset($entityMapping['fields']) && ! empty($entityMapping['fields'])) { |
|
391 | 391 | foreach ($entityMapping['fields'] as $field) { |
392 | 392 | $fieldName = $field['name']; |
393 | 393 | $relation = null; |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | $sql .= ", "; |
450 | 450 | } |
451 | 451 | |
452 | - $sql .= $tableAlias . "."; |
|
452 | + $sql .= $tableAlias."."; |
|
453 | 453 | |
454 | 454 | if (isset($this->fieldMappings[$columnName])) { |
455 | 455 | $class = $this->em->getClassMetadata($this->declaringClasses[$columnName]); |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | $sql .= $this->discriminatorColumns[$dqlAlias]; |
461 | 461 | } |
462 | 462 | |
463 | - $sql .= " AS " . $columnName; |
|
463 | + $sql .= " AS ".$columnName; |
|
464 | 464 | } |
465 | 465 | |
466 | 466 | return $sql; |
@@ -65,7 +65,7 @@ |
||
65 | 65 | */ |
66 | 66 | public function startProduction($name) |
67 | 67 | { |
68 | - $this->println('(' . $name); |
|
68 | + $this->println('('.$name); |
|
69 | 69 | $this->_indent++; |
70 | 70 | } |
71 | 71 |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | */ |
269 | 269 | public function countDistinct($x) |
270 | 270 | { |
271 | - return 'COUNT(DISTINCT ' . implode(', ', func_get_args()) . ')'; |
|
271 | + return 'COUNT(DISTINCT '.implode(', ', func_get_args()).')'; |
|
272 | 272 | } |
273 | 273 | |
274 | 274 | /** |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | } |
451 | 451 | } |
452 | 452 | |
453 | - return new Expr\Func($x . ' IN', (array) $y); |
|
453 | + return new Expr\Func($x.' IN', (array) $y); |
|
454 | 454 | } |
455 | 455 | |
456 | 456 | /** |
@@ -471,7 +471,7 @@ discard block |
||
471 | 471 | } |
472 | 472 | } |
473 | 473 | |
474 | - return new Expr\Func($x . ' NOT IN', (array) $y); |
|
474 | + return new Expr\Func($x.' NOT IN', (array) $y); |
|
475 | 475 | } |
476 | 476 | |
477 | 477 | /** |
@@ -483,7 +483,7 @@ discard block |
||
483 | 483 | */ |
484 | 484 | public function isNull($x) |
485 | 485 | { |
486 | - return $x . ' IS NULL'; |
|
486 | + return $x.' IS NULL'; |
|
487 | 487 | } |
488 | 488 | |
489 | 489 | /** |
@@ -495,7 +495,7 @@ discard block |
||
495 | 495 | */ |
496 | 496 | public function isNotNull($x) |
497 | 497 | { |
498 | - return $x . ' IS NOT NULL'; |
|
498 | + return $x.' IS NOT NULL'; |
|
499 | 499 | } |
500 | 500 | |
501 | 501 | /** |
@@ -613,12 +613,12 @@ discard block |
||
613 | 613 | */ |
614 | 614 | private function _quoteLiteral($literal) |
615 | 615 | { |
616 | - if (is_numeric($literal) && !is_string($literal)) { |
|
616 | + if (is_numeric($literal) && ! is_string($literal)) { |
|
617 | 617 | return (string) $literal; |
618 | 618 | } else if (is_bool($literal)) { |
619 | 619 | return $literal ? "true" : "false"; |
620 | 620 | } else { |
621 | - return "'" . str_replace("'", "''", $literal) . "'"; |
|
621 | + return "'".str_replace("'", "''", $literal)."'"; |
|
622 | 622 | } |
623 | 623 | } |
624 | 624 | |
@@ -633,7 +633,7 @@ discard block |
||
633 | 633 | */ |
634 | 634 | public function between($val, $x, $y) |
635 | 635 | { |
636 | - return $val . ' BETWEEN ' . $x . ' AND ' . $y; |
|
636 | + return $val.' BETWEEN '.$x.' AND '.$y; |
|
637 | 637 | } |
638 | 638 | |
639 | 639 | /** |
@@ -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; |
@@ -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 | } |
@@ -149,13 +149,13 @@ discard block |
||
149 | 149 | |
150 | 150 | foreach ($this->parameters as $parameter) { |
151 | 151 | if ($parameter->getName() === $parameterName) { |
152 | - $parameterName .= '_' . count($this->parameters); |
|
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 | |
183 | 183 | return $this->expr->neq($field, $placeholder); |
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 | |
188 | 188 | return $this->expr->like($field, $placeholder); |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | ); |
199 | 199 | } |
200 | 200 | |
201 | - throw new \RuntimeException("Unknown comparison operator: " . $comparison->getOperator()); |
|
201 | + throw new \RuntimeException("Unknown comparison operator: ".$comparison->getOperator()); |
|
202 | 202 | } |
203 | 203 | } |
204 | 204 |
@@ -100,8 +100,8 @@ discard block |
||
100 | 100 | */ |
101 | 101 | final public function getParameter($name) |
102 | 102 | { |
103 | - if (!isset($this->parameters[$name])) { |
|
104 | - throw new \InvalidArgumentException("Parameter '" . $name . "' does not exist."); |
|
103 | + if ( ! isset($this->parameters[$name])) { |
|
104 | + throw new \InvalidArgumentException("Parameter '".$name."' does not exist."); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | return $this->em->getConnection()->quote($this->parameters[$name]['value'], $this->parameters[$name]['type']); |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | final public function hasParameter($name) |
118 | 118 | { |
119 | - if (!isset($this->parameters[$name])) { |
|
119 | + if ( ! isset($this->parameters[$name])) { |
|
120 | 120 | return false; |
121 | 121 | } |
122 | 122 |
@@ -41,7 +41,7 @@ |
||
41 | 41 | */ |
42 | 42 | public function getRepository(EntityManagerInterface $entityManager, $entityName) |
43 | 43 | { |
44 | - $repositoryHash = $entityManager->getClassMetadata($entityName)->getName() . spl_object_hash($entityManager); |
|
44 | + $repositoryHash = $entityManager->getClassMetadata($entityName)->getName().spl_object_hash($entityManager); |
|
45 | 45 | |
46 | 46 | if (isset($this->repositoryList[$repositoryHash])) { |
47 | 47 | return $this->repositoryList[$repositoryHash]; |