@@ -15,20 +15,20 @@ |
||
| 15 | 15 | error_reporting(E_ALL | E_STRICT); |
| 16 | 16 | date_default_timezone_set('UTC'); |
| 17 | 17 | |
| 18 | -if (file_exists(__DIR__ . '/../../../vendor/autoload.php')) { |
|
| 18 | +if (file_exists(__DIR__.'/../../../vendor/autoload.php')) { |
|
| 19 | 19 | // dependencies were installed via composer - this is the main project |
| 20 | - require __DIR__ . '/../../../vendor/autoload.php'; |
|
| 21 | -} elseif (file_exists(__DIR__ . '/../../../../../autoload.php')) { |
|
| 20 | + require __DIR__.'/../../../vendor/autoload.php'; |
|
| 21 | +} elseif (file_exists(__DIR__.'/../../../../../autoload.php')) { |
|
| 22 | 22 | // installed as a dependency in `vendor` |
| 23 | - require __DIR__ . '/../../../../../autoload.php'; |
|
| 23 | + require __DIR__.'/../../../../../autoload.php'; |
|
| 24 | 24 | } else { |
| 25 | 25 | throw new Exception('Can\'t find autoload.php. Did you install dependencies via composer?'); |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | -if (! file_exists(__DIR__ . '/Proxies') && ! mkdir(__DIR__ . '/Proxies')) { |
|
| 29 | - throw new Exception('Could not create ' . __DIR__ . '/Proxies Folder.'); |
|
| 28 | +if ( ! file_exists(__DIR__.'/Proxies') && ! mkdir(__DIR__.'/Proxies')) { |
|
| 29 | + throw new Exception('Could not create '.__DIR__.'/Proxies Folder.'); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | -if (! file_exists(__DIR__ . '/ORM/Proxy/generated') && ! mkdir(__DIR__ . '/ORM/Proxy/generated')) { |
|
| 33 | - throw new Exception('Could not create ' . __DIR__ . '/ORM/Proxy/generated Folder.'); |
|
| 32 | +if ( ! file_exists(__DIR__.'/ORM/Proxy/generated') && ! mkdir(__DIR__.'/ORM/Proxy/generated')) { |
|
| 33 | + throw new Exception('Could not create '.__DIR__.'/ORM/Proxy/generated Folder.'); |
|
| 34 | 34 | } |
@@ -143,8 +143,8 @@ discard block |
||
| 143 | 143 | ) { |
| 144 | 144 | $this->reverseEngineerMappingFromDatabase(); |
| 145 | 145 | |
| 146 | - if (! isset($this->classToTableNames[$className])) { |
|
| 147 | - throw new InvalidArgumentException('Unknown class ' . $className); |
|
| 146 | + if ( ! isset($this->classToTableNames[$className])) { |
|
| 147 | + throw new InvalidArgumentException('Unknown class '.$className); |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | // @todo guilhermeblanco This should somehow disappear... =) |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | } |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | - if (! $otherFk) { |
|
| 177 | + if ( ! $otherFk) { |
|
| 178 | 178 | // the definition of this many to many table does not contain |
| 179 | 179 | // enough foreign key information to continue reverse engineering. |
| 180 | 180 | continue; |
@@ -255,9 +255,9 @@ discard block |
||
| 255 | 255 | $allForeignKeyColumns = array_merge($allForeignKeyColumns, $foreignKey->getLocalColumns()); |
| 256 | 256 | } |
| 257 | 257 | |
| 258 | - if (! $table->hasPrimaryKey()) { |
|
| 258 | + if ( ! $table->hasPrimaryKey()) { |
|
| 259 | 259 | throw new Mapping\MappingException( |
| 260 | - 'Table ' . $table->getName() . ' has no primary key. Doctrine does not ' . |
|
| 260 | + 'Table '.$table->getName().' has no primary key. Doctrine does not '. |
|
| 261 | 261 | "support reverse engineering from tables that don't have a primary key." |
| 262 | 262 | ); |
| 263 | 263 | } |
@@ -447,7 +447,7 @@ discard block |
||
| 447 | 447 | } |
| 448 | 448 | |
| 449 | 449 | // Here we need to check if $fkColumns are the same as $primaryKeys |
| 450 | - if (! array_diff($fkColumns, $primaryKeys)) { |
|
| 450 | + if ( ! array_diff($fkColumns, $primaryKeys)) { |
|
| 451 | 451 | $metadata->addProperty($associationMapping); |
| 452 | 452 | } else { |
| 453 | 453 | $metadata->addProperty($associationMapping); |
@@ -492,7 +492,7 @@ discard block |
||
| 492 | 492 | */ |
| 493 | 493 | private function getClassNameForTable($tableName) |
| 494 | 494 | { |
| 495 | - return $this->namespace . ( |
|
| 495 | + return $this->namespace.( |
|
| 496 | 496 | $this->classNamesForTables[$tableName] |
| 497 | 497 | ?? Inflector::classify(strtolower($tableName)) |
| 498 | 498 | ); |
@@ -417,7 +417,7 @@ discard block |
||
| 417 | 417 | { |
| 418 | 418 | $aliases = $this->getRootAliases(); |
| 419 | 419 | |
| 420 | - if (! isset($aliases[0])) { |
|
| 420 | + if ( ! isset($aliases[0])) { |
|
| 421 | 421 | throw new RuntimeException('No alias was set before invoking getRootAlias().'); |
| 422 | 422 | } |
| 423 | 423 | |
@@ -600,7 +600,7 @@ discard block |
||
| 600 | 600 | public function getParameter($key) |
| 601 | 601 | { |
| 602 | 602 | $filteredParameters = $this->parameters->filter( |
| 603 | - static function (Query\Parameter $parameter) use ($key) : bool { |
|
| 603 | + static function(Query\Parameter $parameter) use ($key) : bool { |
|
| 604 | 604 | $parameterName = $parameter->getName(); |
| 605 | 605 | |
| 606 | 606 | return $key === $parameterName || (string) $key === (string) $parameterName; |
@@ -676,7 +676,7 @@ discard block |
||
| 676 | 676 | { |
| 677 | 677 | if ($append && ($dqlPartName === 'where' || $dqlPartName === 'having')) { |
| 678 | 678 | throw new InvalidArgumentException( |
| 679 | - "Using \$append = true does not have an effect with 'where' or 'having' " . |
|
| 679 | + "Using \$append = true does not have an effect with 'where' or 'having' ". |
|
| 680 | 680 | 'parts. See QueryBuilder#andWhere() for an example for correct usage.' |
| 681 | 681 | ); |
| 682 | 682 | } |
@@ -817,7 +817,7 @@ discard block |
||
| 817 | 817 | { |
| 818 | 818 | $this->type = self::DELETE; |
| 819 | 819 | |
| 820 | - if (! $delete) { |
|
| 820 | + if ( ! $delete) { |
|
| 821 | 821 | return $this; |
| 822 | 822 | } |
| 823 | 823 | |
@@ -844,7 +844,7 @@ discard block |
||
| 844 | 844 | { |
| 845 | 845 | $this->type = self::UPDATE; |
| 846 | 846 | |
| 847 | - if (! $update) { |
|
| 847 | + if ( ! $update) { |
|
| 848 | 848 | return $this; |
| 849 | 849 | } |
| 850 | 850 | |
@@ -899,7 +899,7 @@ discard block |
||
| 899 | 899 | { |
| 900 | 900 | $rootAliases = $this->getRootAliases(); |
| 901 | 901 | |
| 902 | - if (! in_array($alias, $rootAliases, true)) { |
|
| 902 | + if ( ! in_array($alias, $rootAliases, true)) { |
|
| 903 | 903 | throw new Query\QueryException( |
| 904 | 904 | sprintf('Specified root alias %s must be set before invoking indexBy().', $alias) |
| 905 | 905 | ); |
@@ -1060,7 +1060,7 @@ discard block |
||
| 1060 | 1060 | */ |
| 1061 | 1061 | public function where($predicates) |
| 1062 | 1062 | { |
| 1063 | - if (! (func_num_args() === 1 && $predicates instanceof Expr\Composite)) { |
|
| 1063 | + if ( ! (func_num_args() === 1 && $predicates instanceof Expr\Composite)) { |
|
| 1064 | 1064 | $predicates = new Expr\Andx(func_get_args()); |
| 1065 | 1065 | } |
| 1066 | 1066 | |
@@ -1179,7 +1179,7 @@ discard block |
||
| 1179 | 1179 | */ |
| 1180 | 1180 | public function having($having) |
| 1181 | 1181 | { |
| 1182 | - if (! (func_num_args() === 1 && ($having instanceof Expr\Andx || $having instanceof Expr\Orx))) { |
|
| 1182 | + if ( ! (func_num_args() === 1 && ($having instanceof Expr\Andx || $having instanceof Expr\Orx))) { |
|
| 1183 | 1183 | $having = new Expr\Andx(func_get_args()); |
| 1184 | 1184 | } |
| 1185 | 1185 | |
@@ -1277,7 +1277,7 @@ discard block |
||
| 1277 | 1277 | public function addCriteria(Criteria $criteria) |
| 1278 | 1278 | { |
| 1279 | 1279 | $allAliases = $this->getAllAliases(); |
| 1280 | - if (! isset($allAliases[0])) { |
|
| 1280 | + if ( ! isset($allAliases[0])) { |
|
| 1281 | 1281 | throw new Query\QueryException('No aliases are set before invoking addCriteria().'); |
| 1282 | 1282 | } |
| 1283 | 1283 | |
@@ -1295,14 +1295,14 @@ discard block |
||
| 1295 | 1295 | foreach ($criteria->getOrderings() as $sort => $order) { |
| 1296 | 1296 | $hasValidAlias = false; |
| 1297 | 1297 | foreach ($allAliases as $alias) { |
| 1298 | - if (strpos($sort . '.', $alias . '.') === 0) { |
|
| 1298 | + if (strpos($sort.'.', $alias.'.') === 0) { |
|
| 1299 | 1299 | $hasValidAlias = true; |
| 1300 | 1300 | break; |
| 1301 | 1301 | } |
| 1302 | 1302 | } |
| 1303 | 1303 | |
| 1304 | - if (! $hasValidAlias) { |
|
| 1305 | - $sort = $allAliases[0] . '.' . $sort; |
|
| 1304 | + if ( ! $hasValidAlias) { |
|
| 1305 | + $sort = $allAliases[0].'.'.$sort; |
|
| 1306 | 1306 | } |
| 1307 | 1307 | |
| 1308 | 1308 | $this->addOrderBy($sort, $order); |
@@ -1376,7 +1376,7 @@ discard block |
||
| 1376 | 1376 | private function getDQLForSelect() |
| 1377 | 1377 | { |
| 1378 | 1378 | $dql = 'SELECT' |
| 1379 | - . ($this->dqlParts['distinct']===true ? ' DISTINCT' : '') |
|
| 1379 | + . ($this->dqlParts['distinct'] === true ? ' DISTINCT' : '') |
|
| 1380 | 1380 | . $this->getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']); |
| 1381 | 1381 | |
| 1382 | 1382 | $fromParts = $this->getDQLPart('from'); |
@@ -1384,7 +1384,7 @@ discard block |
||
| 1384 | 1384 | $fromClauses = []; |
| 1385 | 1385 | |
| 1386 | 1386 | // Loop through all FROM clauses |
| 1387 | - if (! empty($fromParts)) { |
|
| 1387 | + if ( ! empty($fromParts)) { |
|
| 1388 | 1388 | $dql .= ' FROM '; |
| 1389 | 1389 | |
| 1390 | 1390 | foreach ($fromParts as $from) { |
@@ -1392,7 +1392,7 @@ discard block |
||
| 1392 | 1392 | |
| 1393 | 1393 | if ($from instanceof Expr\From && isset($joinParts[$from->getAlias()])) { |
| 1394 | 1394 | foreach ($joinParts[$from->getAlias()] as $join) { |
| 1395 | - $fromClause .= ' ' . ((string) $join); |
|
| 1395 | + $fromClause .= ' '.((string) $join); |
|
| 1396 | 1396 | } |
| 1397 | 1397 | } |
| 1398 | 1398 | |
@@ -85,10 +85,10 @@ discard block |
||
| 85 | 85 | // It's a joined result |
| 86 | 86 | |
| 87 | 87 | $parent = $this->rsm->parentAliasMap[$dqlAlias]; |
| 88 | - $path = $parent . '.' . $dqlAlias; |
|
| 88 | + $path = $parent.'.'.$dqlAlias; |
|
| 89 | 89 | |
| 90 | 90 | // missing parent data, skipping as RIGHT JOIN hydration is not supported. |
| 91 | - if (! isset($nonemptyComponents[$parent])) { |
|
| 91 | + if ( ! isset($nonemptyComponents[$parent])) { |
|
| 92 | 92 | continue; |
| 93 | 93 | } |
| 94 | 94 | |
@@ -97,9 +97,9 @@ discard block |
||
| 97 | 97 | if ($this->rsm->isMixed && isset($this->rootAliases[$parent])) { |
| 98 | 98 | $first = reset($this->resultPointers); |
| 99 | 99 | // TODO: Exception if $key === null ? |
| 100 | - $baseElement =& $this->resultPointers[$parent][key($first)]; |
|
| 100 | + $baseElement = & $this->resultPointers[$parent][key($first)]; |
|
| 101 | 101 | } elseif (isset($this->resultPointers[$parent])) { |
| 102 | - $baseElement =& $this->resultPointers[$parent]; |
|
| 102 | + $baseElement = & $this->resultPointers[$parent]; |
|
| 103 | 103 | } else { |
| 104 | 104 | unset($this->resultPointers[$dqlAlias]); // Ticket #1228 |
| 105 | 105 | |
@@ -111,10 +111,10 @@ discard block |
||
| 111 | 111 | $relation = $parentClass->getProperty($relationAlias); |
| 112 | 112 | |
| 113 | 113 | // Check the type of the relation (many or single-valued) |
| 114 | - if (! $relation instanceof ToOneAssociationMetadata) { |
|
| 114 | + if ( ! $relation instanceof ToOneAssociationMetadata) { |
|
| 115 | 115 | $oneToOne = false; |
| 116 | 116 | |
| 117 | - if (! isset($baseElement[$relationAlias])) { |
|
| 117 | + if ( ! isset($baseElement[$relationAlias])) { |
|
| 118 | 118 | $baseElement[$relationAlias] = []; |
| 119 | 119 | } |
| 120 | 120 | |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | $index = $indexExists ? $this->identifierMap[$path][$id[$parent]][$id[$dqlAlias]] : false; |
| 124 | 124 | $indexIsValid = $index !== false ? isset($baseElement[$relationAlias][$index]) : false; |
| 125 | 125 | |
| 126 | - if (! $indexExists || ! $indexIsValid) { |
|
| 126 | + if ( ! $indexExists || ! $indexIsValid) { |
|
| 127 | 127 | $element = $data; |
| 128 | 128 | |
| 129 | 129 | if (isset($this->rsm->indexByMap[$dqlAlias])) { |
@@ -140,16 +140,16 @@ discard block |
||
| 140 | 140 | } else { |
| 141 | 141 | $oneToOne = true; |
| 142 | 142 | |
| 143 | - if (! isset($nonemptyComponents[$dqlAlias]) && |
|
| 143 | + if ( ! isset($nonemptyComponents[$dqlAlias]) && |
|
| 144 | 144 | ( ! isset($baseElement[$relationAlias])) |
| 145 | 145 | ) { |
| 146 | 146 | $baseElement[$relationAlias] = null; |
| 147 | - } elseif (! isset($baseElement[$relationAlias])) { |
|
| 147 | + } elseif ( ! isset($baseElement[$relationAlias])) { |
|
| 148 | 148 | $baseElement[$relationAlias] = $data; |
| 149 | 149 | } |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | - $coll =& $baseElement[$relationAlias]; |
|
| 152 | + $coll = & $baseElement[$relationAlias]; |
|
| 153 | 153 | |
| 154 | 154 | if (is_array($coll)) { |
| 155 | 155 | $this->updateResultPointer($coll, $index, $dqlAlias, $oneToOne); |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | $entityKey = $this->rsm->entityMappings[$dqlAlias] ?: 0; |
| 162 | 162 | |
| 163 | 163 | // if this row has a NULL value for the root result id then make it a null result. |
| 164 | - if (! isset($nonemptyComponents[$dqlAlias])) { |
|
| 164 | + if ( ! isset($nonemptyComponents[$dqlAlias])) { |
|
| 165 | 165 | $result[] = $this->rsm->isMixed |
| 166 | 166 | ? [$entityKey => null] |
| 167 | 167 | : null; |
@@ -198,13 +198,13 @@ discard block |
||
| 198 | 198 | } |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | - if (! isset($resultKey)) { |
|
| 201 | + if ( ! isset($resultKey)) { |
|
| 202 | 202 | $this->resultCounter++; |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | // Append scalar values to mixed result sets |
| 206 | 206 | if (isset($rowData['scalars'])) { |
| 207 | - if (! isset($resultKey)) { |
|
| 207 | + if ( ! isset($resultKey)) { |
|
| 208 | 208 | // this only ever happens when no object is fetched (scalar result only) |
| 209 | 209 | $resultKey = isset($this->rsm->indexByMap['scalars']) |
| 210 | 210 | ? $row[$this->rsm->indexByMap['scalars']] |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | |
| 219 | 219 | // Append new object to mixed result sets |
| 220 | 220 | if (isset($rowData['newObjects'])) { |
| 221 | - if (! isset($resultKey)) { |
|
| 221 | + if ( ! isset($resultKey)) { |
|
| 222 | 222 | $resultKey = $this->resultCounter - 1; |
| 223 | 223 | } |
| 224 | 224 | |
@@ -259,22 +259,22 @@ discard block |
||
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | if ($oneToOne) { |
| 262 | - $this->resultPointers[$dqlAlias] =& $coll; |
|
| 262 | + $this->resultPointers[$dqlAlias] = & $coll; |
|
| 263 | 263 | |
| 264 | 264 | return; |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 | if ($index !== false) { |
| 268 | - $this->resultPointers[$dqlAlias] =& $coll[$index]; |
|
| 268 | + $this->resultPointers[$dqlAlias] = & $coll[$index]; |
|
| 269 | 269 | |
| 270 | 270 | return; |
| 271 | 271 | } |
| 272 | 272 | |
| 273 | - if (! $coll) { |
|
| 273 | + if ( ! $coll) { |
|
| 274 | 274 | return; |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | end($coll); |
| 278 | - $this->resultPointers[$dqlAlias] =& $coll[key($coll)]; |
|
| 278 | + $this->resultPointers[$dqlAlias] = & $coll[key($coll)]; |
|
| 279 | 279 | } |
| 280 | 280 | } |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | public static function pathRequired() |
| 24 | 24 | { |
| 25 | - return new self('Specifying the paths to your entities is required ' . |
|
| 25 | + return new self('Specifying the paths to your entities is required '. |
|
| 26 | 26 | 'in the AnnotationDriver to retrieve all class names.'); |
| 27 | 27 | } |
| 28 | 28 | |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | */ |
| 213 | 213 | public static function missingQueryMapping($entity, $queryName) |
| 214 | 214 | { |
| 215 | - return new self('Query named "' . $queryName . '" in "' . $entity . ' requires a result class or result set mapping.'); |
|
| 215 | + return new self('Query named "'.$queryName.'" in "'.$entity.' requires a result class or result set mapping.'); |
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | /** |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | */ |
| 224 | 224 | public static function missingResultSetMappingEntity($entity, $resultName) |
| 225 | 225 | { |
| 226 | - return new self('Result set mapping named "' . $resultName . '" in "' . $entity . ' requires a entity class name.'); |
|
| 226 | + return new self('Result set mapping named "'.$resultName.'" in "'.$entity.' requires a entity class name.'); |
|
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | /** |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | */ |
| 235 | 235 | public static function missingResultSetMappingFieldName($entity, $resultName) |
| 236 | 236 | { |
| 237 | - return new self('Result set mapping named "' . $resultName . '" in "' . $entity . ' requires a field name.'); |
|
| 237 | + return new self('Result set mapping named "'.$resultName.'" in "'.$entity.' requires a field name.'); |
|
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | /** |
@@ -281,8 +281,8 @@ discard block |
||
| 281 | 281 | { |
| 282 | 282 | $message = sprintf("The mapping of field '%s' is invalid: The option '%s' is required.", $field, $expectedOption); |
| 283 | 283 | |
| 284 | - if (! empty($hint)) { |
|
| 285 | - $message .= ' (Hint: ' . $hint . ')'; |
|
| 284 | + if ( ! empty($hint)) { |
|
| 285 | + $message .= ' (Hint: '.$hint.')'; |
|
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | return new self($message); |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | */ |
| 312 | 312 | public static function reflectionFailure($entity, ReflectionException $previousException) |
| 313 | 313 | { |
| 314 | - return new self('An error occurred in ' . $entity, 0, $previousException); |
|
| 314 | + return new self('An error occurred in '.$entity, 0, $previousException); |
|
| 315 | 315 | } |
| 316 | 316 | |
| 317 | 317 | /** |
@@ -322,8 +322,8 @@ discard block |
||
| 322 | 322 | */ |
| 323 | 323 | public static function joinColumnMustPointToMappedField($className, $joinColumn) |
| 324 | 324 | { |
| 325 | - return new self('The column ' . $joinColumn . ' must be mapped to a field in class ' |
|
| 326 | - . $className . ' since it is referenced by a join column of another class.'); |
|
| 325 | + return new self('The column '.$joinColumn.' must be mapped to a field in class ' |
|
| 326 | + . $className.' since it is referenced by a join column of another class.'); |
|
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | /** |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | */ |
| 358 | 358 | public static function propertyTypeIsRequired($className, $propertyName) |
| 359 | 359 | { |
| 360 | - return new self("The attribute 'type' is required for the column description of property " . $className . '::$' . $propertyName . '.'); |
|
| 360 | + return new self("The attribute 'type' is required for the column description of property ".$className.'::$'.$propertyName.'.'); |
|
| 361 | 361 | } |
| 362 | 362 | |
| 363 | 363 | /** |
@@ -367,7 +367,7 @@ discard block |
||
| 367 | 367 | */ |
| 368 | 368 | public static function tableIdGeneratorNotImplemented($className) |
| 369 | 369 | { |
| 370 | - return new self('TableIdGenerator is not yet implemented for use with class ' . $className); |
|
| 370 | + return new self('TableIdGenerator is not yet implemented for use with class '.$className); |
|
| 371 | 371 | } |
| 372 | 372 | |
| 373 | 373 | /** |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | */ |
| 394 | 394 | public static function duplicateQueryMapping($entity, $queryName) |
| 395 | 395 | { |
| 396 | - return new self('Query named "' . $queryName . '" in "' . $entity . '" was already declared, but it must be declared only once'); |
|
| 396 | + return new self('Query named "'.$queryName.'" in "'.$entity.'" was already declared, but it must be declared only once'); |
|
| 397 | 397 | } |
| 398 | 398 | |
| 399 | 399 | /** |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | */ |
| 405 | 405 | public static function duplicateResultSetMapping($entity, $resultName) |
| 406 | 406 | { |
| 407 | - return new self('Result set mapping named "' . $resultName . '" in "' . $entity . '" was already declared, but it must be declared only once'); |
|
| 407 | + return new self('Result set mapping named "'.$resultName.'" in "'.$entity.'" was already declared, but it must be declared only once'); |
|
| 408 | 408 | } |
| 409 | 409 | |
| 410 | 410 | /** |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | */ |
| 415 | 415 | public static function singleIdNotAllowedOnCompositePrimaryKey($entity) |
| 416 | 416 | { |
| 417 | - return new self('Single id is not allowed on composite primary key in entity ' . $entity); |
|
| 417 | + return new self('Single id is not allowed on composite primary key in entity '.$entity); |
|
| 418 | 418 | } |
| 419 | 419 | |
| 420 | 420 | /** |
@@ -424,7 +424,7 @@ discard block |
||
| 424 | 424 | */ |
| 425 | 425 | public static function noIdDefined($entity) |
| 426 | 426 | { |
| 427 | - return new self('No ID defined for entity ' . $entity); |
|
| 427 | + return new self('No ID defined for entity '.$entity); |
|
| 428 | 428 | } |
| 429 | 429 | |
| 430 | 430 | /** |
@@ -434,7 +434,7 @@ discard block |
||
| 434 | 434 | */ |
| 435 | 435 | public static function unsupportedOptimisticLockingType($unsupportedType) |
| 436 | 436 | { |
| 437 | - return new self('Locking type "' . $unsupportedType . '" is not supported by Doctrine.'); |
|
| 437 | + return new self('Locking type "'.$unsupportedType.'" is not supported by Doctrine.'); |
|
| 438 | 438 | } |
| 439 | 439 | |
| 440 | 440 | /** |
@@ -444,13 +444,13 @@ discard block |
||
| 444 | 444 | */ |
| 445 | 445 | public static function fileMappingDriversRequireConfiguredDirectoryPath($path = null) |
| 446 | 446 | { |
| 447 | - if (! empty($path)) { |
|
| 448 | - $path = '[' . $path . ']'; |
|
| 447 | + if ( ! empty($path)) { |
|
| 448 | + $path = '['.$path.']'; |
|
| 449 | 449 | } |
| 450 | 450 | |
| 451 | 451 | return new self( |
| 452 | - 'File mapping drivers must have a valid directory path, ' . |
|
| 453 | - 'however the given path ' . $path . ' seems to be incorrect!' |
|
| 452 | + 'File mapping drivers must have a valid directory path, '. |
|
| 453 | + 'however the given path '.$path.' seems to be incorrect!' |
|
| 454 | 454 | ); |
| 455 | 455 | } |
| 456 | 456 | |
@@ -466,7 +466,7 @@ discard block |
||
| 466 | 466 | public static function invalidClassInDiscriminatorMap($className, $owningClass) |
| 467 | 467 | { |
| 468 | 468 | return new self(sprintf( |
| 469 | - "Entity class '%s' used in the discriminator map of class '%s' " . |
|
| 469 | + "Entity class '%s' used in the discriminator map of class '%s' ". |
|
| 470 | 470 | 'does not exist.', |
| 471 | 471 | $className, |
| 472 | 472 | $owningClass |
@@ -532,7 +532,7 @@ discard block |
||
| 532 | 532 | public static function sqlConversionNotAllowedForPrimaryKeyProperties($className, Property $property) |
| 533 | 533 | { |
| 534 | 534 | return new self(sprintf( |
| 535 | - 'It is not possible to set id field "%s" to type "%s" in entity class "%s". ' . |
|
| 535 | + 'It is not possible to set id field "%s" to type "%s" in entity class "%s". '. |
|
| 536 | 536 | 'The type "%s" requires conversion SQL which is not allowed for identifiers.', |
| 537 | 537 | $property->getName(), |
| 538 | 538 | $property->getTypeName(), |
@@ -568,7 +568,7 @@ discard block |
||
| 568 | 568 | */ |
| 569 | 569 | public static function duplicateColumnName($className, $columnName) |
| 570 | 570 | { |
| 571 | - return new self("Duplicate definition of column '" . $columnName . "' on entity '" . $className . "' in a field or discriminator column mapping."); |
|
| 571 | + return new self("Duplicate definition of column '".$columnName."' on entity '".$className."' in a field or discriminator column mapping."); |
|
| 572 | 572 | } |
| 573 | 573 | |
| 574 | 574 | /** |
@@ -579,7 +579,7 @@ discard block |
||
| 579 | 579 | */ |
| 580 | 580 | public static function illegalToManyAssociationOnMappedSuperclass($className, $field) |
| 581 | 581 | { |
| 582 | - return new self("It is illegal to put an inverse side one-to-many or many-to-many association on mapped superclass '" . $className . '#' . $field . "'."); |
|
| 582 | + return new self("It is illegal to put an inverse side one-to-many or many-to-many association on mapped superclass '".$className.'#'.$field."'."); |
|
| 583 | 583 | } |
| 584 | 584 | |
| 585 | 585 | /** |
@@ -591,8 +591,8 @@ discard block |
||
| 591 | 591 | */ |
| 592 | 592 | public static function cannotMapCompositePrimaryKeyEntitiesAsForeignId($className, $targetEntity, $targetField) |
| 593 | 593 | { |
| 594 | - return new self("It is not possible to map entity '" . $className . "' with a composite primary key " . |
|
| 595 | - "as part of the primary key of another entity '" . $targetEntity . '#' . $targetField . "'."); |
|
| 594 | + return new self("It is not possible to map entity '".$className."' with a composite primary key ". |
|
| 595 | + "as part of the primary key of another entity '".$targetEntity.'#'.$targetField."'."); |
|
| 596 | 596 | } |
| 597 | 597 | |
| 598 | 598 | /** |
@@ -646,8 +646,8 @@ discard block |
||
| 646 | 646 | */ |
| 647 | 647 | public static function illegalOrphanRemoval($className, $field) |
| 648 | 648 | { |
| 649 | - return new self('Orphan removal is only allowed on one-to-one and one-to-many ' . |
|
| 650 | - 'associations, but ' . $className . '#' . $field . ' is not.'); |
|
| 649 | + return new self('Orphan removal is only allowed on one-to-one and one-to-many '. |
|
| 650 | + 'associations, but '.$className.'#'.$field.' is not.'); |
|
| 651 | 651 | } |
| 652 | 652 | |
| 653 | 653 | /** |
@@ -679,7 +679,7 @@ discard block |
||
| 679 | 679 | */ |
| 680 | 680 | public static function noInheritanceOnMappedSuperClass($className) |
| 681 | 681 | { |
| 682 | - return new self("It is not supported to define inheritance information on a mapped superclass '" . $className . "'."); |
|
| 682 | + return new self("It is not supported to define inheritance information on a mapped superclass '".$className."'."); |
|
| 683 | 683 | } |
| 684 | 684 | |
| 685 | 685 | /** |
@@ -691,8 +691,8 @@ discard block |
||
| 691 | 691 | public static function mappedClassNotPartOfDiscriminatorMap($className, $rootClassName) |
| 692 | 692 | { |
| 693 | 693 | return new self( |
| 694 | - "Entity '" . $className . "' has to be part of the discriminator map of '" . $rootClassName . "' " . |
|
| 695 | - "to be properly mapped in the inheritance hierarchy. Alternatively you can make '" . $className . "' an abstract class " . |
|
| 694 | + "Entity '".$className."' has to be part of the discriminator map of '".$rootClassName."' ". |
|
| 695 | + "to be properly mapped in the inheritance hierarchy. Alternatively you can make '".$className."' an abstract class ". |
|
| 696 | 696 | 'to avoid this exception from occurring.' |
| 697 | 697 | ); |
| 698 | 698 | } |
@@ -705,7 +705,7 @@ discard block |
||
| 705 | 705 | */ |
| 706 | 706 | public static function lifecycleCallbackMethodNotFound($className, $methodName) |
| 707 | 707 | { |
| 708 | - return new self("Entity '" . $className . "' has no method '" . $methodName . "' to be registered as lifecycle callback."); |
|
| 708 | + return new self("Entity '".$className."' has no method '".$methodName."' to be registered as lifecycle callback."); |
|
| 709 | 709 | } |
| 710 | 710 | |
| 711 | 711 | /** |
@@ -751,7 +751,7 @@ discard block |
||
| 751 | 751 | */ |
| 752 | 752 | public static function invalidFetchMode($className, $annotation) |
| 753 | 753 | { |
| 754 | - return new self("Entity '" . $className . "' has a mapping with invalid fetch mode '" . $annotation . "'"); |
|
| 754 | + return new self("Entity '".$className."' has a mapping with invalid fetch mode '".$annotation."'"); |
|
| 755 | 755 | } |
| 756 | 756 | |
| 757 | 757 | /** |
@@ -761,7 +761,7 @@ discard block |
||
| 761 | 761 | */ |
| 762 | 762 | public static function compositeKeyAssignedIdGeneratorRequired($className) |
| 763 | 763 | { |
| 764 | - return new self("Entity '" . $className . "' has a composite identifier but uses an ID generator other than manually assigning (Identity, Sequence). This is not supported."); |
|
| 764 | + return new self("Entity '".$className."' has a composite identifier but uses an ID generator other than manually assigning (Identity, Sequence). This is not supported."); |
|
| 765 | 765 | } |
| 766 | 766 | |
| 767 | 767 | /** |
@@ -773,7 +773,7 @@ discard block |
||
| 773 | 773 | */ |
| 774 | 774 | public static function invalidTargetEntityClass($targetEntity, $sourceEntity, $associationName) |
| 775 | 775 | { |
| 776 | - return new self("The target-entity '" . $targetEntity . "' cannot be found in '" . $sourceEntity . '#' . $associationName . "'."); |
|
| 776 | + return new self("The target-entity '".$targetEntity."' cannot be found in '".$sourceEntity.'#'.$associationName."'."); |
|
| 777 | 777 | } |
| 778 | 778 | |
| 779 | 779 | /** |
@@ -785,8 +785,8 @@ discard block |
||
| 785 | 785 | */ |
| 786 | 786 | public static function invalidCascadeOption(array $cascades, $className, $propertyName) |
| 787 | 787 | { |
| 788 | - $cascades = implode(', ', array_map(static function ($e) { |
|
| 789 | - return "'" . $e . "'"; |
|
| 788 | + $cascades = implode(', ', array_map(static function($e) { |
|
| 789 | + return "'".$e."'"; |
|
| 790 | 790 | }, $cascades)); |
| 791 | 791 | |
| 792 | 792 | return new self(sprintf( |
@@ -819,7 +819,7 @@ discard block |
||
| 819 | 819 | { |
| 820 | 820 | return new self( |
| 821 | 821 | sprintf( |
| 822 | - 'Infinite nesting detected for embedded property %s::%s. ' . |
|
| 822 | + 'Infinite nesting detected for embedded property %s::%s. '. |
|
| 823 | 823 | 'You cannot embed an embeddable from the same type inside an embeddable.', |
| 824 | 824 | $className, |
| 825 | 825 | $propertyName |
@@ -834,7 +834,7 @@ discard block |
||
| 834 | 834 | { |
| 835 | 835 | return new self( |
| 836 | 836 | sprintf( |
| 837 | - 'Class %s not found in namespaces %s.' . |
|
| 837 | + 'Class %s not found in namespaces %s.'. |
|
| 838 | 838 | $className, |
| 839 | 839 | implode(', ', $namespaces) |
| 840 | 840 | ) |
@@ -272,10 +272,10 @@ discard block |
||
| 272 | 272 | */ |
| 273 | 273 | public function getSQLTableAlias($tableName, $dqlAlias = '') |
| 274 | 274 | { |
| 275 | - $tableName .= $dqlAlias ? '@[' . $dqlAlias . ']' : ''; |
|
| 275 | + $tableName .= $dqlAlias ? '@['.$dqlAlias.']' : ''; |
|
| 276 | 276 | |
| 277 | - if (! isset($this->tableAliasMap[$tableName])) { |
|
| 278 | - $this->tableAliasMap[$tableName] = 't' . $this->tableAliasCounter++; |
|
| 277 | + if ( ! isset($this->tableAliasMap[$tableName])) { |
|
| 278 | + $this->tableAliasMap[$tableName] = 't'.$this->tableAliasCounter++; |
|
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | return $this->tableAliasMap[$tableName]; |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | */ |
| 294 | 294 | public function setSQLTableAlias($tableName, $alias, $dqlAlias = '') |
| 295 | 295 | { |
| 296 | - $tableName .= $dqlAlias ? '@[' . $dqlAlias . ']' : ''; |
|
| 296 | + $tableName .= $dqlAlias ? '@['.$dqlAlias.']' : ''; |
|
| 297 | 297 | |
| 298 | 298 | $this->tableAliasMap[$tableName] = $alias; |
| 299 | 299 | |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | */ |
| 308 | 308 | public function getSQLColumnAlias() |
| 309 | 309 | { |
| 310 | - return $this->platform->getSQLResultCasing('c' . $this->aliasCounter++); |
|
| 310 | + return $this->platform->getSQLResultCasing('c'.$this->aliasCounter++); |
|
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | /** |
@@ -334,14 +334,14 @@ discard block |
||
| 334 | 334 | |
| 335 | 335 | // If this is a joined association we must use left joins to preserve the correct result. |
| 336 | 336 | $sql .= isset($this->queryComponents[$dqlAlias]['relation']) ? ' LEFT ' : ' INNER '; |
| 337 | - $sql .= 'JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
| 337 | + $sql .= 'JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
| 338 | 338 | |
| 339 | 339 | $sqlParts = []; |
| 340 | 340 | |
| 341 | 341 | foreach ($class->getIdentifierColumns($this->em) as $column) { |
| 342 | 342 | $quotedColumnName = $this->platform->quoteIdentifier($column->getColumnName()); |
| 343 | 343 | |
| 344 | - $sqlParts[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
| 344 | + $sqlParts[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | $filterSql = $this->generateFilterConditionSQL($parentClass, $tableAlias); |
@@ -365,14 +365,14 @@ discard block |
||
| 365 | 365 | $tableName = $subClass->table->getQuotedQualifiedName($this->platform); |
| 366 | 366 | $tableAlias = $this->getSQLTableAlias($subClass->getTableName(), $dqlAlias); |
| 367 | 367 | |
| 368 | - $sql .= ' LEFT JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
| 368 | + $sql .= ' LEFT JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
| 369 | 369 | |
| 370 | 370 | $sqlParts = []; |
| 371 | 371 | |
| 372 | 372 | foreach ($subClass->getIdentifierColumns($this->em) as $column) { |
| 373 | 373 | $quotedColumnName = $this->platform->quoteIdentifier($column->getColumnName()); |
| 374 | 374 | |
| 375 | - $sqlParts[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
| 375 | + $sqlParts[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | $sql .= implode(' AND ', $sqlParts); |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | $qComp = $this->queryComponents[$dqlAlias]; |
| 394 | 394 | $association = $qComp['relation']; |
| 395 | 395 | |
| 396 | - if (! ($association instanceof ToManyAssociationMetadata)) { |
|
| 396 | + if ( ! ($association instanceof ToManyAssociationMetadata)) { |
|
| 397 | 397 | continue; |
| 398 | 398 | } |
| 399 | 399 | |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | $property = $qComp['metadata']->getProperty($fieldName); |
| 402 | 402 | $tableName = $property->getTableName(); |
| 403 | 403 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
| 404 | - $orderedColumn = $this->getSQLTableAlias($tableName, $dqlAlias) . '.' . $columnName; |
|
| 404 | + $orderedColumn = $this->getSQLTableAlias($tableName, $dqlAlias).'.'.$columnName; |
|
| 405 | 405 | |
| 406 | 406 | // OrderByClause should replace an ordered relation. see - DDC-2475 |
| 407 | 407 | if (isset($this->orderedColumnsMap[$orderedColumn])) { |
@@ -409,7 +409,7 @@ discard block |
||
| 409 | 409 | } |
| 410 | 410 | |
| 411 | 411 | $this->orderedColumnsMap[$orderedColumn] = $orientation; |
| 412 | - $orderedColumns[] = $orderedColumn . ' ' . $orientation; |
|
| 412 | + $orderedColumns[] = $orderedColumn.' '.$orientation; |
|
| 413 | 413 | } |
| 414 | 414 | } |
| 415 | 415 | |
@@ -449,19 +449,19 @@ discard block |
||
| 449 | 449 | $discrColumnType = $discrColumn->getType(); |
| 450 | 450 | $quotedColumnName = $this->platform->quoteIdentifier($discrColumn->getColumnName()); |
| 451 | 451 | $sqlTableAlias = $this->useSqlTableAliases |
| 452 | - ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias) . '.' |
|
| 452 | + ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias).'.' |
|
| 453 | 453 | : ''; |
| 454 | 454 | |
| 455 | 455 | $sqlParts[] = sprintf( |
| 456 | 456 | '%s IN (%s)', |
| 457 | - $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . $quotedColumnName, $this->platform), |
|
| 457 | + $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.$quotedColumnName, $this->platform), |
|
| 458 | 458 | implode(', ', $values) |
| 459 | 459 | ); |
| 460 | 460 | } |
| 461 | 461 | |
| 462 | 462 | $sql = implode(' AND ', $sqlParts); |
| 463 | 463 | |
| 464 | - return isset($sqlParts[1]) ? '(' . $sql . ')' : $sql; |
|
| 464 | + return isset($sqlParts[1]) ? '('.$sql.')' : $sql; |
|
| 465 | 465 | } |
| 466 | 466 | |
| 467 | 467 | /** |
@@ -474,7 +474,7 @@ discard block |
||
| 474 | 474 | */ |
| 475 | 475 | private function generateFilterConditionSQL(ClassMetadata $targetEntity, $targetTableAlias) |
| 476 | 476 | { |
| 477 | - if (! $this->em->hasFilters()) { |
|
| 477 | + if ( ! $this->em->hasFilters()) { |
|
| 478 | 478 | return ''; |
| 479 | 479 | } |
| 480 | 480 | |
@@ -507,7 +507,7 @@ discard block |
||
| 507 | 507 | $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias); |
| 508 | 508 | |
| 509 | 509 | if ($filterExpr !== '') { |
| 510 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
| 510 | + $filterClauses[] = '('.$filterExpr.')'; |
|
| 511 | 511 | } |
| 512 | 512 | } |
| 513 | 513 | |
@@ -538,11 +538,11 @@ discard block |
||
| 538 | 538 | $sql .= $this->walkOrderByClause($AST->orderByClause); |
| 539 | 539 | } |
| 540 | 540 | |
| 541 | - if (! $AST->orderByClause) { |
|
| 541 | + if ( ! $AST->orderByClause) { |
|
| 542 | 542 | $orderBySql = $this->generateOrderedCollectionOrderByItems(); |
| 543 | 543 | |
| 544 | 544 | if ($orderBySql) { |
| 545 | - $sql .= ' ORDER BY ' . $orderBySql; |
|
| 545 | + $sql .= ' ORDER BY '.$orderBySql; |
|
| 546 | 546 | } |
| 547 | 547 | } |
| 548 | 548 | |
@@ -555,11 +555,11 @@ discard block |
||
| 555 | 555 | } |
| 556 | 556 | |
| 557 | 557 | if ($lockMode === LockMode::PESSIMISTIC_READ) { |
| 558 | - return $sql . ' ' . $this->platform->getReadLockSQL(); |
|
| 558 | + return $sql.' '.$this->platform->getReadLockSQL(); |
|
| 559 | 559 | } |
| 560 | 560 | |
| 561 | 561 | if ($lockMode === LockMode::PESSIMISTIC_WRITE) { |
| 562 | - return $sql . ' ' . $this->platform->getWriteLockSQL(); |
|
| 562 | + return $sql.' '.$this->platform->getWriteLockSQL(); |
|
| 563 | 563 | } |
| 564 | 564 | |
| 565 | 565 | if ($lockMode !== LockMode::OPTIMISTIC) { |
@@ -567,7 +567,7 @@ discard block |
||
| 567 | 567 | } |
| 568 | 568 | |
| 569 | 569 | foreach ($this->selectedClasses as $selectedClass) { |
| 570 | - if (! $selectedClass['class']->isVersioned()) { |
|
| 570 | + if ( ! $selectedClass['class']->isVersioned()) { |
|
| 571 | 571 | throw OptimisticLockException::lockFailed($selectedClass['class']->getClassName()); |
| 572 | 572 | } |
| 573 | 573 | } |
@@ -616,7 +616,7 @@ discard block |
||
| 616 | 616 | foreach ($class->getIdentifierColumns($this->em) as $column) { |
| 617 | 617 | $quotedColumnName = $this->platform->quoteIdentifier($column->getColumnName()); |
| 618 | 618 | |
| 619 | - $sqlParts[] = $tableAlias . '.' . $quotedColumnName; |
|
| 619 | + $sqlParts[] = $tableAlias.'.'.$quotedColumnName; |
|
| 620 | 620 | } |
| 621 | 621 | |
| 622 | 622 | return implode(', ', $sqlParts); |
@@ -634,7 +634,7 @@ discard block |
||
| 634 | 634 | { |
| 635 | 635 | $class = $this->queryComponents[$identificationVariable]['metadata']; |
| 636 | 636 | |
| 637 | - if (! $fieldName) { |
|
| 637 | + if ( ! $fieldName) { |
|
| 638 | 638 | return $this->getSQLTableAlias($class->getTableName(), $identificationVariable); |
| 639 | 639 | } |
| 640 | 640 | |
@@ -663,7 +663,7 @@ discard block |
||
| 663 | 663 | $property = $class->getProperty($fieldName); |
| 664 | 664 | |
| 665 | 665 | if ($this->useSqlTableAliases) { |
| 666 | - $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName) . '.'; |
|
| 666 | + $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName).'.'; |
|
| 667 | 667 | } |
| 668 | 668 | |
| 669 | 669 | $sql .= $this->platform->quoteIdentifier($property->getColumnName()); |
@@ -677,7 +677,7 @@ discard block |
||
| 677 | 677 | $class = $this->queryComponents[$dqlAlias]['metadata']; |
| 678 | 678 | $association = $class->getProperty($fieldName); |
| 679 | 679 | |
| 680 | - if (! $association->isOwningSide()) { |
|
| 680 | + if ( ! $association->isOwningSide()) { |
|
| 681 | 681 | throw QueryException::associationPathInverseSideNotSupported($pathExpr); |
| 682 | 682 | } |
| 683 | 683 | |
@@ -691,7 +691,7 @@ discard block |
||
| 691 | 691 | $joinColumn = reset($joinColumns); |
| 692 | 692 | |
| 693 | 693 | if ($this->useSqlTableAliases) { |
| 694 | - $sql .= $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias) . '.'; |
|
| 694 | + $sql .= $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias).'.'; |
|
| 695 | 695 | } |
| 696 | 696 | |
| 697 | 697 | $sql .= $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
@@ -709,7 +709,7 @@ discard block |
||
| 709 | 709 | */ |
| 710 | 710 | public function walkSelectClause($selectClause) |
| 711 | 711 | { |
| 712 | - $sql = 'SELECT ' . ($selectClause->isDistinct ? 'DISTINCT ' : ''); |
|
| 712 | + $sql = 'SELECT '.($selectClause->isDistinct ? 'DISTINCT ' : ''); |
|
| 713 | 713 | $sqlSelectExpressions = array_filter(array_map([$this, 'walkSelectExpression'], $selectClause->selectExpressions)); |
| 714 | 714 | |
| 715 | 715 | if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) === true && $selectClause->isDistinct) { |
@@ -752,7 +752,7 @@ discard block |
||
| 752 | 752 | |
| 753 | 753 | $sqlSelectExpressions[] = sprintf( |
| 754 | 754 | '%s AS %s', |
| 755 | - $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . '.' . $quotedColumnName, $this->platform), |
|
| 755 | + $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.'.'.$quotedColumnName, $this->platform), |
|
| 756 | 756 | $sqlColumnAlias |
| 757 | 757 | ); |
| 758 | 758 | |
@@ -762,7 +762,7 @@ discard block |
||
| 762 | 762 | |
| 763 | 763 | // Add foreign key columns of class and also parent classes |
| 764 | 764 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
| 765 | - if (! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide()) |
|
| 765 | + if ( ! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide()) |
|
| 766 | 766 | || ( ! $addMetaColumns && ! $association->isPrimaryKey())) { |
| 767 | 767 | continue; |
| 768 | 768 | } |
@@ -777,7 +777,7 @@ discard block |
||
| 777 | 777 | $columnAlias = $this->getSQLColumnAlias(); |
| 778 | 778 | $sqlTableAlias = $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias); |
| 779 | 779 | |
| 780 | - if (! $joinColumn->getType()) { |
|
| 780 | + if ( ! $joinColumn->getType()) { |
|
| 781 | 781 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 782 | 782 | } |
| 783 | 783 | |
@@ -793,7 +793,7 @@ discard block |
||
| 793 | 793 | } |
| 794 | 794 | |
| 795 | 795 | // Add foreign key columns to SQL, if necessary |
| 796 | - if (! $addMetaColumns) { |
|
| 796 | + if ( ! $addMetaColumns) { |
|
| 797 | 797 | continue; |
| 798 | 798 | } |
| 799 | 799 | |
@@ -807,7 +807,7 @@ discard block |
||
| 807 | 807 | continue; |
| 808 | 808 | } |
| 809 | 809 | |
| 810 | - if (! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide())) { |
|
| 810 | + if ( ! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide())) { |
|
| 811 | 811 | continue; |
| 812 | 812 | } |
| 813 | 813 | |
@@ -821,7 +821,7 @@ discard block |
||
| 821 | 821 | $columnAlias = $this->getSQLColumnAlias(); |
| 822 | 822 | $sqlTableAlias = $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias); |
| 823 | 823 | |
| 824 | - if (! $joinColumn->getType()) { |
|
| 824 | + if ( ! $joinColumn->getType()) { |
|
| 825 | 825 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 826 | 826 | } |
| 827 | 827 | |
@@ -838,7 +838,7 @@ discard block |
||
| 838 | 838 | } |
| 839 | 839 | } |
| 840 | 840 | |
| 841 | - return $sql . implode(', ', $sqlSelectExpressions); |
|
| 841 | + return $sql.implode(', ', $sqlSelectExpressions); |
|
| 842 | 842 | } |
| 843 | 843 | |
| 844 | 844 | /** |
@@ -853,7 +853,7 @@ discard block |
||
| 853 | 853 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($identificationVariableDecl); |
| 854 | 854 | } |
| 855 | 855 | |
| 856 | - return ' FROM ' . implode(', ', $sqlParts); |
|
| 856 | + return ' FROM '.implode(', ', $sqlParts); |
|
| 857 | 857 | } |
| 858 | 858 | |
| 859 | 859 | /** |
@@ -928,7 +928,7 @@ discard block |
||
| 928 | 928 | $tableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
| 929 | 929 | |
| 930 | 930 | $sql = $this->platform->appendLockHint( |
| 931 | - $tableName . ' ' . $tableAlias, |
|
| 931 | + $tableName.' '.$tableAlias, |
|
| 932 | 932 | $this->query->getHint(Query::HINT_LOCK_MODE) |
| 933 | 933 | ); |
| 934 | 934 | |
@@ -938,11 +938,11 @@ discard block |
||
| 938 | 938 | |
| 939 | 939 | $classTableInheritanceJoins = $this->generateClassTableInheritanceJoins($class, $dqlAlias); |
| 940 | 940 | |
| 941 | - if (! $buildNestedJoins) { |
|
| 942 | - return $sql . $classTableInheritanceJoins; |
|
| 941 | + if ( ! $buildNestedJoins) { |
|
| 942 | + return $sql.$classTableInheritanceJoins; |
|
| 943 | 943 | } |
| 944 | 944 | |
| 945 | - return $classTableInheritanceJoins === '' ? $sql : '(' . $sql . $classTableInheritanceJoins . ')'; |
|
| 945 | + return $classTableInheritanceJoins === '' ? $sql : '('.$sql.$classTableInheritanceJoins.')'; |
|
| 946 | 946 | } |
| 947 | 947 | |
| 948 | 948 | /** |
@@ -978,7 +978,7 @@ discard block |
||
| 978 | 978 | : $association; |
| 979 | 979 | |
| 980 | 980 | if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) === true && |
| 981 | - (! $this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
| 981 | + ( ! $this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
| 982 | 982 | if ($association instanceof ToManyAssociationMetadata) { |
| 983 | 983 | throw QueryException::iterateWithFetchJoinNotAllowed($owningAssociation); |
| 984 | 984 | } |
@@ -1032,7 +1032,7 @@ discard block |
||
| 1032 | 1032 | } |
| 1033 | 1033 | |
| 1034 | 1034 | $targetTableJoin = [ |
| 1035 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
| 1035 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
| 1036 | 1036 | 'condition' => implode(' AND ', $conditions), |
| 1037 | 1037 | ]; |
| 1038 | 1038 | } elseif ($owningAssociation instanceof ManyToManyAssociationMetadata) { |
@@ -1059,7 +1059,7 @@ discard block |
||
| 1059 | 1059 | ); |
| 1060 | 1060 | } |
| 1061 | 1061 | |
| 1062 | - $sql .= $joinTableName . ' ' . $joinTableAlias . ' ON ' . implode(' AND ', $conditions); |
|
| 1062 | + $sql .= $joinTableName.' '.$joinTableAlias.' ON '.implode(' AND ', $conditions); |
|
| 1063 | 1063 | |
| 1064 | 1064 | // Join target table |
| 1065 | 1065 | $sql .= $joinType === AST\Join::JOIN_TYPE_LEFT || $joinType === AST\Join::JOIN_TYPE_LEFTOUTER ? ' LEFT JOIN ' : ' INNER JOIN '; |
@@ -1097,7 +1097,7 @@ discard block |
||
| 1097 | 1097 | } |
| 1098 | 1098 | |
| 1099 | 1099 | $targetTableJoin = [ |
| 1100 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
| 1100 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
| 1101 | 1101 | 'condition' => implode(' AND ', $conditions), |
| 1102 | 1102 | ]; |
| 1103 | 1103 | } else { |
@@ -1105,23 +1105,23 @@ discard block |
||
| 1105 | 1105 | } |
| 1106 | 1106 | |
| 1107 | 1107 | // Handle WITH clause |
| 1108 | - $withCondition = $condExpr === null ? '' : ('(' . $this->walkConditionalExpression($condExpr) . ')'); |
|
| 1108 | + $withCondition = $condExpr === null ? '' : ('('.$this->walkConditionalExpression($condExpr).')'); |
|
| 1109 | 1109 | |
| 1110 | 1110 | if ($targetClass->inheritanceType === InheritanceType::JOINED) { |
| 1111 | 1111 | $ctiJoins = $this->generateClassTableInheritanceJoins($targetClass, $joinedDqlAlias); |
| 1112 | 1112 | |
| 1113 | 1113 | // If we have WITH condition, we need to build nested joins for target class table and cti joins |
| 1114 | 1114 | if ($withCondition) { |
| 1115 | - $sql .= '(' . $targetTableJoin['table'] . $ctiJoins . ') ON ' . $targetTableJoin['condition']; |
|
| 1115 | + $sql .= '('.$targetTableJoin['table'].$ctiJoins.') ON '.$targetTableJoin['condition']; |
|
| 1116 | 1116 | } else { |
| 1117 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition'] . $ctiJoins; |
|
| 1117 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition'].$ctiJoins; |
|
| 1118 | 1118 | } |
| 1119 | 1119 | } else { |
| 1120 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition']; |
|
| 1120 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition']; |
|
| 1121 | 1121 | } |
| 1122 | 1122 | |
| 1123 | 1123 | if ($withCondition) { |
| 1124 | - $sql .= ' AND ' . $withCondition; |
|
| 1124 | + $sql .= ' AND '.$withCondition; |
|
| 1125 | 1125 | } |
| 1126 | 1126 | |
| 1127 | 1127 | // Apply the indexes |
@@ -1155,7 +1155,7 @@ discard block |
||
| 1155 | 1155 | $orderByItems = array_merge($orderByItems, (array) $collectionOrderByItems); |
| 1156 | 1156 | } |
| 1157 | 1157 | |
| 1158 | - return ' ORDER BY ' . implode(', ', $orderByItems); |
|
| 1158 | + return ' ORDER BY '.implode(', ', $orderByItems); |
|
| 1159 | 1159 | } |
| 1160 | 1160 | |
| 1161 | 1161 | /** |
@@ -1172,10 +1172,10 @@ discard block |
||
| 1172 | 1172 | $this->orderedColumnsMap[$sql] = $type; |
| 1173 | 1173 | |
| 1174 | 1174 | if ($expr instanceof AST\Subselect) { |
| 1175 | - return '(' . $sql . ') ' . $type; |
|
| 1175 | + return '('.$sql.') '.$type; |
|
| 1176 | 1176 | } |
| 1177 | 1177 | |
| 1178 | - return $sql . ' ' . $type; |
|
| 1178 | + return $sql.' '.$type; |
|
| 1179 | 1179 | } |
| 1180 | 1180 | |
| 1181 | 1181 | /** |
@@ -1183,7 +1183,7 @@ discard block |
||
| 1183 | 1183 | */ |
| 1184 | 1184 | public function walkHavingClause($havingClause) |
| 1185 | 1185 | { |
| 1186 | - return ' HAVING ' . $this->walkConditionalExpression($havingClause->conditionalExpression); |
|
| 1186 | + return ' HAVING '.$this->walkConditionalExpression($havingClause->conditionalExpression); |
|
| 1187 | 1187 | } |
| 1188 | 1188 | |
| 1189 | 1189 | /** |
@@ -1206,7 +1206,7 @@ discard block |
||
| 1206 | 1206 | $conditions = []; |
| 1207 | 1207 | |
| 1208 | 1208 | if ($join->conditionalExpression) { |
| 1209 | - $conditions[] = '(' . $this->walkConditionalExpression($join->conditionalExpression) . ')'; |
|
| 1209 | + $conditions[] = '('.$this->walkConditionalExpression($join->conditionalExpression).')'; |
|
| 1210 | 1210 | } |
| 1211 | 1211 | |
| 1212 | 1212 | $isUnconditionalJoin = empty($conditions); |
@@ -1231,7 +1231,7 @@ discard block |
||
| 1231 | 1231 | } |
| 1232 | 1232 | |
| 1233 | 1233 | if ($conditions) { |
| 1234 | - $sql .= $condExprConjunction . implode(' AND ', $conditions); |
|
| 1234 | + $sql .= $condExprConjunction.implode(' AND ', $conditions); |
|
| 1235 | 1235 | } |
| 1236 | 1236 | |
| 1237 | 1237 | break; |
@@ -1261,7 +1261,7 @@ discard block |
||
| 1261 | 1261 | $scalarExpressions[] = $this->walkSimpleArithmeticExpression($scalarExpression); |
| 1262 | 1262 | } |
| 1263 | 1263 | |
| 1264 | - return $sql . implode(', ', $scalarExpressions) . ')'; |
|
| 1264 | + return $sql.implode(', ', $scalarExpressions).')'; |
|
| 1265 | 1265 | } |
| 1266 | 1266 | |
| 1267 | 1267 | /** |
@@ -1281,7 +1281,7 @@ discard block |
||
| 1281 | 1281 | ? $this->conn->quote($nullIfExpression->secondExpression) |
| 1282 | 1282 | : $this->walkSimpleArithmeticExpression($nullIfExpression->secondExpression); |
| 1283 | 1283 | |
| 1284 | - return 'NULLIF(' . $firstExpression . ', ' . $secondExpression . ')'; |
|
| 1284 | + return 'NULLIF('.$firstExpression.', '.$secondExpression.')'; |
|
| 1285 | 1285 | } |
| 1286 | 1286 | |
| 1287 | 1287 | /** |
@@ -1294,11 +1294,11 @@ discard block |
||
| 1294 | 1294 | $sql = 'CASE'; |
| 1295 | 1295 | |
| 1296 | 1296 | foreach ($generalCaseExpression->whenClauses as $whenClause) { |
| 1297 | - $sql .= ' WHEN ' . $this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
| 1298 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
| 1297 | + $sql .= ' WHEN '.$this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
| 1298 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
| 1299 | 1299 | } |
| 1300 | 1300 | |
| 1301 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression) . ' END'; |
|
| 1301 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression).' END'; |
|
| 1302 | 1302 | |
| 1303 | 1303 | return $sql; |
| 1304 | 1304 | } |
@@ -1312,14 +1312,14 @@ discard block |
||
| 1312 | 1312 | */ |
| 1313 | 1313 | public function walkSimpleCaseExpression($simpleCaseExpression) |
| 1314 | 1314 | { |
| 1315 | - $sql = 'CASE ' . $this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
| 1315 | + $sql = 'CASE '.$this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
| 1316 | 1316 | |
| 1317 | 1317 | foreach ($simpleCaseExpression->simpleWhenClauses as $simpleWhenClause) { |
| 1318 | - $sql .= ' WHEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
| 1319 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
| 1318 | + $sql .= ' WHEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
| 1319 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
| 1320 | 1320 | } |
| 1321 | 1321 | |
| 1322 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression) . ' END'; |
|
| 1322 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression).' END'; |
|
| 1323 | 1323 | |
| 1324 | 1324 | return $sql; |
| 1325 | 1325 | } |
@@ -1360,7 +1360,7 @@ discard block |
||
| 1360 | 1360 | |
| 1361 | 1361 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
| 1362 | 1362 | |
| 1363 | - if (! $hidden) { |
|
| 1363 | + if ( ! $hidden) { |
|
| 1364 | 1364 | $this->rsm->addScalarResult($columnAlias, $resultAlias, $property->getType()); |
| 1365 | 1365 | $this->scalarFields[$dqlAlias][$fieldName] = $columnAlias; |
| 1366 | 1366 | } |
@@ -1381,11 +1381,11 @@ discard block |
||
| 1381 | 1381 | $columnAlias = $this->getSQLColumnAlias(); |
| 1382 | 1382 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
| 1383 | 1383 | |
| 1384 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
| 1384 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
| 1385 | 1385 | |
| 1386 | 1386 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
| 1387 | 1387 | |
| 1388 | - if (! $hidden) { |
|
| 1388 | + if ( ! $hidden) { |
|
| 1389 | 1389 | // Conceptually we could resolve field type here by traverse through AST to retrieve field type, |
| 1390 | 1390 | // but this is not a feasible solution; assume 'string'. |
| 1391 | 1391 | $this->rsm->addScalarResult($columnAlias, $resultAlias, Type::getType('string')); |
@@ -1396,11 +1396,11 @@ discard block |
||
| 1396 | 1396 | $columnAlias = $this->getSQLColumnAlias(); |
| 1397 | 1397 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
| 1398 | 1398 | |
| 1399 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
| 1399 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
| 1400 | 1400 | |
| 1401 | 1401 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
| 1402 | 1402 | |
| 1403 | - if (! $hidden) { |
|
| 1403 | + if ( ! $hidden) { |
|
| 1404 | 1404 | // We cannot resolve field type here; assume 'string'. |
| 1405 | 1405 | $this->rsm->addScalarResult($columnAlias, $resultAlias, Type::getType('string')); |
| 1406 | 1406 | } |
@@ -1424,7 +1424,7 @@ discard block |
||
| 1424 | 1424 | $class = $queryComp['metadata']; |
| 1425 | 1425 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: null; |
| 1426 | 1426 | |
| 1427 | - if (! isset($this->selectedClasses[$dqlAlias])) { |
|
| 1427 | + if ( ! isset($this->selectedClasses[$dqlAlias])) { |
|
| 1428 | 1428 | $this->selectedClasses[$dqlAlias] = [ |
| 1429 | 1429 | 'class' => $class, |
| 1430 | 1430 | 'dqlAlias' => $dqlAlias, |
@@ -1436,7 +1436,7 @@ discard block |
||
| 1436 | 1436 | |
| 1437 | 1437 | // Select all fields from the queried class |
| 1438 | 1438 | foreach ($class->getDeclaredPropertiesIterator() as $fieldName => $property) { |
| 1439 | - if (! ($property instanceof FieldMetadata)) { |
|
| 1439 | + if ( ! ($property instanceof FieldMetadata)) { |
|
| 1440 | 1440 | continue; |
| 1441 | 1441 | } |
| 1442 | 1442 | |
@@ -1471,7 +1471,7 @@ discard block |
||
| 1471 | 1471 | $subClass = $this->em->getClassMetadata($subClassName); |
| 1472 | 1472 | |
| 1473 | 1473 | foreach ($subClass->getDeclaredPropertiesIterator() as $fieldName => $property) { |
| 1474 | - if (! ($property instanceof FieldMetadata)) { |
|
| 1474 | + if ( ! ($property instanceof FieldMetadata)) { |
|
| 1475 | 1475 | continue; |
| 1476 | 1476 | } |
| 1477 | 1477 | |
@@ -1510,7 +1510,7 @@ discard block |
||
| 1510 | 1510 | */ |
| 1511 | 1511 | public function walkQuantifiedExpression($qExpr) |
| 1512 | 1512 | { |
| 1513 | - return ' ' . strtoupper($qExpr->type) . '(' . $this->walkSubselect($qExpr->subselect) . ')'; |
|
| 1513 | + return ' '.strtoupper($qExpr->type).'('.$this->walkSubselect($qExpr->subselect).')'; |
|
| 1514 | 1514 | } |
| 1515 | 1515 | |
| 1516 | 1516 | /** |
@@ -1550,7 +1550,7 @@ discard block |
||
| 1550 | 1550 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($subselectIdVarDecl); |
| 1551 | 1551 | } |
| 1552 | 1552 | |
| 1553 | - return ' FROM ' . implode(', ', $sqlParts); |
|
| 1553 | + return ' FROM '.implode(', ', $sqlParts); |
|
| 1554 | 1554 | } |
| 1555 | 1555 | |
| 1556 | 1556 | /** |
@@ -1558,7 +1558,7 @@ discard block |
||
| 1558 | 1558 | */ |
| 1559 | 1559 | public function walkSimpleSelectClause($simpleSelectClause) |
| 1560 | 1560 | { |
| 1561 | - return 'SELECT' . ($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
| 1561 | + return 'SELECT'.($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
| 1562 | 1562 | . $this->walkSimpleSelectExpression($simpleSelectClause->simpleSelectExpression); |
| 1563 | 1563 | } |
| 1564 | 1564 | |
@@ -1592,7 +1592,7 @@ discard block |
||
| 1592 | 1592 | break; |
| 1593 | 1593 | |
| 1594 | 1594 | case $e instanceof AST\Subselect: |
| 1595 | - $sqlSelectExpressions[] = '(' . $e->dispatch($this) . ') AS ' . $columnAlias; |
|
| 1595 | + $sqlSelectExpressions[] = '('.$e->dispatch($this).') AS '.$columnAlias; |
|
| 1596 | 1596 | break; |
| 1597 | 1597 | |
| 1598 | 1598 | case $e instanceof AST\PathExpression: |
@@ -1601,7 +1601,7 @@ discard block |
||
| 1601 | 1601 | $class = $qComp['metadata']; |
| 1602 | 1602 | $fieldType = $class->getProperty($e->field)->getType(); |
| 1603 | 1603 | |
| 1604 | - $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias; |
|
| 1604 | + $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias; |
|
| 1605 | 1605 | break; |
| 1606 | 1606 | |
| 1607 | 1607 | case $e instanceof AST\Literal: |
@@ -1615,11 +1615,11 @@ discard block |
||
| 1615 | 1615 | break; |
| 1616 | 1616 | } |
| 1617 | 1617 | |
| 1618 | - $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias; |
|
| 1618 | + $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias; |
|
| 1619 | 1619 | break; |
| 1620 | 1620 | |
| 1621 | 1621 | default: |
| 1622 | - $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias; |
|
| 1622 | + $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias; |
|
| 1623 | 1623 | break; |
| 1624 | 1624 | } |
| 1625 | 1625 | |
@@ -1652,10 +1652,10 @@ discard block |
||
| 1652 | 1652 | case $expr instanceof AST\Subselect: |
| 1653 | 1653 | $alias = $simpleSelectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
| 1654 | 1654 | |
| 1655 | - $columnAlias = 'sclr' . $this->aliasCounter++; |
|
| 1655 | + $columnAlias = 'sclr'.$this->aliasCounter++; |
|
| 1656 | 1656 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
| 1657 | 1657 | |
| 1658 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
| 1658 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
| 1659 | 1659 | break; |
| 1660 | 1660 | |
| 1661 | 1661 | case $expr instanceof AST\Functions\FunctionNode: |
@@ -1672,7 +1672,7 @@ discard block |
||
| 1672 | 1672 | $columnAlias = $this->getSQLColumnAlias(); |
| 1673 | 1673 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
| 1674 | 1674 | |
| 1675 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
| 1675 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
| 1676 | 1676 | break; |
| 1677 | 1677 | |
| 1678 | 1678 | case $expr instanceof AST\ParenthesisExpression: |
@@ -1692,8 +1692,8 @@ discard block |
||
| 1692 | 1692 | */ |
| 1693 | 1693 | public function walkAggregateExpression($aggExpression) |
| 1694 | 1694 | { |
| 1695 | - return $aggExpression->functionName . '(' . ($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
| 1696 | - . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression) . ')'; |
|
| 1695 | + return $aggExpression->functionName.'('.($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
| 1696 | + . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression).')'; |
|
| 1697 | 1697 | } |
| 1698 | 1698 | |
| 1699 | 1699 | /** |
@@ -1707,7 +1707,7 @@ discard block |
||
| 1707 | 1707 | $sqlParts[] = $this->walkGroupByItem($groupByItem); |
| 1708 | 1708 | } |
| 1709 | 1709 | |
| 1710 | - return ' GROUP BY ' . implode(', ', $sqlParts); |
|
| 1710 | + return ' GROUP BY '.implode(', ', $sqlParts); |
|
| 1711 | 1711 | } |
| 1712 | 1712 | |
| 1713 | 1713 | /** |
@@ -1716,7 +1716,7 @@ discard block |
||
| 1716 | 1716 | public function walkGroupByItem($groupByItem) |
| 1717 | 1717 | { |
| 1718 | 1718 | // StateFieldPathExpression |
| 1719 | - if (! is_string($groupByItem)) { |
|
| 1719 | + if ( ! is_string($groupByItem)) { |
|
| 1720 | 1720 | return $this->walkPathExpression($groupByItem); |
| 1721 | 1721 | } |
| 1722 | 1722 | |
@@ -1770,7 +1770,7 @@ discard block |
||
| 1770 | 1770 | { |
| 1771 | 1771 | $class = $this->em->getClassMetadata($deleteClause->abstractSchemaName); |
| 1772 | 1772 | $tableName = $class->getTableName(); |
| 1773 | - $sql = 'DELETE FROM ' . $class->table->getQuotedQualifiedName($this->platform); |
|
| 1773 | + $sql = 'DELETE FROM '.$class->table->getQuotedQualifiedName($this->platform); |
|
| 1774 | 1774 | |
| 1775 | 1775 | $this->setSQLTableAlias($tableName, $tableName, $deleteClause->aliasIdentificationVariable); |
| 1776 | 1776 | |
@@ -1786,12 +1786,12 @@ discard block |
||
| 1786 | 1786 | { |
| 1787 | 1787 | $class = $this->em->getClassMetadata($updateClause->abstractSchemaName); |
| 1788 | 1788 | $tableName = $class->getTableName(); |
| 1789 | - $sql = 'UPDATE ' . $class->table->getQuotedQualifiedName($this->platform); |
|
| 1789 | + $sql = 'UPDATE '.$class->table->getQuotedQualifiedName($this->platform); |
|
| 1790 | 1790 | |
| 1791 | 1791 | $this->setSQLTableAlias($tableName, $tableName, $updateClause->aliasIdentificationVariable); |
| 1792 | 1792 | $this->rootAliases[] = $updateClause->aliasIdentificationVariable; |
| 1793 | 1793 | |
| 1794 | - return $sql . ' SET ' . implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
| 1794 | + return $sql.' SET '.implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
| 1795 | 1795 | } |
| 1796 | 1796 | |
| 1797 | 1797 | /** |
@@ -1802,7 +1802,7 @@ discard block |
||
| 1802 | 1802 | $useTableAliasesBefore = $this->useSqlTableAliases; |
| 1803 | 1803 | $this->useSqlTableAliases = false; |
| 1804 | 1804 | |
| 1805 | - $sql = $this->walkPathExpression($updateItem->pathExpression) . ' = '; |
|
| 1805 | + $sql = $this->walkPathExpression($updateItem->pathExpression).' = '; |
|
| 1806 | 1806 | $newValue = $updateItem->newValue; |
| 1807 | 1807 | |
| 1808 | 1808 | switch (true) { |
@@ -1846,7 +1846,7 @@ discard block |
||
| 1846 | 1846 | |
| 1847 | 1847 | if ($filterClauses) { |
| 1848 | 1848 | if ($condSql) { |
| 1849 | - $condSql = '(' . $condSql . ') AND '; |
|
| 1849 | + $condSql = '('.$condSql.') AND '; |
|
| 1850 | 1850 | } |
| 1851 | 1851 | |
| 1852 | 1852 | $condSql .= implode(' AND ', $filterClauses); |
@@ -1854,11 +1854,11 @@ discard block |
||
| 1854 | 1854 | } |
| 1855 | 1855 | |
| 1856 | 1856 | if ($condSql) { |
| 1857 | - return ' WHERE ' . (! $discrSql ? $condSql : '(' . $condSql . ') AND ' . $discrSql); |
|
| 1857 | + return ' WHERE '.( ! $discrSql ? $condSql : '('.$condSql.') AND '.$discrSql); |
|
| 1858 | 1858 | } |
| 1859 | 1859 | |
| 1860 | 1860 | if ($discrSql) { |
| 1861 | - return ' WHERE ' . $discrSql; |
|
| 1861 | + return ' WHERE '.$discrSql; |
|
| 1862 | 1862 | } |
| 1863 | 1863 | |
| 1864 | 1864 | return ''; |
@@ -1871,7 +1871,7 @@ discard block |
||
| 1871 | 1871 | { |
| 1872 | 1872 | // Phase 2 AST optimization: Skip processing of ConditionalExpression |
| 1873 | 1873 | // if only one ConditionalTerm is defined |
| 1874 | - if (! ($condExpr instanceof AST\ConditionalExpression)) { |
|
| 1874 | + if ( ! ($condExpr instanceof AST\ConditionalExpression)) { |
|
| 1875 | 1875 | return $this->walkConditionalTerm($condExpr); |
| 1876 | 1876 | } |
| 1877 | 1877 | |
@@ -1885,7 +1885,7 @@ discard block |
||
| 1885 | 1885 | { |
| 1886 | 1886 | // Phase 2 AST optimization: Skip processing of ConditionalTerm |
| 1887 | 1887 | // if only one ConditionalFactor is defined |
| 1888 | - if (! ($condTerm instanceof AST\ConditionalTerm)) { |
|
| 1888 | + if ( ! ($condTerm instanceof AST\ConditionalTerm)) { |
|
| 1889 | 1889 | return $this->walkConditionalFactor($condTerm); |
| 1890 | 1890 | } |
| 1891 | 1891 | |
@@ -1901,7 +1901,7 @@ discard block |
||
| 1901 | 1901 | // if only one ConditionalPrimary is defined |
| 1902 | 1902 | return ! ($factor instanceof AST\ConditionalFactor) |
| 1903 | 1903 | ? $this->walkConditionalPrimary($factor) |
| 1904 | - : ($factor->not ? 'NOT ' : '') . $this->walkConditionalPrimary($factor->conditionalPrimary); |
|
| 1904 | + : ($factor->not ? 'NOT ' : '').$this->walkConditionalPrimary($factor->conditionalPrimary); |
|
| 1905 | 1905 | } |
| 1906 | 1906 | |
| 1907 | 1907 | /** |
@@ -1916,7 +1916,7 @@ discard block |
||
| 1916 | 1916 | if ($primary->isConditionalExpression()) { |
| 1917 | 1917 | $condExpr = $primary->conditionalExpression; |
| 1918 | 1918 | |
| 1919 | - return '(' . $this->walkConditionalExpression($condExpr) . ')'; |
|
| 1919 | + return '('.$this->walkConditionalExpression($condExpr).')'; |
|
| 1920 | 1920 | } |
| 1921 | 1921 | } |
| 1922 | 1922 | |
@@ -1927,7 +1927,7 @@ discard block |
||
| 1927 | 1927 | { |
| 1928 | 1928 | $sql = $existsExpr->not ? 'NOT ' : ''; |
| 1929 | 1929 | |
| 1930 | - $sql .= 'EXISTS (' . $this->walkSubselect($existsExpr->subselect) . ')'; |
|
| 1930 | + $sql .= 'EXISTS ('.$this->walkSubselect($existsExpr->subselect).')'; |
|
| 1931 | 1931 | |
| 1932 | 1932 | return $sql; |
| 1933 | 1933 | } |
@@ -1975,7 +1975,7 @@ discard block |
||
| 1975 | 1975 | $targetTableAlias = $this->getSQLTableAlias($targetClass->getTableName()); |
| 1976 | 1976 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
| 1977 | 1977 | |
| 1978 | - $sql .= $targetTableName . ' ' . $targetTableAlias . ' WHERE '; |
|
| 1978 | + $sql .= $targetTableName.' '.$targetTableAlias.' WHERE '; |
|
| 1979 | 1979 | |
| 1980 | 1980 | $sqlParts = []; |
| 1981 | 1981 | |
@@ -1996,7 +1996,7 @@ discard block |
||
| 1996 | 1996 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
| 1997 | 1997 | } |
| 1998 | 1998 | |
| 1999 | - $sqlParts[] = $targetTableAlias . '.' . $quotedTargetColumnName . ' = ' . $entitySql; |
|
| 1999 | + $sqlParts[] = $targetTableAlias.'.'.$quotedTargetColumnName.' = '.$entitySql; |
|
| 2000 | 2000 | } |
| 2001 | 2001 | |
| 2002 | 2002 | $sql .= implode(' AND ', $sqlParts); |
@@ -2010,7 +2010,7 @@ discard block |
||
| 2010 | 2010 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
| 2011 | 2011 | |
| 2012 | 2012 | // join to target table |
| 2013 | - $sql .= $joinTableName . ' ' . $joinTableAlias . ' INNER JOIN ' . $targetTableName . ' ' . $targetTableAlias . ' ON '; |
|
| 2013 | + $sql .= $joinTableName.' '.$joinTableAlias.' INNER JOIN '.$targetTableName.' '.$targetTableAlias.' ON '; |
|
| 2014 | 2014 | |
| 2015 | 2015 | // join conditions |
| 2016 | 2016 | $joinSqlParts = []; |
@@ -2059,13 +2059,13 @@ discard block |
||
| 2059 | 2059 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
| 2060 | 2060 | } |
| 2061 | 2061 | |
| 2062 | - $sqlParts[] = $targetTableAlias . '.' . $quotedTargetColumnName . ' = ' . $entitySql; |
|
| 2062 | + $sqlParts[] = $targetTableAlias.'.'.$quotedTargetColumnName.' = '.$entitySql; |
|
| 2063 | 2063 | } |
| 2064 | 2064 | |
| 2065 | 2065 | $sql .= implode(' AND ', $sqlParts); |
| 2066 | 2066 | } |
| 2067 | 2067 | |
| 2068 | - return $sql . ')'; |
|
| 2068 | + return $sql.')'; |
|
| 2069 | 2069 | } |
| 2070 | 2070 | |
| 2071 | 2071 | /** |
@@ -2076,7 +2076,7 @@ discard block |
||
| 2076 | 2076 | $sizeFunc = new AST\Functions\SizeFunction('size'); |
| 2077 | 2077 | $sizeFunc->collectionPathExpression = $emptyCollCompExpr->expression; |
| 2078 | 2078 | |
| 2079 | - return $sizeFunc->getSql($this) . ($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
| 2079 | + return $sizeFunc->getSql($this).($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
| 2080 | 2080 | } |
| 2081 | 2081 | |
| 2082 | 2082 | /** |
@@ -2085,19 +2085,19 @@ discard block |
||
| 2085 | 2085 | public function walkNullComparisonExpression($nullCompExpr) |
| 2086 | 2086 | { |
| 2087 | 2087 | $expression = $nullCompExpr->expression; |
| 2088 | - $comparison = ' IS' . ($nullCompExpr->not ? ' NOT' : '') . ' NULL'; |
|
| 2088 | + $comparison = ' IS'.($nullCompExpr->not ? ' NOT' : '').' NULL'; |
|
| 2089 | 2089 | |
| 2090 | 2090 | // Handle ResultVariable |
| 2091 | 2091 | if (is_string($expression) && isset($this->queryComponents[$expression]['resultVariable'])) { |
| 2092 | - return $this->walkResultVariable($expression) . $comparison; |
|
| 2092 | + return $this->walkResultVariable($expression).$comparison; |
|
| 2093 | 2093 | } |
| 2094 | 2094 | |
| 2095 | 2095 | // Handle InputParameter mapping inclusion to ParserResult |
| 2096 | 2096 | if ($expression instanceof AST\InputParameter) { |
| 2097 | - return $this->walkInputParameter($expression) . $comparison; |
|
| 2097 | + return $this->walkInputParameter($expression).$comparison; |
|
| 2098 | 2098 | } |
| 2099 | 2099 | |
| 2100 | - return $expression->dispatch($this) . $comparison; |
|
| 2100 | + return $expression->dispatch($this).$comparison; |
|
| 2101 | 2101 | } |
| 2102 | 2102 | |
| 2103 | 2103 | /** |
@@ -2105,7 +2105,7 @@ discard block |
||
| 2105 | 2105 | */ |
| 2106 | 2106 | public function walkInExpression($inExpr) |
| 2107 | 2107 | { |
| 2108 | - $sql = $this->walkArithmeticExpression($inExpr->expression) . ($inExpr->not ? ' NOT' : '') . ' IN ('; |
|
| 2108 | + $sql = $this->walkArithmeticExpression($inExpr->expression).($inExpr->not ? ' NOT' : '').' IN ('; |
|
| 2109 | 2109 | |
| 2110 | 2110 | $sql .= $inExpr->subselect |
| 2111 | 2111 | ? $this->walkSubselect($inExpr->subselect) |
@@ -2130,12 +2130,12 @@ discard block |
||
| 2130 | 2130 | $discrColumnType = $discrColumn->getType(); |
| 2131 | 2131 | $quotedColumnName = $this->platform->quoteIdentifier($discrColumn->getColumnName()); |
| 2132 | 2132 | $sqlTableAlias = $this->useSqlTableAliases |
| 2133 | - ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias) . '.' |
|
| 2133 | + ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias).'.' |
|
| 2134 | 2134 | : ''; |
| 2135 | 2135 | |
| 2136 | 2136 | return sprintf( |
| 2137 | 2137 | '%s %sIN %s', |
| 2138 | - $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . $quotedColumnName, $this->platform), |
|
| 2138 | + $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.$quotedColumnName, $this->platform), |
|
| 2139 | 2139 | ($instanceOfExpr->not ? 'NOT ' : ''), |
| 2140 | 2140 | $this->getChildDiscriminatorsFromClassMetadata($discrClass, $instanceOfExpr) |
| 2141 | 2141 | ); |
@@ -2182,8 +2182,8 @@ discard block |
||
| 2182 | 2182 | $sql .= ' NOT'; |
| 2183 | 2183 | } |
| 2184 | 2184 | |
| 2185 | - $sql .= ' BETWEEN ' . $this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
| 2186 | - . ' AND ' . $this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
| 2185 | + $sql .= ' BETWEEN '.$this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
| 2186 | + . ' AND '.$this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
| 2187 | 2187 | |
| 2188 | 2188 | return $sql; |
| 2189 | 2189 | } |
@@ -2198,7 +2198,7 @@ discard block |
||
| 2198 | 2198 | ? $this->walkResultVariable($stringExpr) |
| 2199 | 2199 | : $stringExpr->dispatch($this); |
| 2200 | 2200 | |
| 2201 | - $sql = $leftExpr . ($likeExpr->not ? ' NOT' : '') . ' LIKE '; |
|
| 2201 | + $sql = $leftExpr.($likeExpr->not ? ' NOT' : '').' LIKE '; |
|
| 2202 | 2202 | |
| 2203 | 2203 | if ($likeExpr->stringPattern instanceof AST\InputParameter) { |
| 2204 | 2204 | $sql .= $this->walkInputParameter($likeExpr->stringPattern); |
@@ -2211,7 +2211,7 @@ discard block |
||
| 2211 | 2211 | } |
| 2212 | 2212 | |
| 2213 | 2213 | if ($likeExpr->escapeChar) { |
| 2214 | - $sql .= ' ESCAPE ' . $this->walkLiteral($likeExpr->escapeChar); |
|
| 2214 | + $sql .= ' ESCAPE '.$this->walkLiteral($likeExpr->escapeChar); |
|
| 2215 | 2215 | } |
| 2216 | 2216 | |
| 2217 | 2217 | return $sql; |
@@ -2238,7 +2238,7 @@ discard block |
||
| 2238 | 2238 | ? $leftExpr->dispatch($this) |
| 2239 | 2239 | : (is_numeric($leftExpr) ? $leftExpr : $this->conn->quote($leftExpr)); |
| 2240 | 2240 | |
| 2241 | - $sql .= ' ' . $compExpr->operator . ' '; |
|
| 2241 | + $sql .= ' '.$compExpr->operator.' '; |
|
| 2242 | 2242 | |
| 2243 | 2243 | $sql .= $rightExpr instanceof AST\Node |
| 2244 | 2244 | ? $rightExpr->dispatch($this) |
@@ -2274,7 +2274,7 @@ discard block |
||
| 2274 | 2274 | { |
| 2275 | 2275 | return $arithmeticExpr->isSimpleArithmeticExpression() |
| 2276 | 2276 | ? $this->walkSimpleArithmeticExpression($arithmeticExpr->simpleArithmeticExpression) |
| 2277 | - : '(' . $this->walkSubselect($arithmeticExpr->subselect) . ')'; |
|
| 2277 | + : '('.$this->walkSubselect($arithmeticExpr->subselect).')'; |
|
| 2278 | 2278 | } |
| 2279 | 2279 | |
| 2280 | 2280 | /** |
@@ -2282,7 +2282,7 @@ discard block |
||
| 2282 | 2282 | */ |
| 2283 | 2283 | public function walkSimpleArithmeticExpression($simpleArithmeticExpr) |
| 2284 | 2284 | { |
| 2285 | - if (! ($simpleArithmeticExpr instanceof AST\SimpleArithmeticExpression)) { |
|
| 2285 | + if ( ! ($simpleArithmeticExpr instanceof AST\SimpleArithmeticExpression)) { |
|
| 2286 | 2286 | return $this->walkArithmeticTerm($simpleArithmeticExpr); |
| 2287 | 2287 | } |
| 2288 | 2288 | |
@@ -2302,7 +2302,7 @@ discard block |
||
| 2302 | 2302 | |
| 2303 | 2303 | // Phase 2 AST optimization: Skip processing of ArithmeticTerm |
| 2304 | 2304 | // if only one ArithmeticFactor is defined |
| 2305 | - if (! ($term instanceof AST\ArithmeticTerm)) { |
|
| 2305 | + if ( ! ($term instanceof AST\ArithmeticTerm)) { |
|
| 2306 | 2306 | return $this->walkArithmeticFactor($term); |
| 2307 | 2307 | } |
| 2308 | 2308 | |
@@ -2322,13 +2322,13 @@ discard block |
||
| 2322 | 2322 | |
| 2323 | 2323 | // Phase 2 AST optimization: Skip processing of ArithmeticFactor |
| 2324 | 2324 | // if only one ArithmeticPrimary is defined |
| 2325 | - if (! ($factor instanceof AST\ArithmeticFactor)) { |
|
| 2325 | + if ( ! ($factor instanceof AST\ArithmeticFactor)) { |
|
| 2326 | 2326 | return $this->walkArithmeticPrimary($factor); |
| 2327 | 2327 | } |
| 2328 | 2328 | |
| 2329 | 2329 | $sign = $factor->isNegativeSigned() ? '-' : ($factor->isPositiveSigned() ? '+' : ''); |
| 2330 | 2330 | |
| 2331 | - return $sign . $this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
| 2331 | + return $sign.$this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
| 2332 | 2332 | } |
| 2333 | 2333 | |
| 2334 | 2334 | /** |
@@ -2341,7 +2341,7 @@ discard block |
||
| 2341 | 2341 | public function walkArithmeticPrimary($primary) |
| 2342 | 2342 | { |
| 2343 | 2343 | if ($primary instanceof AST\SimpleArithmeticExpression) { |
| 2344 | - return '(' . $this->walkSimpleArithmeticExpression($primary) . ')'; |
|
| 2344 | + return '('.$this->walkSimpleArithmeticExpression($primary).')'; |
|
| 2345 | 2345 | } |
| 2346 | 2346 | |
| 2347 | 2347 | if ($primary instanceof AST\Node) { |
@@ -2399,7 +2399,7 @@ discard block |
||
| 2399 | 2399 | $entityClassName = $entityClass->getClassName(); |
| 2400 | 2400 | |
| 2401 | 2401 | if ($entityClassName !== $rootClass->getClassName()) { |
| 2402 | - if (! $entityClass->getReflectionClass()->isSubclassOf($rootClass->getClassName())) { |
|
| 2402 | + if ( ! $entityClass->getReflectionClass()->isSubclassOf($rootClass->getClassName())) { |
|
| 2403 | 2403 | throw QueryException::instanceOfUnrelatedClass($entityClassName, $rootClass->getClassName()); |
| 2404 | 2404 | } |
| 2405 | 2405 | } |
@@ -2411,6 +2411,6 @@ discard block |
||
| 2411 | 2411 | $sqlParameterList[] = $this->conn->quote($discriminator); |
| 2412 | 2412 | } |
| 2413 | 2413 | |
| 2414 | - return '(' . implode(', ', $sqlParameterList) . ')'; |
|
| 2414 | + return '('.implode(', ', $sqlParameterList).')'; |
|
| 2415 | 2415 | } |
| 2416 | 2416 | } |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | $conn = static::$sharedConn; |
| 347 | 347 | |
| 348 | 348 | // In case test is skipped, tearDown is called, but no setup may have run |
| 349 | - if (! $conn) { |
|
| 349 | + if ( ! $conn) { |
|
| 350 | 350 | return; |
| 351 | 351 | } |
| 352 | 352 | |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | } |
| 421 | 421 | |
| 422 | 422 | if (isset($this->usedModelSets['directorytree'])) { |
| 423 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('file')); |
|
| 423 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('file')); |
|
| 424 | 424 | // MySQL doesn't know deferred deletions therefore only executing the second query gives errors. |
| 425 | 425 | $conn->executeUpdate('DELETE FROM Directory WHERE parentDirectory_id IS NOT NULL'); |
| 426 | 426 | $conn->executeUpdate('DELETE FROM Directory'); |
@@ -513,12 +513,12 @@ discard block |
||
| 513 | 513 | ) |
| 514 | 514 | ); |
| 515 | 515 | |
| 516 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-users-groups')); |
|
| 517 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-group')); |
|
| 518 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-phone')); |
|
| 519 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-user')); |
|
| 520 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-address')); |
|
| 521 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-city')); |
|
| 516 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-users-groups')); |
|
| 517 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-group')); |
|
| 518 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-phone')); |
|
| 519 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-user')); |
|
| 520 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-address')); |
|
| 521 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-city')); |
|
| 522 | 522 | } |
| 523 | 523 | |
| 524 | 524 | if (isset($this->usedModelSets['vct_onetoone'])) { |
@@ -630,7 +630,7 @@ discard block |
||
| 630 | 630 | $classes = []; |
| 631 | 631 | |
| 632 | 632 | foreach ($classNames as $className) { |
| 633 | - if (! isset(static::$entityTablesCreated[$className])) { |
|
| 633 | + if ( ! isset(static::$entityTablesCreated[$className])) { |
|
| 634 | 634 | static::$entityTablesCreated[$className] = true; |
| 635 | 635 | $classes[] = $this->em->getClassMetadata($className); |
| 636 | 636 | } |
@@ -649,25 +649,25 @@ discard block |
||
| 649 | 649 | { |
| 650 | 650 | $this->setUpDBALTypes(); |
| 651 | 651 | |
| 652 | - if (! isset(static::$sharedConn)) { |
|
| 652 | + if ( ! isset(static::$sharedConn)) { |
|
| 653 | 653 | static::$sharedConn = TestUtil::getConnection(); |
| 654 | 654 | } |
| 655 | 655 | |
| 656 | 656 | if (isset($GLOBALS['DOCTRINE_MARK_SQL_LOGS'])) { |
| 657 | 657 | if (in_array(static::$sharedConn->getDatabasePlatform()->getName(), ['mysql', 'postgresql'], true)) { |
| 658 | - static::$sharedConn->executeQuery('SELECT 1 /*' . static::class . '*/'); |
|
| 658 | + static::$sharedConn->executeQuery('SELECT 1 /*'.static::class.'*/'); |
|
| 659 | 659 | } elseif (static::$sharedConn->getDatabasePlatform()->getName() === 'oracle') { |
| 660 | - static::$sharedConn->executeQuery('SELECT 1 /*' . static::class . '*/ FROM dual'); |
|
| 660 | + static::$sharedConn->executeQuery('SELECT 1 /*'.static::class.'*/ FROM dual'); |
|
| 661 | 661 | } |
| 662 | 662 | } |
| 663 | 663 | |
| 664 | - if (! $this->em) { |
|
| 664 | + if ( ! $this->em) { |
|
| 665 | 665 | $this->em = $this->getEntityManager(); |
| 666 | 666 | $this->schemaTool = new SchemaTool($this->em); |
| 667 | 667 | } |
| 668 | 668 | |
| 669 | 669 | foreach ($this->usedModelSets as $setName => $bool) { |
| 670 | - if (! isset(static::$tablesCreated[$setName])) { |
|
| 670 | + if ( ! isset(static::$tablesCreated[$setName])) { |
|
| 671 | 671 | $this->setUpEntitySchema(static::$modelSets[$setName]); |
| 672 | 672 | |
| 673 | 673 | static::$tablesCreated[$setName] = true; |
@@ -742,8 +742,8 @@ discard block |
||
| 742 | 742 | |
| 743 | 743 | $config->setMetadataDriverImpl( |
| 744 | 744 | $mappingDriver ?? $config->newDefaultAnnotationDriver([ |
| 745 | - realpath(__DIR__ . '/Models/Cache'), |
|
| 746 | - realpath(__DIR__ . '/Models/GeoNames'), |
|
| 745 | + realpath(__DIR__.'/Models/Cache'), |
|
| 746 | + realpath(__DIR__.'/Models/GeoNames'), |
|
| 747 | 747 | ]) |
| 748 | 748 | ); |
| 749 | 749 | |
@@ -791,13 +791,13 @@ discard block |
||
| 791 | 791 | |
| 792 | 792 | foreach ($last25queries as $i => $query) { |
| 793 | 793 | $params = array_map( |
| 794 | - static function ($p) { |
|
| 794 | + static function($p) { |
|
| 795 | 795 | return is_object($p) ? get_class($p) : var_export($p, true); |
| 796 | 796 | }, |
| 797 | 797 | $query['params'] ?: [] |
| 798 | 798 | ); |
| 799 | 799 | |
| 800 | - $queries .= $i . ". SQL: '" . $query['sql'] . "' Params: " . implode(', ', $params) . PHP_EOL; |
|
| 800 | + $queries .= $i.". SQL: '".$query['sql']."' Params: ".implode(', ', $params).PHP_EOL; |
|
| 801 | 801 | } |
| 802 | 802 | |
| 803 | 803 | $trace = $e->getTrace(); |
@@ -810,11 +810,11 @@ discard block |
||
| 810 | 810 | break; |
| 811 | 811 | } |
| 812 | 812 | |
| 813 | - $traceMsg .= $part['file'] . ':' . $part['line'] . PHP_EOL; |
|
| 813 | + $traceMsg .= $part['file'].':'.$part['line'].PHP_EOL; |
|
| 814 | 814 | } |
| 815 | 815 | } |
| 816 | 816 | |
| 817 | - $message = '[' . get_class($e) . '] ' . $e->getMessage() . PHP_EOL . PHP_EOL . 'With queries:' . PHP_EOL . $queries . PHP_EOL . 'Trace:' . PHP_EOL . $traceMsg; |
|
| 817 | + $message = '['.get_class($e).'] '.$e->getMessage().PHP_EOL.PHP_EOL.'With queries:'.PHP_EOL.$queries.PHP_EOL.'Trace:'.PHP_EOL.$traceMsg; |
|
| 818 | 818 | |
| 819 | 819 | throw new Exception($message, (int) $e->getCode(), $e); |
| 820 | 820 | } |
@@ -116,9 +116,9 @@ discard block |
||
| 116 | 116 | |
| 117 | 117 | public function testHasGetMetadataNamespaceSeparatorIsNotNormalized() : void |
| 118 | 118 | { |
| 119 | - require_once __DIR__ . '/../../Models/Global/GlobalNamespaceModel.php'; |
|
| 119 | + require_once __DIR__.'/../../Models/Global/GlobalNamespaceModel.php'; |
|
| 120 | 120 | |
| 121 | - $metadataDriver = $this->createAnnotationDriver([__DIR__ . '/../../Models/Global/']); |
|
| 121 | + $metadataDriver = $this->createAnnotationDriver([__DIR__.'/../../Models/Global/']); |
|
| 122 | 122 | |
| 123 | 123 | $entityManager = $this->createEntityManager($metadataDriver); |
| 124 | 124 | |
@@ -126,10 +126,10 @@ discard block |
||
| 126 | 126 | |
| 127 | 127 | self::assertSame( |
| 128 | 128 | $mf->getMetadataFor(DoctrineGlobalArticle::class), |
| 129 | - $mf->getMetadataFor('\\' . DoctrineGlobalArticle::class) |
|
| 129 | + $mf->getMetadataFor('\\'.DoctrineGlobalArticle::class) |
|
| 130 | 130 | ); |
| 131 | 131 | self::assertTrue($mf->hasMetadataFor(DoctrineGlobalArticle::class)); |
| 132 | - self::assertTrue($mf->hasMetadataFor('\\' . DoctrineGlobalArticle::class)); |
|
| 132 | + self::assertTrue($mf->hasMetadataFor('\\'.DoctrineGlobalArticle::class)); |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | /** |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | public function testNoDefaultDiscriminatorMapIsAssumed(string $rootClassName, string $targetClassName) : void |
| 161 | 161 | { |
| 162 | 162 | $cmf = new ClassMetadataFactory(); |
| 163 | - $driver = $this->createAnnotationDriver([__DIR__ . '/../../Models/JoinedInheritanceType/']); |
|
| 163 | + $driver = $this->createAnnotationDriver([__DIR__.'/../../Models/JoinedInheritanceType/']); |
|
| 164 | 164 | $em = $this->createEntityManager($driver); |
| 165 | 165 | $cmf->setEntityManager($em); |
| 166 | 166 | |
@@ -210,10 +210,10 @@ discard block |
||
| 210 | 210 | $driverMock = new DriverMock(); |
| 211 | 211 | $config = new Configuration(); |
| 212 | 212 | |
| 213 | - $config->setProxyDir(__DIR__ . '/../../Proxies'); |
|
| 213 | + $config->setProxyDir(__DIR__.'/../../Proxies'); |
|
| 214 | 214 | $config->setProxyNamespace('Doctrine\Tests\Proxies'); |
| 215 | 215 | |
| 216 | - if (! $conn) { |
|
| 216 | + if ( ! $conn) { |
|
| 217 | 217 | $conn = new ConnectionMock([], $driverMock, $config, new EventManager()); |
| 218 | 218 | } |
| 219 | 219 | $eventManager = $conn->getEventManager(); |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | public function testQuoteMetadata() : void |
| 304 | 304 | { |
| 305 | 305 | $cmf = new ClassMetadataFactory(); |
| 306 | - $driver = $this->createAnnotationDriver([__DIR__ . '/../../Models/Quote/']); |
|
| 306 | + $driver = $this->createAnnotationDriver([__DIR__.'/../../Models/Quote/']); |
|
| 307 | 307 | $em = $this->createEntityManager($driver); |
| 308 | 308 | $cmf->setEntityManager($em); |
| 309 | 309 | |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | $listener |
| 386 | 386 | ->expects($this->any()) |
| 387 | 387 | ->method('onClassMetadataNotFound') |
| 388 | - ->will($this->returnCallback(static function (OnClassMetadataNotFoundEventArgs $args) use ($metadata, $em, $test) { |
|
| 388 | + ->will($this->returnCallback(static function(OnClassMetadataNotFoundEventArgs $args) use ($metadata, $em, $test) { |
|
| 389 | 389 | $test->assertNull($args->getFoundMetadata()); |
| 390 | 390 | $test->assertSame('Foo', $args->getClassName()); |
| 391 | 391 | $test->assertSame($em, $args->getObjectManager()); |
@@ -447,7 +447,7 @@ discard block |
||
| 447 | 447 | public function testInheritsIdGeneratorMappingFromEmbeddable() : void |
| 448 | 448 | { |
| 449 | 449 | $cmf = new ClassMetadataFactory(); |
| 450 | - $driver = $this->createAnnotationDriver([__DIR__ . '/../../Models/DDC4006/']); |
|
| 450 | + $driver = $this->createAnnotationDriver([__DIR__.'/../../Models/DDC4006/']); |
|
| 451 | 451 | $em = $this->createEntityManager($driver); |
| 452 | 452 | $cmf->setEntityManager($em); |
| 453 | 453 | |
@@ -470,7 +470,7 @@ discard block |
||
| 470 | 470 | ) : ClassMetadata { |
| 471 | 471 | $this->requestedClasses[] = $className; |
| 472 | 472 | |
| 473 | - if (! isset($this->mockMetadata[$className])) { |
|
| 473 | + if ( ! isset($this->mockMetadata[$className])) { |
|
| 474 | 474 | throw new InvalidArgumentException(sprintf('No mock metadata found for class %s.', $className)); |
| 475 | 475 | } |
| 476 | 476 | |