@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | { |
76 | 76 | $expectedLockVersion = ($expectedLockVersion instanceof \DateTime) ? $expectedLockVersion->getTimestamp() : $expectedLockVersion; |
77 | 77 | $actualLockVersion = ($actualLockVersion instanceof \DateTime) ? $actualLockVersion->getTimestamp() : $actualLockVersion; |
78 | - return new self("The optimistic lock failed, version " . $expectedLockVersion . " was expected, but is actually ".$actualLockVersion, $entity); |
|
78 | + return new self("The optimistic lock failed, version ".$expectedLockVersion." was expected, but is actually ".$actualLockVersion, $entity); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
@@ -85,6 +85,6 @@ discard block |
||
85 | 85 | */ |
86 | 86 | public static function notVersioned($entityName) |
87 | 87 | { |
88 | - return new self("Cannot obtain optimistic lock on unversioned entity " . $entityName, null); |
|
88 | + return new self("Cannot obtain optimistic lock on unversioned entity ".$entityName, null); |
|
89 | 89 | } |
90 | 90 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $tableAlias = $alias == 'r' ? '' : $alias; |
64 | 64 | $columnName = $class->columnNames[$field]; |
65 | 65 | $columnAlias = $this->getSQLColumnAlias($columnName); |
66 | - $sql = $this->getSQLTableAlias($class->name, $tableAlias) . '.' |
|
66 | + $sql = $this->getSQLTableAlias($class->name, $tableAlias).'.' |
|
67 | 67 | . $this->quoteStrategy->getColumnName($field, $class, $this->platform); |
68 | 68 | |
69 | 69 | $this->currentPersisterContext->rsm->addFieldResult($alias, $columnAlias, $field, $class->name); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $sql = $type->convertToPHPValueSQL($sql, $this->platform); |
74 | 74 | } |
75 | 75 | |
76 | - return $sql . ' AS ' . $columnAlias; |
|
76 | + return $sql.' AS '.$columnAlias; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | /** |
@@ -90,6 +90,6 @@ discard block |
||
90 | 90 | |
91 | 91 | $this->currentPersisterContext->rsm->addMetaResult('r', $columnAlias, $joinColumnName, false, $type); |
92 | 92 | |
93 | - return $tableAlias . '.' . $joinColumnName . ' AS ' . $columnAlias; |
|
93 | + return $tableAlias.'.'.$joinColumnName.' AS '.$columnAlias; |
|
94 | 94 | } |
95 | 95 | } |
@@ -57,7 +57,7 @@ |
||
57 | 57 | $rootClass = $this->em->getClassMetadata($this->class->rootEntityName); |
58 | 58 | $tableAlias = $this->getSQLTableAlias($rootClass->name); |
59 | 59 | |
60 | - // Append discriminator column |
|
60 | + // Append discriminator column |
|
61 | 61 | $discrColumn = $this->class->discriminatorColumn['name']; |
62 | 62 | $columnList[] = $tableAlias . '.' . $discrColumn; |
63 | 63 |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | // Append discriminator column |
61 | 61 | $discrColumn = $this->class->discriminatorColumn['name']; |
62 | - $columnList[] = $tableAlias . '.' . $discrColumn; |
|
62 | + $columnList[] = $tableAlias.'.'.$discrColumn; |
|
63 | 63 | |
64 | 64 | $resultColumnName = $this->platform->getSQLResultCasing($discrColumn); |
65 | 65 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | } |
89 | 89 | |
90 | 90 | foreach ($assoc['targetToSourceKeyColumns'] as $srcColumn) { |
91 | - $className = isset($assoc['inherited']) ? $assoc['inherited'] : $this->class->name; |
|
91 | + $className = isset($assoc['inherited']) ? $assoc['inherited'] : $this->class->name; |
|
92 | 92 | |
93 | 93 | $targetClass = $this->em->getClassMetadata($assoc['targetEntity']); |
94 | 94 | |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | $conditionSql .= ' AND '; |
144 | 144 | } |
145 | 145 | |
146 | - return $conditionSql . $this->getSelectConditionDiscriminatorValueSQL(); |
|
146 | + return $conditionSql.$this->getSelectConditionDiscriminatorValueSQL(); |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | /** |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | $conditionSql .= ' AND '; |
158 | 158 | } |
159 | 159 | |
160 | - return $conditionSql . $this->getSelectConditionDiscriminatorValueSQL(); |
|
160 | + return $conditionSql.$this->getSelectConditionDiscriminatorValueSQL(); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | /** |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | $discColumn = $this->class->discriminatorColumn['name']; |
182 | 182 | $tableAlias = $this->getSQLTableAlias($this->class->name); |
183 | 183 | |
184 | - return $tableAlias . '.' . $discColumn . ' IN (' . $values . ')'; |
|
184 | + return $tableAlias.'.'.$discColumn.' IN ('.$values.')'; |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | /** |
@@ -75,8 +75,8 @@ discard block |
||
75 | 75 | // 1. Create an INSERT INTO temptable ... SELECT identifiers WHERE $AST->getWhereClause() |
76 | 76 | $sqlWalker->setSQLTableAlias($primaryClass->getTableName(), 't0', $primaryDqlAlias); |
77 | 77 | |
78 | - $this->_insertSql = 'INSERT INTO ' . $tempTable . ' (' . $idColumnList . ')' |
|
79 | - . ' SELECT t0.' . implode(', t0.', $idColumnNames); |
|
78 | + $this->_insertSql = 'INSERT INTO '.$tempTable.' ('.$idColumnList.')' |
|
79 | + . ' SELECT t0.'.implode(', t0.', $idColumnNames); |
|
80 | 80 | |
81 | 81 | $rangeDecl = new AST\RangeVariableDeclaration($primaryClass->name, $primaryDqlAlias); |
82 | 82 | $fromClause = new AST\FromClause(array(new AST\IdentificationVariableDeclaration($rangeDecl, null, array()))); |
@@ -88,14 +88,14 @@ discard block |
||
88 | 88 | } |
89 | 89 | |
90 | 90 | // 2. Create ID subselect statement used in DELETE ... WHERE ... IN (subselect) |
91 | - $idSubselect = 'SELECT ' . $idColumnList . ' FROM ' . $tempTable; |
|
91 | + $idSubselect = 'SELECT '.$idColumnList.' FROM '.$tempTable; |
|
92 | 92 | |
93 | 93 | // 3. Create and store DELETE statements |
94 | 94 | $classNames = array_merge($primaryClass->parentClasses, array($primaryClass->name), $primaryClass->subClasses); |
95 | 95 | foreach (array_reverse($classNames) as $className) { |
96 | 96 | $tableName = $quoteStrategy->getTableName($em->getClassMetadata($className), $platform); |
97 | - $this->_sqlStatements[] = 'DELETE FROM ' . $tableName |
|
98 | - . ' WHERE (' . $idColumnList . ') IN (' . $idSubselect . ')'; |
|
97 | + $this->_sqlStatements[] = 'DELETE FROM '.$tableName |
|
98 | + . ' WHERE ('.$idColumnList.') IN ('.$idSubselect.')'; |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | // 4. Store DDL for temporary identifier table. |
@@ -106,8 +106,8 @@ discard block |
||
106 | 106 | 'type' => \Doctrine\DBAL\Types\Type::getType($rootClass->getTypeOfColumn($idColumnName)) |
107 | 107 | ); |
108 | 108 | } |
109 | - $this->_createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable . ' (' |
|
110 | - . $platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; |
|
109 | + $this->_createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable.' (' |
|
110 | + . $platform->getColumnDeclarationListSQL($columnDefinitions).')'; |
|
111 | 111 | $this->_dropTempTableSql = $platform->getDropTemporaryTableSQL($tempTable); |
112 | 112 | } |
113 | 113 |
@@ -165,7 +165,7 @@ |
||
165 | 165 | |
166 | 166 | // Recognize identifiers |
167 | 167 | case (ctype_alpha($value[0]) || $value[0] === '_'): |
168 | - $name = 'Doctrine\ORM\Query\Lexer::T_' . strtoupper($value); |
|
168 | + $name = 'Doctrine\ORM\Query\Lexer::T_'.strtoupper($value); |
|
169 | 169 | |
170 | 170 | if (defined($name)) { |
171 | 171 | $type = constant($name); |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | { |
203 | 203 | switch ($mode) { |
204 | 204 | case self::COLUMN_RENAMING_INCREMENT: |
205 | - return $columnName . $this->sqlCounter++; |
|
205 | + return $columnName.$this->sqlCounter++; |
|
206 | 206 | |
207 | 207 | case self::COLUMN_RENAMING_CUSTOM: |
208 | 208 | return isset($customRenameColumns[$columnName]) |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | } |
291 | 291 | |
292 | 292 | foreach ($classMetadata->getColumnNames() as $key => $columnName) { |
293 | - $propertyName = $classMetadata->getFieldName($columnName); |
|
293 | + $propertyName = $classMetadata->getFieldName($columnName); |
|
294 | 294 | $this->addFieldResult($alias, $columnName, $propertyName); |
295 | 295 | } |
296 | 296 | |
@@ -319,19 +319,19 @@ discard block |
||
319 | 319 | $counter = 0; |
320 | 320 | $resultMapping = $class->getSqlResultSetMapping($resultSetMappingName); |
321 | 321 | $rooShortName = $class->reflClass->getShortName(); |
322 | - $rootAlias = strtolower($rooShortName[0]) . $counter; |
|
322 | + $rootAlias = strtolower($rooShortName[0]).$counter; |
|
323 | 323 | |
324 | 324 | |
325 | 325 | if (isset($resultMapping['entities'])) { |
326 | 326 | foreach ($resultMapping['entities'] as $key => $entityMapping) { |
327 | - $classMetadata = $this->em->getClassMetadata($entityMapping['entityClass']); |
|
327 | + $classMetadata = $this->em->getClassMetadata($entityMapping['entityClass']); |
|
328 | 328 | |
329 | 329 | if ($class->reflClass->name == $classMetadata->reflClass->name) { |
330 | 330 | $this->addEntityResult($classMetadata->name, $rootAlias); |
331 | 331 | $this->addNamedNativeQueryEntityResultMapping($classMetadata, $entityMapping, $rootAlias); |
332 | 332 | } else { |
333 | 333 | $shortName = $classMetadata->reflClass->getShortName(); |
334 | - $joinAlias = strtolower($shortName[0]) . ++ $counter; |
|
334 | + $joinAlias = strtolower($shortName[0]).++ $counter; |
|
335 | 335 | $associations = $class->getAssociationsByTargetClass($classMetadata->name); |
336 | 336 | |
337 | 337 | foreach ($associations as $relation => $mapping) { |
@@ -371,28 +371,28 @@ discard block |
||
371 | 371 | $this->addMetaResult($alias, $discriminatorColumn, $discriminatorColumn); |
372 | 372 | } |
373 | 373 | |
374 | - if (isset($entityMapping['fields']) && !empty($entityMapping['fields'])) { |
|
374 | + if (isset($entityMapping['fields']) && ! empty($entityMapping['fields'])) { |
|
375 | 375 | foreach ($entityMapping['fields'] as $field) { |
376 | 376 | $fieldName = $field['name']; |
377 | 377 | $relation = null; |
378 | 378 | |
379 | - if(strpos($fieldName, '.')){ |
|
379 | + if (strpos($fieldName, '.')) { |
|
380 | 380 | list($relation, $fieldName) = explode('.', $fieldName); |
381 | 381 | } |
382 | 382 | |
383 | 383 | if (isset($classMetadata->associationMappings[$relation])) { |
384 | - if($relation) { |
|
384 | + if ($relation) { |
|
385 | 385 | $associationMapping = $classMetadata->associationMappings[$relation]; |
386 | 386 | $joinAlias = $alias.$relation; |
387 | 387 | $parentAlias = $alias; |
388 | 388 | |
389 | 389 | $this->addJoinedEntityResult($associationMapping['targetEntity'], $joinAlias, $parentAlias, $relation); |
390 | 390 | $this->addFieldResult($joinAlias, $field['column'], $fieldName); |
391 | - }else { |
|
391 | + } else { |
|
392 | 392 | $this->addFieldResult($alias, $field['column'], $fieldName, $classMetadata->name); |
393 | 393 | } |
394 | 394 | } else { |
395 | - if(!isset($classMetadata->fieldMappings[$fieldName])) { |
|
395 | + if ( ! isset($classMetadata->fieldMappings[$fieldName])) { |
|
396 | 396 | throw new \InvalidArgumentException("Entity '".$classMetadata->name."' has no field '".$fieldName."'. "); |
397 | 397 | } |
398 | 398 | $this->addFieldResult($alias, $field['column'], $fieldName, $classMetadata->name); |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | |
402 | 402 | } else { |
403 | 403 | foreach ($classMetadata->getColumnNames() as $columnName) { |
404 | - $propertyName = $classMetadata->getFieldName($columnName); |
|
404 | + $propertyName = $classMetadata->getFieldName($columnName); |
|
405 | 405 | $this->addFieldResult($alias, $columnName, $propertyName); |
406 | 406 | } |
407 | 407 | } |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | $sql .= ", "; |
432 | 432 | } |
433 | 433 | |
434 | - $sql .= $tableAlias . "."; |
|
434 | + $sql .= $tableAlias."."; |
|
435 | 435 | |
436 | 436 | if (isset($this->fieldMappings[$columnName])) { |
437 | 437 | $class = $this->em->getClassMetadata($this->declaringClasses[$columnName]); |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | $sql .= $this->discriminatorColumns[$dqlAlias]; |
443 | 443 | } |
444 | 444 | |
445 | - $sql .= " AS " . $columnName; |
|
445 | + $sql .= " AS ".$columnName; |
|
446 | 446 | } |
447 | 447 | |
448 | 448 | return $sql; |
@@ -388,7 +388,7 @@ |
||
388 | 388 | |
389 | 389 | $this->addJoinedEntityResult($associationMapping['targetEntity'], $joinAlias, $parentAlias, $relation); |
390 | 390 | $this->addFieldResult($joinAlias, $field['column'], $fieldName); |
391 | - }else { |
|
391 | + } else { |
|
392 | 392 | $this->addFieldResult($alias, $field['column'], $fieldName, $classMetadata->name); |
393 | 393 | } |
394 | 394 | } else { |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public static function syntaxError($message, $previous = null) |
51 | 51 | { |
52 | - return new self('[Syntax Error] ' . $message, 0, $previous); |
|
52 | + return new self('[Syntax Error] '.$message, 0, $previous); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | */ |
61 | 61 | public static function semanticalError($message, $previous = null) |
62 | 62 | { |
63 | - return new self('[Semantical Error] ' . $message, 0, $previous); |
|
63 | + return new self('[Semantical Error] '.$message, 0, $previous); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | public static function invalidParameterType($expected, $received) |
81 | 81 | { |
82 | - return new self('Invalid parameter type, ' . $received . ' given, but ' . $expected . ' expected.'); |
|
82 | + return new self('Invalid parameter type, '.$received.' given, but '.$expected.' expected.'); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | */ |
90 | 90 | public static function invalidParameterPosition($pos) |
91 | 91 | { |
92 | - return new self('Invalid parameter position: ' . $pos); |
|
92 | + return new self('Invalid parameter position: '.$pos); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | /** |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | */ |
101 | 101 | public static function tooManyParameters($expected, $received) |
102 | 102 | { |
103 | - return new self('Too many parameters: the query defines ' . $expected . ' parameters and you bound ' . $received); |
|
103 | + return new self('Too many parameters: the query defines '.$expected.' parameters and you bound '.$received); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | */ |
112 | 112 | public static function tooFewParameters($expected, $received) |
113 | 113 | { |
114 | - return new self('Too few parameters: the query defines ' . $expected . ' parameters but you only bound ' . $received); |
|
114 | + return new self('Too few parameters: the query defines '.$expected.' parameters but you only bound '.$received); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | /** |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | public static function invalidPathExpression($pathExpr) |
151 | 151 | { |
152 | 152 | return new self( |
153 | - "Invalid PathExpression '" . $pathExpr->identificationVariable . "." . $pathExpr->field . "'." |
|
153 | + "Invalid PathExpression '".$pathExpr->identificationVariable.".".$pathExpr->field."'." |
|
154 | 154 | ); |
155 | 155 | } |
156 | 156 | |
@@ -183,8 +183,8 @@ discard block |
||
183 | 183 | public static function partialObjectsAreDangerous() |
184 | 184 | { |
185 | 185 | return new self( |
186 | - "Loading partial objects is dangerous. Fetch full objects or consider " . |
|
187 | - "using a different fetch mode. If you really want partial objects, " . |
|
186 | + "Loading partial objects is dangerous. Fetch full objects or consider ". |
|
187 | + "using a different fetch mode. If you really want partial objects, ". |
|
188 | 188 | "set the doctrine.forcePartialLoad query hint to TRUE." |
189 | 189 | ); |
190 | 190 | } |
@@ -222,8 +222,8 @@ discard block |
||
222 | 222 | public static function iterateWithFetchJoinNotAllowed($assoc) |
223 | 223 | { |
224 | 224 | return new self( |
225 | - "Iterate with fetch join in class " . $assoc['sourceEntity'] . |
|
226 | - " using association " . $assoc['fieldName'] . " not allowed." |
|
225 | + "Iterate with fetch join in class ".$assoc['sourceEntity']. |
|
226 | + " using association ".$assoc['fieldName']." not allowed." |
|
227 | 227 | ); |
228 | 228 | } |
229 | 229 | |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | */ |
248 | 248 | public static function instanceOfUnrelatedClass($className, $rootClass) |
249 | 249 | { |
250 | - return new self("Cannot check if a child of '" . $rootClass . "' is instanceof '" . $className . "', " . |
|
250 | + return new self("Cannot check if a child of '".$rootClass."' is instanceof '".$className."', ". |
|
251 | 251 | "inheritance hierarchy does not exists between these two classes."); |
252 | 252 | } |
253 | 253 | |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | public static function invalidQueryComponent($dqlAlias) |
260 | 260 | { |
261 | 261 | return new self( |
262 | - "Invalid query component given for DQL alias '" . $dqlAlias . "', ". |
|
262 | + "Invalid query component given for DQL alias '".$dqlAlias."', ". |
|
263 | 263 | "requires 'metadata', 'parent', 'relation', 'map', 'nestingLevel' and 'token' keys." |
264 | 264 | ); |
265 | 265 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | foreach ($assoc['joinColumns'] as $mapping) { |
72 | 72 | |
73 | - if($mapping['referencedColumnName'] === $field['columnName']) { |
|
73 | + if ($mapping['referencedColumnName'] === $field['columnName']) { |
|
74 | 74 | $joinColumn = $mapping; |
75 | 75 | |
76 | 76 | break; |
@@ -86,9 +86,9 @@ discard block |
||
86 | 86 | $tableName = $sqlWalker->getEntityManager()->getClassMetadata($assoc['sourceEntity'])->getTableName(); |
87 | 87 | |
88 | 88 | $tableAlias = $sqlWalker->getSQLTableAlias($tableName, $dqlAlias); |
89 | - $columnName = $quoteStrategy->getJoinColumnName($joinColumn, $targetEntity, $platform); |
|
89 | + $columnName = $quoteStrategy->getJoinColumnName($joinColumn, $targetEntity, $platform); |
|
90 | 90 | |
91 | - return $tableAlias . '.' . $columnName; |
|
91 | + return $tableAlias.'.'.$columnName; |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | /** |
@@ -42,7 +42,7 @@ |
||
42 | 42 | public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) |
43 | 43 | { |
44 | 44 | return $sqlWalker->getConnection()->getDatabasePlatform()->getUpperExpression( |
45 | - $sqlWalker->walkSimpleArithmeticExpression($this->stringPrimary) |
|
45 | + $sqlWalker->walkSimpleArithmeticExpression($this->stringPrimary) |
|
46 | 46 | ); |
47 | 47 | } |
48 | 48 |