@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $parentClass = $this->class; |
55 | 55 | |
56 | 56 | while (($parentClass = $parentClass->getParent()) !== null) { |
57 | - if (! $parentClass->isMappedSuperclass) { |
|
57 | + if ( ! $parentClass->isMappedSuperclass) { |
|
58 | 58 | $parentTableName = $parentClass->getTableName(); |
59 | 59 | |
60 | 60 | if ($parentClass !== $rootClass) { |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | } |
111 | 111 | |
112 | 112 | foreach ($data as $columnName => $value) { |
113 | - if (! is_array($id) || ! isset($id[$columnName])) { |
|
113 | + if ( ! is_array($id) || ! isset($id[$columnName])) { |
|
114 | 114 | $type = $this->columns[$columnName]->getType(); |
115 | 115 | |
116 | 116 | $stmt->bindValue($paramIndex++, $value, $type); |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | { |
135 | 135 | $updateData = $this->prepareUpdateData($entity); |
136 | 136 | |
137 | - if (! $updateData) { |
|
137 | + if ( ! $updateData) { |
|
138 | 138 | return; |
139 | 139 | } |
140 | 140 | |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | $versionedClass = $this->class->versionProperty->getDeclaringClass(); |
153 | 153 | $versionedTable = $versionedClass->getTableName(); |
154 | 154 | |
155 | - if (! isset($updateData[$versionedTable])) { |
|
155 | + if ( ! isset($updateData[$versionedTable])) { |
|
156 | 156 | $tableName = $versionedClass->table->getQuotedQualifiedName($this->platform); |
157 | 157 | |
158 | 158 | $this->updateTable($entity, $tableName, [], true); |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | $parentClass = $this->class; |
190 | 190 | |
191 | 191 | while (($parentClass = $parentClass->getParent()) !== null) { |
192 | - if (! $parentClass->isMappedSuperclass) { |
|
192 | + if ( ! $parentClass->isMappedSuperclass) { |
|
193 | 193 | $parentTable = $parentClass->table->getQuotedQualifiedName($this->platform); |
194 | 194 | |
195 | 195 | $this->conn->delete($parentTable, $id); |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | |
236 | 236 | if ($filterSql) { |
237 | 237 | $conditionSql .= $conditionSql |
238 | - ? ' AND ' . $filterSql |
|
238 | + ? ' AND '.$filterSql |
|
239 | 239 | : $filterSql; |
240 | 240 | } |
241 | 241 | |
@@ -243,26 +243,26 @@ discard block |
||
243 | 243 | |
244 | 244 | switch ($lockMode) { |
245 | 245 | case LockMode::PESSIMISTIC_READ: |
246 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
246 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
247 | 247 | break; |
248 | 248 | |
249 | 249 | case LockMode::PESSIMISTIC_WRITE: |
250 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
250 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
251 | 251 | break; |
252 | 252 | } |
253 | 253 | |
254 | 254 | $tableName = $this->class->table->getQuotedQualifiedName($this->platform); |
255 | - $from = ' FROM ' . $tableName . ' ' . $baseTableAlias; |
|
256 | - $where = $conditionSql !== '' ? ' WHERE ' . $conditionSql : ''; |
|
255 | + $from = ' FROM '.$tableName.' '.$baseTableAlias; |
|
256 | + $where = $conditionSql !== '' ? ' WHERE '.$conditionSql : ''; |
|
257 | 257 | $lock = $this->platform->appendLockHint($from, $lockMode); |
258 | 258 | $columnList = $this->getSelectColumnsSQL(); |
259 | - $query = 'SELECT ' . $columnList |
|
259 | + $query = 'SELECT '.$columnList |
|
260 | 260 | . $lock |
261 | 261 | . $joinSql |
262 | 262 | . $where |
263 | 263 | . $orderBySql; |
264 | 264 | |
265 | - return $this->platform->modifyLimitQuery($query, $limit, $offset ?? 0) . $lockSql; |
|
265 | + return $this->platform->modifyLimitQuery($query, $limit, $offset ?? 0).$lockSql; |
|
266 | 266 | } |
267 | 267 | |
268 | 268 | /** |
@@ -284,14 +284,14 @@ discard block |
||
284 | 284 | |
285 | 285 | if ($filterSql !== '') { |
286 | 286 | $conditionSql = $conditionSql |
287 | - ? $conditionSql . ' AND ' . $filterSql |
|
287 | + ? $conditionSql.' AND '.$filterSql |
|
288 | 288 | : $filterSql; |
289 | 289 | } |
290 | 290 | |
291 | 291 | return 'SELECT COUNT(*) ' |
292 | - . 'FROM ' . $tableName . ' ' . $baseTableAlias |
|
292 | + . 'FROM '.$tableName.' '.$baseTableAlias |
|
293 | 293 | . $joinSql |
294 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
294 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
295 | 295 | } |
296 | 296 | |
297 | 297 | /** |
@@ -307,23 +307,23 @@ discard block |
||
307 | 307 | $parentClass = $this->class; |
308 | 308 | |
309 | 309 | while (($parentClass = $parentClass->getParent()) !== null) { |
310 | - if (! $parentClass->isMappedSuperclass) { |
|
310 | + if ( ! $parentClass->isMappedSuperclass) { |
|
311 | 311 | $conditions = []; |
312 | 312 | $tableName = $parentClass->table->getQuotedQualifiedName($this->platform); |
313 | 313 | $tableAlias = $this->getSQLTableAlias($parentClass->getTableName()); |
314 | - $joinSql .= ' INNER JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
314 | + $joinSql .= ' INNER JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
315 | 315 | |
316 | 316 | foreach ($identifierColumns as $idColumn) { |
317 | 317 | $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName()); |
318 | 318 | |
319 | - $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
319 | + $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
320 | 320 | } |
321 | 321 | |
322 | 322 | $joinSql .= implode(' AND ', $conditions); |
323 | 323 | } |
324 | 324 | } |
325 | 325 | |
326 | - return parent::getLockTablesSql($lockMode) . $joinSql; |
|
326 | + return parent::getLockTablesSql($lockMode).$joinSql; |
|
327 | 327 | } |
328 | 328 | |
329 | 329 | /** |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | if ($property instanceof FieldMetadata) { |
348 | 348 | $tableClass = $parentClass = $this->class; |
349 | 349 | while ($parentClass !== $property->getDeclaringClass() && ($parentClass = $parentClass->getParent()) !== null) { |
350 | - if (! $parentClass->isMappedSuperclass) { |
|
350 | + if ( ! $parentClass->isMappedSuperclass) { |
|
351 | 351 | $tableClass = $parentClass; |
352 | 352 | } |
353 | 353 | } |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | continue; |
357 | 357 | } |
358 | 358 | |
359 | - if (! ($property instanceof ToOneAssociationMetadata) || ! $property->isOwningSide()) { |
|
359 | + if ( ! ($property instanceof ToOneAssociationMetadata) || ! $property->isOwningSide()) { |
|
360 | 360 | continue; |
361 | 361 | } |
362 | 362 | |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | /** @var JoinColumnMetadata $joinColumn */ |
367 | 367 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
368 | 368 | |
369 | - if (! $joinColumn->getType()) { |
|
369 | + if ( ! $joinColumn->getType()) { |
|
370 | 370 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
371 | 371 | } |
372 | 372 | |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | $this->currentPersisterContext->rsm->setDiscriminatorColumn('r', $resultColumnName); |
386 | 386 | $this->currentPersisterContext->rsm->addMetaResult('r', $resultColumnName, $discrColumnName, false, $discrColumnType); |
387 | 387 | |
388 | - $columnList[] = $discrColumnType->convertToDatabaseValueSQL($discrTableAlias . '.' . $quotedColumnName, $this->platform); |
|
388 | + $columnList[] = $discrColumnType->convertToDatabaseValueSQL($discrTableAlias.'.'.$quotedColumnName, $this->platform); |
|
389 | 389 | |
390 | 390 | // sub tables |
391 | 391 | foreach ($this->class->getSubClasses() as $subClassName) { |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | /** @var JoinColumnMetadata $joinColumn */ |
410 | 410 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
411 | 411 | |
412 | - if (! $joinColumn->getType()) { |
|
412 | + if ( ! $joinColumn->getType()) { |
|
413 | 413 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
414 | 414 | } |
415 | 415 | |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | $columnName = $joinColumn->getColumnName(); |
460 | 460 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
461 | 461 | |
462 | - if (! $joinColumn->getType()) { |
|
462 | + if ( ! $joinColumn->getType()) { |
|
463 | 463 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
464 | 464 | } |
465 | 465 | |
@@ -512,16 +512,16 @@ discard block |
||
512 | 512 | $parentClass = $this->class; |
513 | 513 | |
514 | 514 | while (($parentClass = $parentClass->getParent()) !== null) { |
515 | - if (! $parentClass->isMappedSuperclass) { |
|
515 | + if ( ! $parentClass->isMappedSuperclass) { |
|
516 | 516 | $conditions = []; |
517 | 517 | $tableName = $parentClass->table->getQuotedQualifiedName($this->platform); |
518 | 518 | $tableAlias = $this->getSQLTableAlias($parentClass->getTableName()); |
519 | - $joinSql .= ' INNER JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
519 | + $joinSql .= ' INNER JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
520 | 520 | |
521 | 521 | foreach ($identifierColumns as $idColumn) { |
522 | 522 | $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName()); |
523 | 523 | |
524 | - $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
524 | + $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
525 | 525 | } |
526 | 526 | |
527 | 527 | $joinSql .= implode(' AND ', $conditions); |
@@ -534,12 +534,12 @@ discard block |
||
534 | 534 | $subClass = $this->em->getClassMetadata($subClassName); |
535 | 535 | $tableName = $subClass->table->getQuotedQualifiedName($this->platform); |
536 | 536 | $tableAlias = $this->getSQLTableAlias($subClass->getTableName()); |
537 | - $joinSql .= ' LEFT JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
537 | + $joinSql .= ' LEFT JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
538 | 538 | |
539 | 539 | foreach ($identifierColumns as $idColumn) { |
540 | 540 | $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName()); |
541 | 541 | |
542 | - $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
542 | + $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
543 | 543 | } |
544 | 544 | |
545 | 545 | $joinSql .= implode(' AND ', $conditions); |
@@ -220,11 +220,11 @@ discard block |
||
220 | 220 | $this->setCache(clone $parent->cache); |
221 | 221 | } |
222 | 222 | |
223 | - if (! empty($parent->lifecycleCallbacks)) { |
|
223 | + if ( ! empty($parent->lifecycleCallbacks)) { |
|
224 | 224 | $this->lifecycleCallbacks = $parent->lifecycleCallbacks; |
225 | 225 | } |
226 | 226 | |
227 | - if (! empty($parent->entityListeners)) { |
|
227 | + if ( ! empty($parent->entityListeners)) { |
|
228 | 228 | $this->entityListeners = $parent->entityListeners; |
229 | 229 | } |
230 | 230 | } |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | { |
266 | 266 | $rootClass = $parentClass = $this; |
267 | 267 | while (($parentClass = $parentClass->getParent()) !== null) { |
268 | - if (! $parentClass->isMappedSuperclass) { |
|
268 | + if ( ! $parentClass->isMappedSuperclass) { |
|
269 | 269 | $rootClass = $parentClass; |
270 | 270 | } |
271 | 271 | } |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | */ |
297 | 297 | public function __toString() |
298 | 298 | { |
299 | - return self::class . '@' . spl_object_id($this); |
|
299 | + return self::class.'@'.spl_object_id($this); |
|
300 | 300 | } |
301 | 301 | |
302 | 302 | /** |
@@ -392,11 +392,11 @@ discard block |
||
392 | 392 | */ |
393 | 393 | public function isIdentifier(string $fieldName) : bool |
394 | 394 | { |
395 | - if (! $this->identifier) { |
|
395 | + if ( ! $this->identifier) { |
|
396 | 396 | return false; |
397 | 397 | } |
398 | 398 | |
399 | - if (! $this->isIdentifierComposite()) { |
|
399 | + if ( ! $this->isIdentifierComposite()) { |
|
400 | 400 | return $fieldName === $this->identifier[0]; |
401 | 401 | } |
402 | 402 | |
@@ -420,11 +420,11 @@ discard block |
||
420 | 420 | } |
421 | 421 | |
422 | 422 | // Verify & complete identifier mapping |
423 | - if (! $this->identifier) { |
|
423 | + if ( ! $this->identifier) { |
|
424 | 424 | throw MappingException::identifierRequired($this->className); |
425 | 425 | } |
426 | 426 | |
427 | - $explicitlyGeneratedProperties = array_filter($this->properties, static function (Property $property) : bool { |
|
427 | + $explicitlyGeneratedProperties = array_filter($this->properties, static function(Property $property) : bool { |
|
428 | 428 | return $property instanceof FieldMetadata |
429 | 429 | && $property->isPrimaryKey() |
430 | 430 | && $property->hasValueGenerator(); |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | foreach ($this->lifecycleCallbacks as $callbacks) { |
446 | 446 | /** @var array $callbacks */ |
447 | 447 | foreach ($callbacks as $callbackFuncName) { |
448 | - if (! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) { |
|
448 | + if ( ! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) { |
|
449 | 449 | throw MappingException::lifecycleCallbackMethodNotFound($this->className, $callbackFuncName); |
450 | 450 | } |
451 | 451 | } |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | throw MappingException::singleIdNotAllowedOnCompositePrimaryKey($this->className); |
475 | 475 | } |
476 | 476 | |
477 | - if (! isset($this->identifier[0])) { |
|
477 | + if ( ! isset($this->identifier[0])) { |
|
478 | 478 | throw MappingException::noIdDefined($this->className); |
479 | 479 | } |
480 | 480 | |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | // Association defined as Id field |
534 | 534 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
535 | 535 | |
536 | - if (! $property->isOwningSide()) { |
|
536 | + if ( ! $property->isOwningSide()) { |
|
537 | 537 | $property = $targetClass->getProperty($property->getMappedBy()); |
538 | 538 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
539 | 539 | } |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | $columnName = $joinColumn->getColumnName(); |
548 | 548 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
549 | 549 | |
550 | - if (! $joinColumn->getType()) { |
|
550 | + if ( ! $joinColumn->getType()) { |
|
551 | 551 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $em)); |
552 | 552 | } |
553 | 553 | |
@@ -581,10 +581,10 @@ discard block |
||
581 | 581 | { |
582 | 582 | $schema = $this->getSchemaName() === null |
583 | 583 | ? '' |
584 | - : $this->getSchemaName() . '_'; |
|
584 | + : $this->getSchemaName().'_'; |
|
585 | 585 | |
586 | 586 | // replace dots with underscores because PostgreSQL creates temporary tables in a special schema |
587 | - return $schema . $this->getTableName() . '_id_tmp'; |
|
587 | + return $schema.$this->getTableName().'_id_tmp'; |
|
588 | 588 | } |
589 | 589 | |
590 | 590 | /** |
@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | */ |
619 | 619 | public function setInheritanceType($type) : void |
620 | 620 | { |
621 | - if (! $this->isInheritanceType($type)) { |
|
621 | + if ( ! $this->isInheritanceType($type)) { |
|
622 | 622 | throw MappingException::invalidInheritanceType($this->className, $type); |
623 | 623 | } |
624 | 624 | |
@@ -636,7 +636,7 @@ discard block |
||
636 | 636 | { |
637 | 637 | $fieldName = $property->getName(); |
638 | 638 | |
639 | - if (! isset($this->properties[$fieldName])) { |
|
639 | + if ( ! isset($this->properties[$fieldName])) { |
|
640 | 640 | throw MappingException::invalidOverrideFieldName($this->className, $fieldName); |
641 | 641 | } |
642 | 642 | |
@@ -722,13 +722,13 @@ discard block |
||
722 | 722 | $declaringClass = $this->properties[$fieldName]->getDeclaringClass(); |
723 | 723 | if ($declaringClass->className === $this->className) { |
724 | 724 | return false; |
725 | - } else if (! $declaringClass->isMappedSuperclass) { |
|
725 | + } else if ( ! $declaringClass->isMappedSuperclass) { |
|
726 | 726 | return true; |
727 | 727 | } |
728 | 728 | |
729 | 729 | $parentClass = $this; |
730 | 730 | while (($parentClass = $parentClass->getParent()) !== $declaringClass) { |
731 | - if (! $parentClass->isMappedSuperclass) { |
|
731 | + if ( ! $parentClass->isMappedSuperclass) { |
|
732 | 732 | return true; |
733 | 733 | } |
734 | 734 | } |
@@ -850,7 +850,7 @@ discard block |
||
850 | 850 | $inheritedProperty = $declaringClass->isMappedSuperclass ? clone $property : $property; |
851 | 851 | |
852 | 852 | if ($inheritedProperty instanceof FieldMetadata) { |
853 | - if (! $declaringClass->isMappedSuperclass) { |
|
853 | + if ( ! $declaringClass->isMappedSuperclass) { |
|
854 | 854 | $inheritedProperty->setTableName($property->getTableName()); |
855 | 855 | } |
856 | 856 | |
@@ -943,11 +943,11 @@ discard block |
||
943 | 943 | 'method' => $methodName, |
944 | 944 | ]; |
945 | 945 | |
946 | - if (! class_exists($class)) { |
|
946 | + if ( ! class_exists($class)) { |
|
947 | 947 | throw MappingException::entityListenerClassNotFound($class, $this->className); |
948 | 948 | } |
949 | 949 | |
950 | - if (! method_exists($class, $methodName)) { |
|
950 | + if ( ! method_exists($class, $methodName)) { |
|
951 | 951 | throw MappingException::entityListenerMethodNotFound($class, $methodName, $this->className); |
952 | 952 | } |
953 | 953 | |
@@ -1015,7 +1015,7 @@ discard block |
||
1015 | 1015 | return; |
1016 | 1016 | } |
1017 | 1017 | |
1018 | - if (! (class_exists($className) || interface_exists($className))) { |
|
1018 | + if ( ! (class_exists($className) || interface_exists($className))) { |
|
1019 | 1019 | throw MappingException::invalidClassInDiscriminatorMap($className, $this->className); |
1020 | 1020 | } |
1021 | 1021 |
@@ -50,7 +50,7 @@ |
||
50 | 50 | self::assertNotNull($child); |
51 | 51 | |
52 | 52 | // Test lock and update |
53 | - $this->em->transactional(static function ($em) use ($child) { |
|
53 | + $this->em->transactional(static function($em) use ($child) { |
|
54 | 54 | $em->lock($child, LockMode::NONE); |
55 | 55 | $child->firstName = 'Bob'; |
56 | 56 | $child->status = 0; |
@@ -270,10 +270,10 @@ discard block |
||
270 | 270 | */ |
271 | 271 | public function getSQLTableAlias($tableName, $dqlAlias = '') |
272 | 272 | { |
273 | - $tableName .= $dqlAlias ? '@[' . $dqlAlias . ']' : ''; |
|
273 | + $tableName .= $dqlAlias ? '@['.$dqlAlias.']' : ''; |
|
274 | 274 | |
275 | - if (! isset($this->tableAliasMap[$tableName])) { |
|
276 | - $this->tableAliasMap[$tableName] = 't' . $this->tableAliasCounter++; |
|
275 | + if ( ! isset($this->tableAliasMap[$tableName])) { |
|
276 | + $this->tableAliasMap[$tableName] = 't'.$this->tableAliasCounter++; |
|
277 | 277 | } |
278 | 278 | |
279 | 279 | return $this->tableAliasMap[$tableName]; |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | */ |
292 | 292 | public function setSQLTableAlias($tableName, $alias, $dqlAlias = '') |
293 | 293 | { |
294 | - $tableName .= $dqlAlias ? '@[' . $dqlAlias . ']' : ''; |
|
294 | + $tableName .= $dqlAlias ? '@['.$dqlAlias.']' : ''; |
|
295 | 295 | |
296 | 296 | $this->tableAliasMap[$tableName] = $alias; |
297 | 297 | |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | */ |
306 | 306 | public function getSQLColumnAlias() |
307 | 307 | { |
308 | - return $this->platform->getSQLResultCasing('c' . $this->aliasCounter++); |
|
308 | + return $this->platform->getSQLResultCasing('c'.$this->aliasCounter++); |
|
309 | 309 | } |
310 | 310 | |
311 | 311 | /** |
@@ -327,20 +327,20 @@ discard block |
||
327 | 327 | $parentClass = $class; |
328 | 328 | |
329 | 329 | while (($parentClass = $parentClass->getParent()) !== null) { |
330 | - if (! $parentClass->isMappedSuperclass) { |
|
330 | + if ( ! $parentClass->isMappedSuperclass) { |
|
331 | 331 | $tableName = $parentClass->table->getQuotedQualifiedName($this->platform); |
332 | 332 | $tableAlias = $this->getSQLTableAlias($parentClass->getTableName(), $dqlAlias); |
333 | 333 | |
334 | 334 | // If this is a joined association we must use left joins to preserve the correct result. |
335 | 335 | $sql .= isset($this->queryComponents[$dqlAlias]['relation']) ? ' LEFT ' : ' INNER '; |
336 | - $sql .= 'JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
336 | + $sql .= 'JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
337 | 337 | |
338 | 338 | $sqlParts = []; |
339 | 339 | |
340 | 340 | foreach ($class->getIdentifierColumns($this->em) as $column) { |
341 | 341 | $quotedColumnName = $this->platform->quoteIdentifier($column->getColumnName()); |
342 | 342 | |
343 | - $sqlParts[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
343 | + $sqlParts[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
344 | 344 | } |
345 | 345 | |
346 | 346 | $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->getPropertiesIterator() 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->getPropertiesIterator() 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->getPropertiesIterator() 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 | return ''; |
@@ -1929,7 +1929,7 @@ discard block |
||
1929 | 1929 | { |
1930 | 1930 | $sql = $existsExpr->not ? 'NOT ' : ''; |
1931 | 1931 | |
1932 | - $sql .= 'EXISTS (' . $this->walkSubselect($existsExpr->subselect) . ')'; |
|
1932 | + $sql .= 'EXISTS ('.$this->walkSubselect($existsExpr->subselect).')'; |
|
1933 | 1933 | |
1934 | 1934 | return $sql; |
1935 | 1935 | } |
@@ -1977,7 +1977,7 @@ discard block |
||
1977 | 1977 | $targetTableAlias = $this->getSQLTableAlias($targetClass->getTableName()); |
1978 | 1978 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
1979 | 1979 | |
1980 | - $sql .= $targetTableName . ' ' . $targetTableAlias . ' WHERE '; |
|
1980 | + $sql .= $targetTableName.' '.$targetTableAlias.' WHERE '; |
|
1981 | 1981 | |
1982 | 1982 | $sqlParts = []; |
1983 | 1983 | |
@@ -1998,7 +1998,7 @@ discard block |
||
1998 | 1998 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
1999 | 1999 | } |
2000 | 2000 | |
2001 | - $sqlParts[] = $targetTableAlias . '.' . $quotedTargetColumnName . ' = ' . $entitySql; |
|
2001 | + $sqlParts[] = $targetTableAlias.'.'.$quotedTargetColumnName.' = '.$entitySql; |
|
2002 | 2002 | } |
2003 | 2003 | |
2004 | 2004 | $sql .= implode(' AND ', $sqlParts); |
@@ -2012,7 +2012,7 @@ discard block |
||
2012 | 2012 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
2013 | 2013 | |
2014 | 2014 | // join to target table |
2015 | - $sql .= $joinTableName . ' ' . $joinTableAlias . ' INNER JOIN ' . $targetTableName . ' ' . $targetTableAlias . ' ON '; |
|
2015 | + $sql .= $joinTableName.' '.$joinTableAlias.' INNER JOIN '.$targetTableName.' '.$targetTableAlias.' ON '; |
|
2016 | 2016 | |
2017 | 2017 | // join conditions |
2018 | 2018 | $joinSqlParts = []; |
@@ -2061,13 +2061,13 @@ discard block |
||
2061 | 2061 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
2062 | 2062 | } |
2063 | 2063 | |
2064 | - $sqlParts[] = $targetTableAlias . '.' . $quotedTargetColumnName . ' = ' . $entitySql; |
|
2064 | + $sqlParts[] = $targetTableAlias.'.'.$quotedTargetColumnName.' = '.$entitySql; |
|
2065 | 2065 | } |
2066 | 2066 | |
2067 | 2067 | $sql .= implode(' AND ', $sqlParts); |
2068 | 2068 | } |
2069 | 2069 | |
2070 | - return $sql . ')'; |
|
2070 | + return $sql.')'; |
|
2071 | 2071 | } |
2072 | 2072 | |
2073 | 2073 | /** |
@@ -2078,7 +2078,7 @@ discard block |
||
2078 | 2078 | $sizeFunc = new AST\Functions\SizeFunction('size'); |
2079 | 2079 | $sizeFunc->collectionPathExpression = $emptyCollCompExpr->expression; |
2080 | 2080 | |
2081 | - return $sizeFunc->getSql($this) . ($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
2081 | + return $sizeFunc->getSql($this).($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
2082 | 2082 | } |
2083 | 2083 | |
2084 | 2084 | /** |
@@ -2087,19 +2087,19 @@ discard block |
||
2087 | 2087 | public function walkNullComparisonExpression($nullCompExpr) |
2088 | 2088 | { |
2089 | 2089 | $expression = $nullCompExpr->expression; |
2090 | - $comparison = ' IS' . ($nullCompExpr->not ? ' NOT' : '') . ' NULL'; |
|
2090 | + $comparison = ' IS'.($nullCompExpr->not ? ' NOT' : '').' NULL'; |
|
2091 | 2091 | |
2092 | 2092 | // Handle ResultVariable |
2093 | 2093 | if (is_string($expression) && isset($this->queryComponents[$expression]['resultVariable'])) { |
2094 | - return $this->walkResultVariable($expression) . $comparison; |
|
2094 | + return $this->walkResultVariable($expression).$comparison; |
|
2095 | 2095 | } |
2096 | 2096 | |
2097 | 2097 | // Handle InputParameter mapping inclusion to ParserResult |
2098 | 2098 | if ($expression instanceof AST\InputParameter) { |
2099 | - return $this->walkInputParameter($expression) . $comparison; |
|
2099 | + return $this->walkInputParameter($expression).$comparison; |
|
2100 | 2100 | } |
2101 | 2101 | |
2102 | - return $expression->dispatch($this) . $comparison; |
|
2102 | + return $expression->dispatch($this).$comparison; |
|
2103 | 2103 | } |
2104 | 2104 | |
2105 | 2105 | /** |
@@ -2107,7 +2107,7 @@ discard block |
||
2107 | 2107 | */ |
2108 | 2108 | public function walkInExpression($inExpr) |
2109 | 2109 | { |
2110 | - $sql = $this->walkArithmeticExpression($inExpr->expression) . ($inExpr->not ? ' NOT' : '') . ' IN ('; |
|
2110 | + $sql = $this->walkArithmeticExpression($inExpr->expression).($inExpr->not ? ' NOT' : '').' IN ('; |
|
2111 | 2111 | |
2112 | 2112 | $sql .= $inExpr->subselect |
2113 | 2113 | ? $this->walkSubselect($inExpr->subselect) |
@@ -2132,12 +2132,12 @@ discard block |
||
2132 | 2132 | $discrColumnType = $discrColumn->getType(); |
2133 | 2133 | $quotedColumnName = $this->platform->quoteIdentifier($discrColumn->getColumnName()); |
2134 | 2134 | $sqlTableAlias = $this->useSqlTableAliases |
2135 | - ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias) . '.' |
|
2135 | + ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias).'.' |
|
2136 | 2136 | : ''; |
2137 | 2137 | |
2138 | 2138 | return sprintf( |
2139 | 2139 | '%s %sIN %s', |
2140 | - $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . $quotedColumnName, $this->platform), |
|
2140 | + $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.$quotedColumnName, $this->platform), |
|
2141 | 2141 | ($instanceOfExpr->not ? 'NOT ' : ''), |
2142 | 2142 | $this->getChildDiscriminatorsFromClassMetadata($discrClass, $instanceOfExpr) |
2143 | 2143 | ); |
@@ -2181,8 +2181,8 @@ discard block |
||
2181 | 2181 | $sql .= ' NOT'; |
2182 | 2182 | } |
2183 | 2183 | |
2184 | - $sql .= ' BETWEEN ' . $this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
2185 | - . ' AND ' . $this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
2184 | + $sql .= ' BETWEEN '.$this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
2185 | + . ' AND '.$this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
2186 | 2186 | |
2187 | 2187 | return $sql; |
2188 | 2188 | } |
@@ -2197,7 +2197,7 @@ discard block |
||
2197 | 2197 | ? $this->walkResultVariable($stringExpr) |
2198 | 2198 | : $stringExpr->dispatch($this); |
2199 | 2199 | |
2200 | - $sql = $leftExpr . ($likeExpr->not ? ' NOT' : '') . ' LIKE '; |
|
2200 | + $sql = $leftExpr.($likeExpr->not ? ' NOT' : '').' LIKE '; |
|
2201 | 2201 | |
2202 | 2202 | if ($likeExpr->stringPattern instanceof AST\InputParameter) { |
2203 | 2203 | $sql .= $this->walkInputParameter($likeExpr->stringPattern); |
@@ -2210,7 +2210,7 @@ discard block |
||
2210 | 2210 | } |
2211 | 2211 | |
2212 | 2212 | if ($likeExpr->escapeChar) { |
2213 | - $sql .= ' ESCAPE ' . $this->walkLiteral($likeExpr->escapeChar); |
|
2213 | + $sql .= ' ESCAPE '.$this->walkLiteral($likeExpr->escapeChar); |
|
2214 | 2214 | } |
2215 | 2215 | |
2216 | 2216 | return $sql; |
@@ -2237,7 +2237,7 @@ discard block |
||
2237 | 2237 | ? $leftExpr->dispatch($this) |
2238 | 2238 | : (is_numeric($leftExpr) ? $leftExpr : $this->conn->quote($leftExpr)); |
2239 | 2239 | |
2240 | - $sql .= ' ' . $compExpr->operator . ' '; |
|
2240 | + $sql .= ' '.$compExpr->operator.' '; |
|
2241 | 2241 | |
2242 | 2242 | $sql .= $rightExpr instanceof AST\Node |
2243 | 2243 | ? $rightExpr->dispatch($this) |
@@ -2273,7 +2273,7 @@ discard block |
||
2273 | 2273 | { |
2274 | 2274 | return $arithmeticExpr->isSimpleArithmeticExpression() |
2275 | 2275 | ? $this->walkSimpleArithmeticExpression($arithmeticExpr->simpleArithmeticExpression) |
2276 | - : '(' . $this->walkSubselect($arithmeticExpr->subselect) . ')'; |
|
2276 | + : '('.$this->walkSubselect($arithmeticExpr->subselect).')'; |
|
2277 | 2277 | } |
2278 | 2278 | |
2279 | 2279 | /** |
@@ -2281,7 +2281,7 @@ discard block |
||
2281 | 2281 | */ |
2282 | 2282 | public function walkSimpleArithmeticExpression($simpleArithmeticExpr) |
2283 | 2283 | { |
2284 | - if (! ($simpleArithmeticExpr instanceof AST\SimpleArithmeticExpression)) { |
|
2284 | + if ( ! ($simpleArithmeticExpr instanceof AST\SimpleArithmeticExpression)) { |
|
2285 | 2285 | return $this->walkArithmeticTerm($simpleArithmeticExpr); |
2286 | 2286 | } |
2287 | 2287 | |
@@ -2301,7 +2301,7 @@ discard block |
||
2301 | 2301 | |
2302 | 2302 | // Phase 2 AST optimization: Skip processing of ArithmeticTerm |
2303 | 2303 | // if only one ArithmeticFactor is defined |
2304 | - if (! ($term instanceof AST\ArithmeticTerm)) { |
|
2304 | + if ( ! ($term instanceof AST\ArithmeticTerm)) { |
|
2305 | 2305 | return $this->walkArithmeticFactor($term); |
2306 | 2306 | } |
2307 | 2307 | |
@@ -2321,13 +2321,13 @@ discard block |
||
2321 | 2321 | |
2322 | 2322 | // Phase 2 AST optimization: Skip processing of ArithmeticFactor |
2323 | 2323 | // if only one ArithmeticPrimary is defined |
2324 | - if (! ($factor instanceof AST\ArithmeticFactor)) { |
|
2324 | + if ( ! ($factor instanceof AST\ArithmeticFactor)) { |
|
2325 | 2325 | return $this->walkArithmeticPrimary($factor); |
2326 | 2326 | } |
2327 | 2327 | |
2328 | 2328 | $sign = $factor->isNegativeSigned() ? '-' : ($factor->isPositiveSigned() ? '+' : ''); |
2329 | 2329 | |
2330 | - return $sign . $this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
2330 | + return $sign.$this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
2331 | 2331 | } |
2332 | 2332 | |
2333 | 2333 | /** |
@@ -2340,7 +2340,7 @@ discard block |
||
2340 | 2340 | public function walkArithmeticPrimary($primary) |
2341 | 2341 | { |
2342 | 2342 | if ($primary instanceof AST\SimpleArithmeticExpression) { |
2343 | - return '(' . $this->walkSimpleArithmeticExpression($primary) . ')'; |
|
2343 | + return '('.$this->walkSimpleArithmeticExpression($primary).')'; |
|
2344 | 2344 | } |
2345 | 2345 | |
2346 | 2346 | if ($primary instanceof AST\Node) { |
@@ -2398,7 +2398,7 @@ discard block |
||
2398 | 2398 | $entityClassName = $entityClass->getClassName(); |
2399 | 2399 | |
2400 | 2400 | if ($entityClassName !== $rootClass->getClassName()) { |
2401 | - if (! $entityClass->getReflectionClass()->isSubclassOf($rootClass->getClassName())) { |
|
2401 | + if ( ! $entityClass->getReflectionClass()->isSubclassOf($rootClass->getClassName())) { |
|
2402 | 2402 | throw QueryException::instanceOfUnrelatedClass($entityClassName, $rootClass->getClassName()); |
2403 | 2403 | } |
2404 | 2404 | } |
@@ -2410,6 +2410,6 @@ discard block |
||
2410 | 2410 | $sqlParameterList[] = $this->conn->quote($discriminator); |
2411 | 2411 | } |
2412 | 2412 | |
2413 | - return '(' . implode(', ', $sqlParameterList) . ')'; |
|
2413 | + return '('.implode(', ', $sqlParameterList).')'; |
|
2414 | 2414 | } |
2415 | 2415 | } |