@@ -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 /*' . get_class($this) . '*/'); |
|
658 | + static::$sharedConn->executeQuery('SELECT 1 /*'.get_class($this).'*/'); |
|
659 | 659 | } elseif (static::$sharedConn->getDatabasePlatform()->getName() === 'oracle') { |
660 | - static::$sharedConn->executeQuery('SELECT 1 /*' . get_class($this) . '*/ FROM dual'); |
|
660 | + static::$sharedConn->executeQuery('SELECT 1 /*'.get_class($this).'*/ 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 | } |
@@ -35,6 +35,6 @@ |
||
35 | 35 | |
36 | 36 | public function __toString() |
37 | 37 | { |
38 | - return self::class . '[id=' . $this->id . ']'; |
|
38 | + return self::class.'[id='.$this->id.']'; |
|
39 | 39 | } |
40 | 40 | } |
@@ -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 | } |
@@ -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 | |
@@ -855,7 +855,7 @@ discard block |
||
855 | 855 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($identificationVariableDecl); |
856 | 856 | } |
857 | 857 | |
858 | - return ' FROM ' . implode(', ', $sqlParts); |
|
858 | + return ' FROM '.implode(', ', $sqlParts); |
|
859 | 859 | } |
860 | 860 | |
861 | 861 | /** |
@@ -930,7 +930,7 @@ discard block |
||
930 | 930 | $tableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
931 | 931 | |
932 | 932 | $sql = $this->platform->appendLockHint( |
933 | - $tableName . ' ' . $tableAlias, |
|
933 | + $tableName.' '.$tableAlias, |
|
934 | 934 | $this->query->getHint(Query::HINT_LOCK_MODE) |
935 | 935 | ); |
936 | 936 | |
@@ -940,11 +940,11 @@ discard block |
||
940 | 940 | |
941 | 941 | $classTableInheritanceJoins = $this->generateClassTableInheritanceJoins($class, $dqlAlias); |
942 | 942 | |
943 | - if (! $buildNestedJoins) { |
|
944 | - return $sql . $classTableInheritanceJoins; |
|
943 | + if ( ! $buildNestedJoins) { |
|
944 | + return $sql.$classTableInheritanceJoins; |
|
945 | 945 | } |
946 | 946 | |
947 | - return $classTableInheritanceJoins === '' ? $sql : '(' . $sql . $classTableInheritanceJoins . ')'; |
|
947 | + return $classTableInheritanceJoins === '' ? $sql : '('.$sql.$classTableInheritanceJoins.')'; |
|
948 | 948 | } |
949 | 949 | |
950 | 950 | /** |
@@ -980,7 +980,7 @@ discard block |
||
980 | 980 | : $association; |
981 | 981 | |
982 | 982 | if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) === true && |
983 | - (! $this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
983 | + ( ! $this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
984 | 984 | if ($association instanceof ToManyAssociationMetadata) { |
985 | 985 | throw QueryException::iterateWithFetchJoinNotAllowed($owningAssociation); |
986 | 986 | } |
@@ -1034,7 +1034,7 @@ discard block |
||
1034 | 1034 | } |
1035 | 1035 | |
1036 | 1036 | $targetTableJoin = [ |
1037 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
1037 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
1038 | 1038 | 'condition' => implode(' AND ', $conditions), |
1039 | 1039 | ]; |
1040 | 1040 | } elseif ($owningAssociation instanceof ManyToManyAssociationMetadata) { |
@@ -1061,7 +1061,7 @@ discard block |
||
1061 | 1061 | ); |
1062 | 1062 | } |
1063 | 1063 | |
1064 | - $sql .= $joinTableName . ' ' . $joinTableAlias . ' ON ' . implode(' AND ', $conditions); |
|
1064 | + $sql .= $joinTableName.' '.$joinTableAlias.' ON '.implode(' AND ', $conditions); |
|
1065 | 1065 | |
1066 | 1066 | // Join target table |
1067 | 1067 | $sql .= $joinType === AST\Join::JOIN_TYPE_LEFT || $joinType === AST\Join::JOIN_TYPE_LEFTOUTER ? ' LEFT JOIN ' : ' INNER JOIN '; |
@@ -1099,7 +1099,7 @@ discard block |
||
1099 | 1099 | } |
1100 | 1100 | |
1101 | 1101 | $targetTableJoin = [ |
1102 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
1102 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
1103 | 1103 | 'condition' => implode(' AND ', $conditions), |
1104 | 1104 | ]; |
1105 | 1105 | } else { |
@@ -1107,23 +1107,23 @@ discard block |
||
1107 | 1107 | } |
1108 | 1108 | |
1109 | 1109 | // Handle WITH clause |
1110 | - $withCondition = $condExpr === null ? '' : ('(' . $this->walkConditionalExpression($condExpr) . ')'); |
|
1110 | + $withCondition = $condExpr === null ? '' : ('('.$this->walkConditionalExpression($condExpr).')'); |
|
1111 | 1111 | |
1112 | 1112 | if ($targetClass->inheritanceType === InheritanceType::JOINED) { |
1113 | 1113 | $ctiJoins = $this->generateClassTableInheritanceJoins($targetClass, $joinedDqlAlias); |
1114 | 1114 | |
1115 | 1115 | // If we have WITH condition, we need to build nested joins for target class table and cti joins |
1116 | 1116 | if ($withCondition) { |
1117 | - $sql .= '(' . $targetTableJoin['table'] . $ctiJoins . ') ON ' . $targetTableJoin['condition']; |
|
1117 | + $sql .= '('.$targetTableJoin['table'].$ctiJoins.') ON '.$targetTableJoin['condition']; |
|
1118 | 1118 | } else { |
1119 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition'] . $ctiJoins; |
|
1119 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition'].$ctiJoins; |
|
1120 | 1120 | } |
1121 | 1121 | } else { |
1122 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition']; |
|
1122 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition']; |
|
1123 | 1123 | } |
1124 | 1124 | |
1125 | 1125 | if ($withCondition) { |
1126 | - $sql .= ' AND ' . $withCondition; |
|
1126 | + $sql .= ' AND '.$withCondition; |
|
1127 | 1127 | } |
1128 | 1128 | |
1129 | 1129 | // Apply the indexes |
@@ -1157,7 +1157,7 @@ discard block |
||
1157 | 1157 | $orderByItems = array_merge($orderByItems, (array) $collectionOrderByItems); |
1158 | 1158 | } |
1159 | 1159 | |
1160 | - return ' ORDER BY ' . implode(', ', $orderByItems); |
|
1160 | + return ' ORDER BY '.implode(', ', $orderByItems); |
|
1161 | 1161 | } |
1162 | 1162 | |
1163 | 1163 | /** |
@@ -1174,10 +1174,10 @@ discard block |
||
1174 | 1174 | $this->orderedColumnsMap[$sql] = $type; |
1175 | 1175 | |
1176 | 1176 | if ($expr instanceof AST\Subselect) { |
1177 | - return '(' . $sql . ') ' . $type; |
|
1177 | + return '('.$sql.') '.$type; |
|
1178 | 1178 | } |
1179 | 1179 | |
1180 | - return $sql . ' ' . $type; |
|
1180 | + return $sql.' '.$type; |
|
1181 | 1181 | } |
1182 | 1182 | |
1183 | 1183 | /** |
@@ -1185,7 +1185,7 @@ discard block |
||
1185 | 1185 | */ |
1186 | 1186 | public function walkHavingClause($havingClause) |
1187 | 1187 | { |
1188 | - return ' HAVING ' . $this->walkConditionalExpression($havingClause->conditionalExpression); |
|
1188 | + return ' HAVING '.$this->walkConditionalExpression($havingClause->conditionalExpression); |
|
1189 | 1189 | } |
1190 | 1190 | |
1191 | 1191 | /** |
@@ -1208,7 +1208,7 @@ discard block |
||
1208 | 1208 | $conditions = []; |
1209 | 1209 | |
1210 | 1210 | if ($join->conditionalExpression) { |
1211 | - $conditions[] = '(' . $this->walkConditionalExpression($join->conditionalExpression) . ')'; |
|
1211 | + $conditions[] = '('.$this->walkConditionalExpression($join->conditionalExpression).')'; |
|
1212 | 1212 | } |
1213 | 1213 | |
1214 | 1214 | $isUnconditionalJoin = empty($conditions); |
@@ -1233,7 +1233,7 @@ discard block |
||
1233 | 1233 | } |
1234 | 1234 | |
1235 | 1235 | if ($conditions) { |
1236 | - $sql .= $condExprConjunction . implode(' AND ', $conditions); |
|
1236 | + $sql .= $condExprConjunction.implode(' AND ', $conditions); |
|
1237 | 1237 | } |
1238 | 1238 | |
1239 | 1239 | break; |
@@ -1263,7 +1263,7 @@ discard block |
||
1263 | 1263 | $scalarExpressions[] = $this->walkSimpleArithmeticExpression($scalarExpression); |
1264 | 1264 | } |
1265 | 1265 | |
1266 | - $sql .= implode(', ', $scalarExpressions) . ')'; |
|
1266 | + $sql .= implode(', ', $scalarExpressions).')'; |
|
1267 | 1267 | |
1268 | 1268 | return $sql; |
1269 | 1269 | } |
@@ -1285,7 +1285,7 @@ discard block |
||
1285 | 1285 | ? $this->conn->quote($nullIfExpression->secondExpression) |
1286 | 1286 | : $this->walkSimpleArithmeticExpression($nullIfExpression->secondExpression); |
1287 | 1287 | |
1288 | - return 'NULLIF(' . $firstExpression . ', ' . $secondExpression . ')'; |
|
1288 | + return 'NULLIF('.$firstExpression.', '.$secondExpression.')'; |
|
1289 | 1289 | } |
1290 | 1290 | |
1291 | 1291 | /** |
@@ -1298,11 +1298,11 @@ discard block |
||
1298 | 1298 | $sql = 'CASE'; |
1299 | 1299 | |
1300 | 1300 | foreach ($generalCaseExpression->whenClauses as $whenClause) { |
1301 | - $sql .= ' WHEN ' . $this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
1302 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
1301 | + $sql .= ' WHEN '.$this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
1302 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
1303 | 1303 | } |
1304 | 1304 | |
1305 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression) . ' END'; |
|
1305 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression).' END'; |
|
1306 | 1306 | |
1307 | 1307 | return $sql; |
1308 | 1308 | } |
@@ -1316,14 +1316,14 @@ discard block |
||
1316 | 1316 | */ |
1317 | 1317 | public function walkSimpleCaseExpression($simpleCaseExpression) |
1318 | 1318 | { |
1319 | - $sql = 'CASE ' . $this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
1319 | + $sql = 'CASE '.$this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
1320 | 1320 | |
1321 | 1321 | foreach ($simpleCaseExpression->simpleWhenClauses as $simpleWhenClause) { |
1322 | - $sql .= ' WHEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
1323 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
1322 | + $sql .= ' WHEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
1323 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
1324 | 1324 | } |
1325 | 1325 | |
1326 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression) . ' END'; |
|
1326 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression).' END'; |
|
1327 | 1327 | |
1328 | 1328 | return $sql; |
1329 | 1329 | } |
@@ -1364,7 +1364,7 @@ discard block |
||
1364 | 1364 | |
1365 | 1365 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1366 | 1366 | |
1367 | - if (! $hidden) { |
|
1367 | + if ( ! $hidden) { |
|
1368 | 1368 | $this->rsm->addScalarResult($columnAlias, $resultAlias, $property->getType()); |
1369 | 1369 | $this->scalarFields[$dqlAlias][$fieldName] = $columnAlias; |
1370 | 1370 | } |
@@ -1385,11 +1385,11 @@ discard block |
||
1385 | 1385 | $columnAlias = $this->getSQLColumnAlias(); |
1386 | 1386 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1387 | 1387 | |
1388 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
1388 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
1389 | 1389 | |
1390 | 1390 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1391 | 1391 | |
1392 | - if (! $hidden) { |
|
1392 | + if ( ! $hidden) { |
|
1393 | 1393 | // Conceptually we could resolve field type here by traverse through AST to retrieve field type, |
1394 | 1394 | // but this is not a feasible solution; assume 'string'. |
1395 | 1395 | $this->rsm->addScalarResult($columnAlias, $resultAlias, Type::getType('string')); |
@@ -1400,11 +1400,11 @@ discard block |
||
1400 | 1400 | $columnAlias = $this->getSQLColumnAlias(); |
1401 | 1401 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1402 | 1402 | |
1403 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
1403 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
1404 | 1404 | |
1405 | 1405 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1406 | 1406 | |
1407 | - if (! $hidden) { |
|
1407 | + if ( ! $hidden) { |
|
1408 | 1408 | // We cannot resolve field type here; assume 'string'. |
1409 | 1409 | $this->rsm->addScalarResult($columnAlias, $resultAlias, Type::getType('string')); |
1410 | 1410 | } |
@@ -1428,7 +1428,7 @@ discard block |
||
1428 | 1428 | $class = $queryComp['metadata']; |
1429 | 1429 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: null; |
1430 | 1430 | |
1431 | - if (! isset($this->selectedClasses[$dqlAlias])) { |
|
1431 | + if ( ! isset($this->selectedClasses[$dqlAlias])) { |
|
1432 | 1432 | $this->selectedClasses[$dqlAlias] = [ |
1433 | 1433 | 'class' => $class, |
1434 | 1434 | 'dqlAlias' => $dqlAlias, |
@@ -1440,7 +1440,7 @@ discard block |
||
1440 | 1440 | |
1441 | 1441 | // Select all fields from the queried class |
1442 | 1442 | foreach ($class->getDeclaredPropertiesIterator() as $fieldName => $property) { |
1443 | - if (! ($property instanceof FieldMetadata)) { |
|
1443 | + if ( ! ($property instanceof FieldMetadata)) { |
|
1444 | 1444 | continue; |
1445 | 1445 | } |
1446 | 1446 | |
@@ -1475,7 +1475,7 @@ discard block |
||
1475 | 1475 | $subClass = $this->em->getClassMetadata($subClassName); |
1476 | 1476 | |
1477 | 1477 | foreach ($subClass->getDeclaredPropertiesIterator() as $fieldName => $property) { |
1478 | - if (! ($property instanceof FieldMetadata)) { |
|
1478 | + if ( ! ($property instanceof FieldMetadata)) { |
|
1479 | 1479 | continue; |
1480 | 1480 | } |
1481 | 1481 | |
@@ -1514,7 +1514,7 @@ discard block |
||
1514 | 1514 | */ |
1515 | 1515 | public function walkQuantifiedExpression($qExpr) |
1516 | 1516 | { |
1517 | - return ' ' . strtoupper($qExpr->type) . '(' . $this->walkSubselect($qExpr->subselect) . ')'; |
|
1517 | + return ' '.strtoupper($qExpr->type).'('.$this->walkSubselect($qExpr->subselect).')'; |
|
1518 | 1518 | } |
1519 | 1519 | |
1520 | 1520 | /** |
@@ -1554,7 +1554,7 @@ discard block |
||
1554 | 1554 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($subselectIdVarDecl); |
1555 | 1555 | } |
1556 | 1556 | |
1557 | - return ' FROM ' . implode(', ', $sqlParts); |
|
1557 | + return ' FROM '.implode(', ', $sqlParts); |
|
1558 | 1558 | } |
1559 | 1559 | |
1560 | 1560 | /** |
@@ -1562,7 +1562,7 @@ discard block |
||
1562 | 1562 | */ |
1563 | 1563 | public function walkSimpleSelectClause($simpleSelectClause) |
1564 | 1564 | { |
1565 | - return 'SELECT' . ($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
1565 | + return 'SELECT'.($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
1566 | 1566 | . $this->walkSimpleSelectExpression($simpleSelectClause->simpleSelectExpression); |
1567 | 1567 | } |
1568 | 1568 | |
@@ -1596,7 +1596,7 @@ discard block |
||
1596 | 1596 | break; |
1597 | 1597 | |
1598 | 1598 | case $e instanceof AST\Subselect: |
1599 | - $sqlSelectExpressions[] = '(' . $e->dispatch($this) . ') AS ' . $columnAlias; |
|
1599 | + $sqlSelectExpressions[] = '('.$e->dispatch($this).') AS '.$columnAlias; |
|
1600 | 1600 | break; |
1601 | 1601 | |
1602 | 1602 | case $e instanceof AST\PathExpression: |
@@ -1605,7 +1605,7 @@ discard block |
||
1605 | 1605 | $class = $qComp['metadata']; |
1606 | 1606 | $fieldType = $class->getProperty($e->field)->getType(); |
1607 | 1607 | |
1608 | - $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1608 | + $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias; |
|
1609 | 1609 | break; |
1610 | 1610 | |
1611 | 1611 | case $e instanceof AST\Literal: |
@@ -1619,11 +1619,11 @@ discard block |
||
1619 | 1619 | break; |
1620 | 1620 | } |
1621 | 1621 | |
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 | default: |
1626 | - $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1626 | + $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias; |
|
1627 | 1627 | break; |
1628 | 1628 | } |
1629 | 1629 | |
@@ -1656,10 +1656,10 @@ discard block |
||
1656 | 1656 | case $expr instanceof AST\Subselect: |
1657 | 1657 | $alias = $simpleSelectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1658 | 1658 | |
1659 | - $columnAlias = 'sclr' . $this->aliasCounter++; |
|
1659 | + $columnAlias = 'sclr'.$this->aliasCounter++; |
|
1660 | 1660 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
1661 | 1661 | |
1662 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
1662 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
1663 | 1663 | break; |
1664 | 1664 | |
1665 | 1665 | case $expr instanceof AST\Functions\FunctionNode: |
@@ -1676,7 +1676,7 @@ discard block |
||
1676 | 1676 | $columnAlias = $this->getSQLColumnAlias(); |
1677 | 1677 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
1678 | 1678 | |
1679 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
1679 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
1680 | 1680 | break; |
1681 | 1681 | |
1682 | 1682 | case $expr instanceof AST\ParenthesisExpression: |
@@ -1696,8 +1696,8 @@ discard block |
||
1696 | 1696 | */ |
1697 | 1697 | public function walkAggregateExpression($aggExpression) |
1698 | 1698 | { |
1699 | - return $aggExpression->functionName . '(' . ($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
1700 | - . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression) . ')'; |
|
1699 | + return $aggExpression->functionName.'('.($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
1700 | + . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression).')'; |
|
1701 | 1701 | } |
1702 | 1702 | |
1703 | 1703 | /** |
@@ -1711,7 +1711,7 @@ discard block |
||
1711 | 1711 | $sqlParts[] = $this->walkGroupByItem($groupByItem); |
1712 | 1712 | } |
1713 | 1713 | |
1714 | - return ' GROUP BY ' . implode(', ', $sqlParts); |
|
1714 | + return ' GROUP BY '.implode(', ', $sqlParts); |
|
1715 | 1715 | } |
1716 | 1716 | |
1717 | 1717 | /** |
@@ -1720,7 +1720,7 @@ discard block |
||
1720 | 1720 | public function walkGroupByItem($groupByItem) |
1721 | 1721 | { |
1722 | 1722 | // StateFieldPathExpression |
1723 | - if (! is_string($groupByItem)) { |
|
1723 | + if ( ! is_string($groupByItem)) { |
|
1724 | 1724 | return $this->walkPathExpression($groupByItem); |
1725 | 1725 | } |
1726 | 1726 | |
@@ -1774,7 +1774,7 @@ discard block |
||
1774 | 1774 | { |
1775 | 1775 | $class = $this->em->getClassMetadata($deleteClause->abstractSchemaName); |
1776 | 1776 | $tableName = $class->getTableName(); |
1777 | - $sql = 'DELETE FROM ' . $class->table->getQuotedQualifiedName($this->platform); |
|
1777 | + $sql = 'DELETE FROM '.$class->table->getQuotedQualifiedName($this->platform); |
|
1778 | 1778 | |
1779 | 1779 | $this->setSQLTableAlias($tableName, $tableName, $deleteClause->aliasIdentificationVariable); |
1780 | 1780 | |
@@ -1790,12 +1790,12 @@ discard block |
||
1790 | 1790 | { |
1791 | 1791 | $class = $this->em->getClassMetadata($updateClause->abstractSchemaName); |
1792 | 1792 | $tableName = $class->getTableName(); |
1793 | - $sql = 'UPDATE ' . $class->table->getQuotedQualifiedName($this->platform); |
|
1793 | + $sql = 'UPDATE '.$class->table->getQuotedQualifiedName($this->platform); |
|
1794 | 1794 | |
1795 | 1795 | $this->setSQLTableAlias($tableName, $tableName, $updateClause->aliasIdentificationVariable); |
1796 | 1796 | $this->rootAliases[] = $updateClause->aliasIdentificationVariable; |
1797 | 1797 | |
1798 | - return $sql . ' SET ' . implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
1798 | + return $sql.' SET '.implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
1799 | 1799 | } |
1800 | 1800 | |
1801 | 1801 | /** |
@@ -1806,7 +1806,7 @@ discard block |
||
1806 | 1806 | $useTableAliasesBefore = $this->useSqlTableAliases; |
1807 | 1807 | $this->useSqlTableAliases = false; |
1808 | 1808 | |
1809 | - $sql = $this->walkPathExpression($updateItem->pathExpression) . ' = '; |
|
1809 | + $sql = $this->walkPathExpression($updateItem->pathExpression).' = '; |
|
1810 | 1810 | $newValue = $updateItem->newValue; |
1811 | 1811 | |
1812 | 1812 | switch (true) { |
@@ -1850,7 +1850,7 @@ discard block |
||
1850 | 1850 | |
1851 | 1851 | if ($filterClauses) { |
1852 | 1852 | if ($condSql) { |
1853 | - $condSql = '(' . $condSql . ') AND '; |
|
1853 | + $condSql = '('.$condSql.') AND '; |
|
1854 | 1854 | } |
1855 | 1855 | |
1856 | 1856 | $condSql .= implode(' AND ', $filterClauses); |
@@ -1858,11 +1858,11 @@ discard block |
||
1858 | 1858 | } |
1859 | 1859 | |
1860 | 1860 | if ($condSql) { |
1861 | - return ' WHERE ' . (! $discrSql ? $condSql : '(' . $condSql . ') AND ' . $discrSql); |
|
1861 | + return ' WHERE '.( ! $discrSql ? $condSql : '('.$condSql.') AND '.$discrSql); |
|
1862 | 1862 | } |
1863 | 1863 | |
1864 | 1864 | if ($discrSql) { |
1865 | - return ' WHERE ' . $discrSql; |
|
1865 | + return ' WHERE '.$discrSql; |
|
1866 | 1866 | } |
1867 | 1867 | |
1868 | 1868 | return ''; |
@@ -1875,7 +1875,7 @@ discard block |
||
1875 | 1875 | { |
1876 | 1876 | // Phase 2 AST optimization: Skip processing of ConditionalExpression |
1877 | 1877 | // if only one ConditionalTerm is defined |
1878 | - if (! ($condExpr instanceof AST\ConditionalExpression)) { |
|
1878 | + if ( ! ($condExpr instanceof AST\ConditionalExpression)) { |
|
1879 | 1879 | return $this->walkConditionalTerm($condExpr); |
1880 | 1880 | } |
1881 | 1881 | |
@@ -1889,7 +1889,7 @@ discard block |
||
1889 | 1889 | { |
1890 | 1890 | // Phase 2 AST optimization: Skip processing of ConditionalTerm |
1891 | 1891 | // if only one ConditionalFactor is defined |
1892 | - if (! ($condTerm instanceof AST\ConditionalTerm)) { |
|
1892 | + if ( ! ($condTerm instanceof AST\ConditionalTerm)) { |
|
1893 | 1893 | return $this->walkConditionalFactor($condTerm); |
1894 | 1894 | } |
1895 | 1895 | |
@@ -1905,7 +1905,7 @@ discard block |
||
1905 | 1905 | // if only one ConditionalPrimary is defined |
1906 | 1906 | return ! ($factor instanceof AST\ConditionalFactor) |
1907 | 1907 | ? $this->walkConditionalPrimary($factor) |
1908 | - : ($factor->not ? 'NOT ' : '') . $this->walkConditionalPrimary($factor->conditionalPrimary); |
|
1908 | + : ($factor->not ? 'NOT ' : '').$this->walkConditionalPrimary($factor->conditionalPrimary); |
|
1909 | 1909 | } |
1910 | 1910 | |
1911 | 1911 | /** |
@@ -1920,7 +1920,7 @@ discard block |
||
1920 | 1920 | if ($primary->isConditionalExpression()) { |
1921 | 1921 | $condExpr = $primary->conditionalExpression; |
1922 | 1922 | |
1923 | - return '(' . $this->walkConditionalExpression($condExpr) . ')'; |
|
1923 | + return '('.$this->walkConditionalExpression($condExpr).')'; |
|
1924 | 1924 | } |
1925 | 1925 | } |
1926 | 1926 | |
@@ -1931,7 +1931,7 @@ discard block |
||
1931 | 1931 | { |
1932 | 1932 | $sql = $existsExpr->not ? 'NOT ' : ''; |
1933 | 1933 | |
1934 | - $sql .= 'EXISTS (' . $this->walkSubselect($existsExpr->subselect) . ')'; |
|
1934 | + $sql .= 'EXISTS ('.$this->walkSubselect($existsExpr->subselect).')'; |
|
1935 | 1935 | |
1936 | 1936 | return $sql; |
1937 | 1937 | } |
@@ -1979,7 +1979,7 @@ discard block |
||
1979 | 1979 | $targetTableAlias = $this->getSQLTableAlias($targetClass->getTableName()); |
1980 | 1980 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
1981 | 1981 | |
1982 | - $sql .= $targetTableName . ' ' . $targetTableAlias . ' WHERE '; |
|
1982 | + $sql .= $targetTableName.' '.$targetTableAlias.' WHERE '; |
|
1983 | 1983 | |
1984 | 1984 | $sqlParts = []; |
1985 | 1985 | |
@@ -2000,7 +2000,7 @@ discard block |
||
2000 | 2000 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
2001 | 2001 | } |
2002 | 2002 | |
2003 | - $sqlParts[] = $targetTableAlias . '.' . $quotedTargetColumnName . ' = ' . $entitySql; |
|
2003 | + $sqlParts[] = $targetTableAlias.'.'.$quotedTargetColumnName.' = '.$entitySql; |
|
2004 | 2004 | } |
2005 | 2005 | |
2006 | 2006 | $sql .= implode(' AND ', $sqlParts); |
@@ -2014,7 +2014,7 @@ discard block |
||
2014 | 2014 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
2015 | 2015 | |
2016 | 2016 | // join to target table |
2017 | - $sql .= $joinTableName . ' ' . $joinTableAlias . ' INNER JOIN ' . $targetTableName . ' ' . $targetTableAlias . ' ON '; |
|
2017 | + $sql .= $joinTableName.' '.$joinTableAlias.' INNER JOIN '.$targetTableName.' '.$targetTableAlias.' ON '; |
|
2018 | 2018 | |
2019 | 2019 | // join conditions |
2020 | 2020 | $joinSqlParts = []; |
@@ -2063,13 +2063,13 @@ discard block |
||
2063 | 2063 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
2064 | 2064 | } |
2065 | 2065 | |
2066 | - $sqlParts[] = $targetTableAlias . '.' . $quotedTargetColumnName . ' = ' . $entitySql; |
|
2066 | + $sqlParts[] = $targetTableAlias.'.'.$quotedTargetColumnName.' = '.$entitySql; |
|
2067 | 2067 | } |
2068 | 2068 | |
2069 | 2069 | $sql .= implode(' AND ', $sqlParts); |
2070 | 2070 | } |
2071 | 2071 | |
2072 | - return $sql . ')'; |
|
2072 | + return $sql.')'; |
|
2073 | 2073 | } |
2074 | 2074 | |
2075 | 2075 | /** |
@@ -2080,7 +2080,7 @@ discard block |
||
2080 | 2080 | $sizeFunc = new AST\Functions\SizeFunction('size'); |
2081 | 2081 | $sizeFunc->collectionPathExpression = $emptyCollCompExpr->expression; |
2082 | 2082 | |
2083 | - return $sizeFunc->getSql($this) . ($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
2083 | + return $sizeFunc->getSql($this).($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
2084 | 2084 | } |
2085 | 2085 | |
2086 | 2086 | /** |
@@ -2089,19 +2089,19 @@ discard block |
||
2089 | 2089 | public function walkNullComparisonExpression($nullCompExpr) |
2090 | 2090 | { |
2091 | 2091 | $expression = $nullCompExpr->expression; |
2092 | - $comparison = ' IS' . ($nullCompExpr->not ? ' NOT' : '') . ' NULL'; |
|
2092 | + $comparison = ' IS'.($nullCompExpr->not ? ' NOT' : '').' NULL'; |
|
2093 | 2093 | |
2094 | 2094 | // Handle ResultVariable |
2095 | 2095 | if (is_string($expression) && isset($this->queryComponents[$expression]['resultVariable'])) { |
2096 | - return $this->walkResultVariable($expression) . $comparison; |
|
2096 | + return $this->walkResultVariable($expression).$comparison; |
|
2097 | 2097 | } |
2098 | 2098 | |
2099 | 2099 | // Handle InputParameter mapping inclusion to ParserResult |
2100 | 2100 | if ($expression instanceof AST\InputParameter) { |
2101 | - return $this->walkInputParameter($expression) . $comparison; |
|
2101 | + return $this->walkInputParameter($expression).$comparison; |
|
2102 | 2102 | } |
2103 | 2103 | |
2104 | - return $expression->dispatch($this) . $comparison; |
|
2104 | + return $expression->dispatch($this).$comparison; |
|
2105 | 2105 | } |
2106 | 2106 | |
2107 | 2107 | /** |
@@ -2109,7 +2109,7 @@ discard block |
||
2109 | 2109 | */ |
2110 | 2110 | public function walkInExpression($inExpr) |
2111 | 2111 | { |
2112 | - $sql = $this->walkArithmeticExpression($inExpr->expression) . ($inExpr->not ? ' NOT' : '') . ' IN ('; |
|
2112 | + $sql = $this->walkArithmeticExpression($inExpr->expression).($inExpr->not ? ' NOT' : '').' IN ('; |
|
2113 | 2113 | |
2114 | 2114 | $sql .= $inExpr->subselect |
2115 | 2115 | ? $this->walkSubselect($inExpr->subselect) |
@@ -2134,12 +2134,12 @@ discard block |
||
2134 | 2134 | $discrColumnType = $discrColumn->getType(); |
2135 | 2135 | $quotedColumnName = $this->platform->quoteIdentifier($discrColumn->getColumnName()); |
2136 | 2136 | $sqlTableAlias = $this->useSqlTableAliases |
2137 | - ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias) . '.' |
|
2137 | + ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias).'.' |
|
2138 | 2138 | : ''; |
2139 | 2139 | |
2140 | 2140 | return sprintf( |
2141 | 2141 | '%s %sIN %s', |
2142 | - $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . $quotedColumnName, $this->platform), |
|
2142 | + $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.$quotedColumnName, $this->platform), |
|
2143 | 2143 | ($instanceOfExpr->not ? 'NOT ' : ''), |
2144 | 2144 | $this->getChildDiscriminatorsFromClassMetadata($discrClass, $instanceOfExpr) |
2145 | 2145 | ); |
@@ -2186,8 +2186,8 @@ discard block |
||
2186 | 2186 | $sql .= ' NOT'; |
2187 | 2187 | } |
2188 | 2188 | |
2189 | - $sql .= ' BETWEEN ' . $this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
2190 | - . ' AND ' . $this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
2189 | + $sql .= ' BETWEEN '.$this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
2190 | + . ' AND '.$this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
2191 | 2191 | |
2192 | 2192 | return $sql; |
2193 | 2193 | } |
@@ -2202,7 +2202,7 @@ discard block |
||
2202 | 2202 | ? $this->walkResultVariable($stringExpr) |
2203 | 2203 | : $stringExpr->dispatch($this); |
2204 | 2204 | |
2205 | - $sql = $leftExpr . ($likeExpr->not ? ' NOT' : '') . ' LIKE '; |
|
2205 | + $sql = $leftExpr.($likeExpr->not ? ' NOT' : '').' LIKE '; |
|
2206 | 2206 | |
2207 | 2207 | if ($likeExpr->stringPattern instanceof AST\InputParameter) { |
2208 | 2208 | $sql .= $this->walkInputParameter($likeExpr->stringPattern); |
@@ -2215,7 +2215,7 @@ discard block |
||
2215 | 2215 | } |
2216 | 2216 | |
2217 | 2217 | if ($likeExpr->escapeChar) { |
2218 | - $sql .= ' ESCAPE ' . $this->walkLiteral($likeExpr->escapeChar); |
|
2218 | + $sql .= ' ESCAPE '.$this->walkLiteral($likeExpr->escapeChar); |
|
2219 | 2219 | } |
2220 | 2220 | |
2221 | 2221 | return $sql; |
@@ -2242,7 +2242,7 @@ discard block |
||
2242 | 2242 | ? $leftExpr->dispatch($this) |
2243 | 2243 | : (is_numeric($leftExpr) ? $leftExpr : $this->conn->quote($leftExpr)); |
2244 | 2244 | |
2245 | - $sql .= ' ' . $compExpr->operator . ' '; |
|
2245 | + $sql .= ' '.$compExpr->operator.' '; |
|
2246 | 2246 | |
2247 | 2247 | $sql .= $rightExpr instanceof AST\Node |
2248 | 2248 | ? $rightExpr->dispatch($this) |
@@ -2278,7 +2278,7 @@ discard block |
||
2278 | 2278 | { |
2279 | 2279 | return $arithmeticExpr->isSimpleArithmeticExpression() |
2280 | 2280 | ? $this->walkSimpleArithmeticExpression($arithmeticExpr->simpleArithmeticExpression) |
2281 | - : '(' . $this->walkSubselect($arithmeticExpr->subselect) . ')'; |
|
2281 | + : '('.$this->walkSubselect($arithmeticExpr->subselect).')'; |
|
2282 | 2282 | } |
2283 | 2283 | |
2284 | 2284 | /** |
@@ -2286,7 +2286,7 @@ discard block |
||
2286 | 2286 | */ |
2287 | 2287 | public function walkSimpleArithmeticExpression($simpleArithmeticExpr) |
2288 | 2288 | { |
2289 | - if (! ($simpleArithmeticExpr instanceof AST\SimpleArithmeticExpression)) { |
|
2289 | + if ( ! ($simpleArithmeticExpr instanceof AST\SimpleArithmeticExpression)) { |
|
2290 | 2290 | return $this->walkArithmeticTerm($simpleArithmeticExpr); |
2291 | 2291 | } |
2292 | 2292 | |
@@ -2306,7 +2306,7 @@ discard block |
||
2306 | 2306 | |
2307 | 2307 | // Phase 2 AST optimization: Skip processing of ArithmeticTerm |
2308 | 2308 | // if only one ArithmeticFactor is defined |
2309 | - if (! ($term instanceof AST\ArithmeticTerm)) { |
|
2309 | + if ( ! ($term instanceof AST\ArithmeticTerm)) { |
|
2310 | 2310 | return $this->walkArithmeticFactor($term); |
2311 | 2311 | } |
2312 | 2312 | |
@@ -2326,13 +2326,13 @@ discard block |
||
2326 | 2326 | |
2327 | 2327 | // Phase 2 AST optimization: Skip processing of ArithmeticFactor |
2328 | 2328 | // if only one ArithmeticPrimary is defined |
2329 | - if (! ($factor instanceof AST\ArithmeticFactor)) { |
|
2329 | + if ( ! ($factor instanceof AST\ArithmeticFactor)) { |
|
2330 | 2330 | return $this->walkArithmeticPrimary($factor); |
2331 | 2331 | } |
2332 | 2332 | |
2333 | 2333 | $sign = $factor->isNegativeSigned() ? '-' : ($factor->isPositiveSigned() ? '+' : ''); |
2334 | 2334 | |
2335 | - return $sign . $this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
2335 | + return $sign.$this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
2336 | 2336 | } |
2337 | 2337 | |
2338 | 2338 | /** |
@@ -2345,7 +2345,7 @@ discard block |
||
2345 | 2345 | public function walkArithmeticPrimary($primary) |
2346 | 2346 | { |
2347 | 2347 | if ($primary instanceof AST\SimpleArithmeticExpression) { |
2348 | - return '(' . $this->walkSimpleArithmeticExpression($primary) . ')'; |
|
2348 | + return '('.$this->walkSimpleArithmeticExpression($primary).')'; |
|
2349 | 2349 | } |
2350 | 2350 | |
2351 | 2351 | if ($primary instanceof AST\Node) { |
@@ -2403,7 +2403,7 @@ discard block |
||
2403 | 2403 | $entityClassName = $entityClass->getClassName(); |
2404 | 2404 | |
2405 | 2405 | if ($entityClassName !== $rootClass->getClassName()) { |
2406 | - if (! $entityClass->getReflectionClass()->isSubclassOf($rootClass->getClassName())) { |
|
2406 | + if ( ! $entityClass->getReflectionClass()->isSubclassOf($rootClass->getClassName())) { |
|
2407 | 2407 | throw QueryException::instanceOfUnrelatedClass($entityClassName, $rootClass->getClassName()); |
2408 | 2408 | } |
2409 | 2409 | } |
@@ -2415,6 +2415,6 @@ discard block |
||
2415 | 2415 | $sqlParameterList[] = $this->conn->quote($discriminator); |
2416 | 2416 | } |
2417 | 2417 | |
2418 | - return '(' . implode(', ', $sqlParameterList) . ')'; |
|
2418 | + return '('.implode(', ', $sqlParameterList).')'; |
|
2419 | 2419 | } |
2420 | 2420 | } |
@@ -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 |
@@ -305,8 +305,8 @@ discard block |
||
305 | 305 | |
306 | 306 | // FIXME: Order with composite keys might not be correct |
307 | 307 | $sql = 'SELECT ' . $columnName |
308 | - . ' FROM ' . $tableName |
|
309 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
308 | + . ' FROM ' . $tableName |
|
309 | + . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
310 | 310 | |
311 | 311 | $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id); |
312 | 312 | $versionType = $versionProperty->getType(); |
@@ -519,8 +519,8 @@ discard block |
||
519 | 519 | } |
520 | 520 | |
521 | 521 | $sql = 'UPDATE ' . $quotedTableName |
522 | - . ' SET ' . implode(', ', $set) |
|
523 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
522 | + . ' SET ' . implode(', ', $set) |
|
523 | + . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
524 | 524 | |
525 | 525 | $result = $this->conn->executeUpdate($sql, $params, $types); |
526 | 526 | |
@@ -1641,9 +1641,9 @@ discard block |
||
1641 | 1641 | $lock = $this->getLockTablesSql($lockMode); |
1642 | 1642 | $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
1643 | 1643 | $sql = 'SELECT 1 ' |
1644 | - . $lock |
|
1645 | - . $where |
|
1646 | - . $lockSql; |
|
1644 | + . $lock |
|
1645 | + . $where |
|
1646 | + . $lockSql; |
|
1647 | 1647 | |
1648 | 1648 | [$params, $types] = $this->expandParameters($criteria); |
1649 | 1649 | |
@@ -2112,8 +2112,8 @@ discard block |
||
2112 | 2112 | $alias = $this->getSQLTableAlias($this->class->getTableName()); |
2113 | 2113 | |
2114 | 2114 | $sql = 'SELECT 1 ' |
2115 | - . $this->getLockTablesSql(null) |
|
2116 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
2115 | + . $this->getLockTablesSql(null) |
|
2116 | + . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
2117 | 2117 | |
2118 | 2118 | [$params, $types] = $this->expandParameters($criteria); |
2119 | 2119 |
@@ -297,16 +297,16 @@ discard block |
||
297 | 297 | $tableName = $versionedClass->table->getQuotedQualifiedName($this->platform); |
298 | 298 | $columnName = $this->platform->quoteIdentifier($versionProperty->getColumnName()); |
299 | 299 | $identifier = array_map( |
300 | - function ($columnName) { |
|
300 | + function($columnName) { |
|
301 | 301 | return $this->platform->quoteIdentifier($columnName); |
302 | 302 | }, |
303 | 303 | array_keys($versionedClass->getIdentifierColumns($this->em)) |
304 | 304 | ); |
305 | 305 | |
306 | 306 | // FIXME: Order with composite keys might not be correct |
307 | - $sql = 'SELECT ' . $columnName |
|
308 | - . ' FROM ' . $tableName |
|
309 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
307 | + $sql = 'SELECT '.$columnName |
|
308 | + . ' FROM '.$tableName |
|
309 | + . ' WHERE '.implode(' = ? AND ', $identifier).' = ?'; |
|
310 | 310 | |
311 | 311 | $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id); |
312 | 312 | $versionType = $versionProperty->getType(); |
@@ -345,13 +345,13 @@ discard block |
||
345 | 345 | $tableName = $this->class->getTableName(); |
346 | 346 | $updateData = $this->prepareUpdateData($entity); |
347 | 347 | |
348 | - if (! isset($updateData[$tableName])) { |
|
348 | + if ( ! isset($updateData[$tableName])) { |
|
349 | 349 | return; |
350 | 350 | } |
351 | 351 | |
352 | 352 | $data = $updateData[$tableName]; |
353 | 353 | |
354 | - if (! $data) { |
|
354 | + if ( ! $data) { |
|
355 | 355 | return; |
356 | 356 | } |
357 | 357 | |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | |
404 | 404 | if ($value !== null) { |
405 | 405 | // @todo guilhermeblanco Make sure we do not have flat association values. |
406 | - if (! is_array($value)) { |
|
406 | + if ( ! is_array($value)) { |
|
407 | 407 | $value = [$targetClass->identifier[0] => $value]; |
408 | 408 | } |
409 | 409 | |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
417 | 417 | $targetField = $targetClass->fieldNames[$referencedColumnName]; |
418 | 418 | |
419 | - if (! $joinColumn->getType()) { |
|
419 | + if ( ! $joinColumn->getType()) { |
|
420 | 420 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
421 | 421 | } |
422 | 422 | |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
483 | 483 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
484 | 484 | |
485 | - if (! $joinColumn->getType()) { |
|
485 | + if ( ! $joinColumn->getType()) { |
|
486 | 486 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
487 | 487 | } |
488 | 488 | |
@@ -509,18 +509,18 @@ discard block |
||
509 | 509 | case Type::SMALLINT: |
510 | 510 | case Type::INTEGER: |
511 | 511 | case Type::BIGINT: |
512 | - $set[] = $versionColumnName . ' = ' . $versionColumnName . ' + 1'; |
|
512 | + $set[] = $versionColumnName.' = '.$versionColumnName.' + 1'; |
|
513 | 513 | break; |
514 | 514 | |
515 | 515 | case Type::DATETIME: |
516 | - $set[] = $versionColumnName . ' = CURRENT_TIMESTAMP'; |
|
516 | + $set[] = $versionColumnName.' = CURRENT_TIMESTAMP'; |
|
517 | 517 | break; |
518 | 518 | } |
519 | 519 | } |
520 | 520 | |
521 | - $sql = 'UPDATE ' . $quotedTableName |
|
522 | - . ' SET ' . implode(', ', $set) |
|
523 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
521 | + $sql = 'UPDATE '.$quotedTableName |
|
522 | + . ' SET '.implode(', ', $set) |
|
523 | + . ' WHERE '.implode(' = ? AND ', $where).' = ?'; |
|
524 | 524 | |
525 | 525 | $result = $this->conn->executeUpdate($sql, $params, $types); |
526 | 526 | |
@@ -537,7 +537,7 @@ discard block |
||
537 | 537 | protected function deleteJoinTableRecords($identifier) |
538 | 538 | { |
539 | 539 | foreach ($this->class->getDeclaredPropertiesIterator() as $association) { |
540 | - if (! ($association instanceof ManyToManyAssociationMetadata)) { |
|
540 | + if ( ! ($association instanceof ManyToManyAssociationMetadata)) { |
|
541 | 541 | continue; |
542 | 542 | } |
543 | 543 | |
@@ -549,7 +549,7 @@ discard block |
||
549 | 549 | $otherKeys = []; |
550 | 550 | $keys = []; |
551 | 551 | |
552 | - if (! $owningAssociation->isOwningSide()) { |
|
552 | + if ( ! $owningAssociation->isOwningSide()) { |
|
553 | 553 | $class = $this->em->getClassMetadata($association->getTargetEntity()); |
554 | 554 | $owningAssociation = $class->getProperty($association->getMappedBy()); |
555 | 555 | } |
@@ -659,7 +659,7 @@ discard block |
||
659 | 659 | } |
660 | 660 | |
661 | 661 | // Only owning side of x-1 associations can have a FK column. |
662 | - if (! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
662 | + if ( ! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
663 | 663 | continue; |
664 | 664 | } |
665 | 665 | |
@@ -679,7 +679,7 @@ discard block |
||
679 | 679 | /** @var JoinColumnMetadata $joinColumn */ |
680 | 680 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
681 | 681 | |
682 | - if (! $joinColumn->getType()) { |
|
682 | + if ( ! $joinColumn->getType()) { |
|
683 | 683 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
684 | 684 | } |
685 | 685 | |
@@ -706,7 +706,7 @@ discard block |
||
706 | 706 | $propertyName = $this->class->fieldNames[$columnName]; |
707 | 707 | $property = $this->class->getProperty($propertyName); |
708 | 708 | |
709 | - if (! $property) { |
|
709 | + if ( ! $property) { |
|
710 | 710 | return null; |
711 | 711 | } |
712 | 712 | |
@@ -725,7 +725,7 @@ discard block |
||
725 | 725 | /** @var JoinColumnMetadata $joinColumn */ |
726 | 726 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
727 | 727 | |
728 | - if (! $joinColumn->getType()) { |
|
728 | + if ( ! $joinColumn->getType()) { |
|
729 | 729 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
730 | 730 | } |
731 | 731 | |
@@ -830,7 +830,7 @@ discard block |
||
830 | 830 | $sourceKeyColumn = $joinColumn->getReferencedColumnName(); |
831 | 831 | $targetKeyColumn = $joinColumn->getColumnName(); |
832 | 832 | |
833 | - if (! isset($sourceClass->fieldNames[$sourceKeyColumn])) { |
|
833 | + if ( ! isset($sourceClass->fieldNames[$sourceKeyColumn])) { |
|
834 | 834 | throw MappingException::joinColumnMustPointToMappedField( |
835 | 835 | $sourceClass->getClassName(), |
836 | 836 | $sourceKeyColumn |
@@ -1057,7 +1057,7 @@ discard block |
||
1057 | 1057 | $criteria = []; |
1058 | 1058 | $parameters = []; |
1059 | 1059 | |
1060 | - if (! $association->isOwningSide()) { |
|
1060 | + if ( ! $association->isOwningSide()) { |
|
1061 | 1061 | $class = $this->em->getClassMetadata($association->getTargetEntity()); |
1062 | 1062 | $owningAssoc = $class->getProperty($association->getMappedBy()); |
1063 | 1063 | } |
@@ -1085,7 +1085,7 @@ discard block |
||
1085 | 1085 | $value = $value[$targetClass->identifier[0]]; |
1086 | 1086 | } |
1087 | 1087 | |
1088 | - $criteria[$joinTableName . '.' . $quotedColumnName] = $value; |
|
1088 | + $criteria[$joinTableName.'.'.$quotedColumnName] = $value; |
|
1089 | 1089 | $parameters[] = [ |
1090 | 1090 | 'value' => $value, |
1091 | 1091 | 'field' => $fieldName, |
@@ -1135,11 +1135,11 @@ discard block |
||
1135 | 1135 | |
1136 | 1136 | switch ($lockMode) { |
1137 | 1137 | case LockMode::PESSIMISTIC_READ: |
1138 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
1138 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
1139 | 1139 | break; |
1140 | 1140 | |
1141 | 1141 | case LockMode::PESSIMISTIC_WRITE: |
1142 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
1142 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
1143 | 1143 | break; |
1144 | 1144 | } |
1145 | 1145 | |
@@ -1150,14 +1150,14 @@ discard block |
||
1150 | 1150 | |
1151 | 1151 | if ($filterSql !== '') { |
1152 | 1152 | $conditionSql = $conditionSql |
1153 | - ? $conditionSql . ' AND ' . $filterSql |
|
1153 | + ? $conditionSql.' AND '.$filterSql |
|
1154 | 1154 | : $filterSql; |
1155 | 1155 | } |
1156 | 1156 | |
1157 | - $select = 'SELECT ' . $columnList; |
|
1158 | - $from = ' FROM ' . $tableName . ' ' . $tableAlias; |
|
1159 | - $join = $this->currentPersisterContext->selectJoinSql . $joinSql; |
|
1160 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : ''); |
|
1157 | + $select = 'SELECT '.$columnList; |
|
1158 | + $from = ' FROM '.$tableName.' '.$tableAlias; |
|
1159 | + $join = $this->currentPersisterContext->selectJoinSql.$joinSql; |
|
1160 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : ''); |
|
1161 | 1161 | $lock = $this->platform->appendLockHint($from, $lockMode); |
1162 | 1162 | $query = $select |
1163 | 1163 | . $lock |
@@ -1165,7 +1165,7 @@ discard block |
||
1165 | 1165 | . $where |
1166 | 1166 | . $orderBySql; |
1167 | 1167 | |
1168 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
1168 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
1169 | 1169 | } |
1170 | 1170 | |
1171 | 1171 | /** |
@@ -1184,13 +1184,13 @@ discard block |
||
1184 | 1184 | |
1185 | 1185 | if ($filterSql !== '') { |
1186 | 1186 | $conditionSql = $conditionSql |
1187 | - ? $conditionSql . ' AND ' . $filterSql |
|
1187 | + ? $conditionSql.' AND '.$filterSql |
|
1188 | 1188 | : $filterSql; |
1189 | 1189 | } |
1190 | 1190 | |
1191 | 1191 | $sql = 'SELECT COUNT(*) ' |
1192 | - . 'FROM ' . $tableName . ' ' . $tableAlias |
|
1193 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
1192 | + . 'FROM '.$tableName.' '.$tableAlias |
|
1193 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
1194 | 1194 | |
1195 | 1195 | return $sql; |
1196 | 1196 | } |
@@ -1207,7 +1207,7 @@ discard block |
||
1207 | 1207 | */ |
1208 | 1208 | final protected function getOrderBySQL(array $orderBy, $baseTableAlias) |
1209 | 1209 | { |
1210 | - if (! $orderBy) { |
|
1210 | + if ( ! $orderBy) { |
|
1211 | 1211 | return ''; |
1212 | 1212 | } |
1213 | 1213 | |
@@ -1216,7 +1216,7 @@ discard block |
||
1216 | 1216 | foreach ($orderBy as $fieldName => $orientation) { |
1217 | 1217 | $orientation = strtoupper(trim($orientation)); |
1218 | 1218 | |
1219 | - if (! in_array($orientation, ['ASC', 'DESC'], true)) { |
|
1219 | + if ( ! in_array($orientation, ['ASC', 'DESC'], true)) { |
|
1220 | 1220 | throw InvalidOrientation::fromClassNameAndField($this->class->getClassName(), $fieldName); |
1221 | 1221 | } |
1222 | 1222 | |
@@ -1226,11 +1226,11 @@ discard block |
||
1226 | 1226 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
1227 | 1227 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
1228 | 1228 | |
1229 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
1229 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
1230 | 1230 | |
1231 | 1231 | continue; |
1232 | 1232 | } elseif ($property instanceof AssociationMetadata) { |
1233 | - if (! $property->isOwningSide()) { |
|
1233 | + if ( ! $property->isOwningSide()) { |
|
1234 | 1234 | throw InvalidFindByCall::fromInverseSideUsage( |
1235 | 1235 | $this->class->getClassName(), |
1236 | 1236 | $fieldName |
@@ -1246,7 +1246,7 @@ discard block |
||
1246 | 1246 | /** @var JoinColumnMetadata $joinColumn */ |
1247 | 1247 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1248 | 1248 | |
1249 | - $orderByList[] = $tableAlias . '.' . $quotedColumnName . ' ' . $orientation; |
|
1249 | + $orderByList[] = $tableAlias.'.'.$quotedColumnName.' '.$orientation; |
|
1250 | 1250 | } |
1251 | 1251 | |
1252 | 1252 | continue; |
@@ -1255,7 +1255,7 @@ discard block |
||
1255 | 1255 | throw UnrecognizedField::byName($fieldName); |
1256 | 1256 | } |
1257 | 1257 | |
1258 | - return ' ORDER BY ' . implode(', ', $orderByList); |
|
1258 | + return ' ORDER BY '.implode(', ', $orderByList); |
|
1259 | 1259 | } |
1260 | 1260 | |
1261 | 1261 | /** |
@@ -1297,7 +1297,7 @@ discard block |
||
1297 | 1297 | $isAssocToOneInverseSide = $property instanceof ToOneAssociationMetadata && ! $property->isOwningSide(); |
1298 | 1298 | $isAssocFromOneEager = ! $property instanceof ManyToManyAssociationMetadata && $property->getFetchMode() === FetchMode::EAGER; |
1299 | 1299 | |
1300 | - if (! ($isAssocFromOneEager || $isAssocToOneInverseSide)) { |
|
1300 | + if ( ! ($isAssocFromOneEager || $isAssocToOneInverseSide)) { |
|
1301 | 1301 | break; |
1302 | 1302 | } |
1303 | 1303 | |
@@ -1312,7 +1312,7 @@ discard block |
||
1312 | 1312 | break; // now this is why you shouldn't use inheritance |
1313 | 1313 | } |
1314 | 1314 | |
1315 | - $assocAlias = 'e' . ($eagerAliasCounter++); |
|
1315 | + $assocAlias = 'e'.($eagerAliasCounter++); |
|
1316 | 1316 | |
1317 | 1317 | $this->currentPersisterContext->rsm->addJoinedEntityResult($targetEntity, $assocAlias, 'r', $fieldName); |
1318 | 1318 | |
@@ -1340,14 +1340,14 @@ discard block |
||
1340 | 1340 | $this->currentPersisterContext->rsm->addIndexBy($assocAlias, $property->getIndexedBy()); |
1341 | 1341 | } |
1342 | 1342 | |
1343 | - if (! $property->isOwningSide()) { |
|
1343 | + if ( ! $property->isOwningSide()) { |
|
1344 | 1344 | $owningAssociation = $eagerEntity->getProperty($property->getMappedBy()); |
1345 | 1345 | } |
1346 | 1346 | |
1347 | 1347 | $joinTableAlias = $this->getSQLTableAlias($eagerEntity->getTableName(), $assocAlias); |
1348 | 1348 | $joinTableName = $eagerEntity->table->getQuotedQualifiedName($this->platform); |
1349 | 1349 | |
1350 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $this->getJoinSQLForAssociation($property); |
|
1350 | + $this->currentPersisterContext->selectJoinSql .= ' '.$this->getJoinSQLForAssociation($property); |
|
1351 | 1351 | |
1352 | 1352 | $sourceClass = $this->em->getClassMetadata($owningAssociation->getSourceEntity()); |
1353 | 1353 | $targetClass = $this->em->getClassMetadata($owningAssociation->getTargetEntity()); |
@@ -1371,7 +1371,7 @@ discard block |
||
1371 | 1371 | $joinCondition[] = $filterSql; |
1372 | 1372 | } |
1373 | 1373 | |
1374 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $joinTableName . ' ' . $joinTableAlias . ' ON '; |
|
1374 | + $this->currentPersisterContext->selectJoinSql .= ' '.$joinTableName.' '.$joinTableAlias.' ON '; |
|
1375 | 1375 | $this->currentPersisterContext->selectJoinSql .= implode(' AND ', $joinCondition); |
1376 | 1376 | |
1377 | 1377 | break; |
@@ -1393,7 +1393,7 @@ discard block |
||
1393 | 1393 | */ |
1394 | 1394 | protected function getSelectColumnAssociationSQL($field, AssociationMetadata $association, ClassMetadata $class, $alias = 'r') |
1395 | 1395 | { |
1396 | - if (! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
1396 | + if ( ! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
1397 | 1397 | return ''; |
1398 | 1398 | } |
1399 | 1399 | |
@@ -1408,7 +1408,7 @@ discard block |
||
1408 | 1408 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
1409 | 1409 | $resultColumnName = $this->getSQLColumnAlias(); |
1410 | 1410 | |
1411 | - if (! $joinColumn->getType()) { |
|
1411 | + if ( ! $joinColumn->getType()) { |
|
1412 | 1412 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
1413 | 1413 | } |
1414 | 1414 | |
@@ -1438,7 +1438,7 @@ discard block |
||
1438 | 1438 | $owningAssociation = $association; |
1439 | 1439 | $sourceTableAlias = $this->getSQLTableAlias($this->class->getTableName()); |
1440 | 1440 | |
1441 | - if (! $association->isOwningSide()) { |
|
1441 | + if ( ! $association->isOwningSide()) { |
|
1442 | 1442 | $targetEntity = $this->em->getClassMetadata($association->getTargetEntity()); |
1443 | 1443 | $owningAssociation = $targetEntity->getProperty($association->getMappedBy()); |
1444 | 1444 | } |
@@ -1459,7 +1459,7 @@ discard block |
||
1459 | 1459 | ); |
1460 | 1460 | } |
1461 | 1461 | |
1462 | - return ' INNER JOIN ' . $joinTableName . ' ON ' . implode(' AND ', $conditions); |
|
1462 | + return ' INNER JOIN '.$joinTableName.' ON '.implode(' AND ', $conditions); |
|
1463 | 1463 | } |
1464 | 1464 | |
1465 | 1465 | /** |
@@ -1553,7 +1553,7 @@ discard block |
||
1553 | 1553 | $columnName = $joinColumn->getColumnName(); |
1554 | 1554 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
1555 | 1555 | |
1556 | - if (! $joinColumn->getType()) { |
|
1556 | + if ( ! $joinColumn->getType()) { |
|
1557 | 1557 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
1558 | 1558 | } |
1559 | 1559 | |
@@ -1592,7 +1592,7 @@ discard block |
||
1592 | 1592 | |
1593 | 1593 | $this->currentPersisterContext->rsm->addFieldResult($alias, $columnAlias, $field, $class->getClassName()); |
1594 | 1594 | |
1595 | - return $property->getType()->convertToPHPValueSQL($sql, $this->platform) . ' AS ' . $columnAlias; |
|
1595 | + return $property->getType()->convertToPHPValueSQL($sql, $this->platform).' AS '.$columnAlias; |
|
1596 | 1596 | } |
1597 | 1597 | |
1598 | 1598 | /** |
@@ -1606,14 +1606,14 @@ discard block |
||
1606 | 1606 | protected function getSQLTableAlias($tableName, $assocName = '') |
1607 | 1607 | { |
1608 | 1608 | if ($tableName) { |
1609 | - $tableName .= '#' . $assocName; |
|
1609 | + $tableName .= '#'.$assocName; |
|
1610 | 1610 | } |
1611 | 1611 | |
1612 | 1612 | if (isset($this->currentPersisterContext->sqlTableAliases[$tableName])) { |
1613 | 1613 | return $this->currentPersisterContext->sqlTableAliases[$tableName]; |
1614 | 1614 | } |
1615 | 1615 | |
1616 | - $tableAlias = 't' . $this->currentPersisterContext->sqlAliasCounter++; |
|
1616 | + $tableAlias = 't'.$this->currentPersisterContext->sqlAliasCounter++; |
|
1617 | 1617 | |
1618 | 1618 | $this->currentPersisterContext->sqlTableAliases[$tableName] = $tableAlias; |
1619 | 1619 | |
@@ -1639,7 +1639,7 @@ discard block |
||
1639 | 1639 | } |
1640 | 1640 | |
1641 | 1641 | $lock = $this->getLockTablesSql($lockMode); |
1642 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
|
1642 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : '').' '; |
|
1643 | 1643 | $sql = 'SELECT 1 ' |
1644 | 1644 | . $lock |
1645 | 1645 | . $where |
@@ -1662,7 +1662,7 @@ discard block |
||
1662 | 1662 | $tableName = $this->class->table->getQuotedQualifiedName($this->platform); |
1663 | 1663 | |
1664 | 1664 | return $this->platform->appendLockHint( |
1665 | - 'FROM ' . $tableName . ' ' . $this->getSQLTableAlias($this->class->getTableName()), |
|
1665 | + 'FROM '.$tableName.' '.$this->getSQLTableAlias($this->class->getTableName()), |
|
1666 | 1666 | $lockMode |
1667 | 1667 | ); |
1668 | 1668 | } |
@@ -1712,19 +1712,19 @@ discard block |
||
1712 | 1712 | |
1713 | 1713 | if ($comparison !== null) { |
1714 | 1714 | // special case null value handling |
1715 | - if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && $value ===null) { |
|
1716 | - $selectedColumns[] = $column . ' IS NULL'; |
|
1715 | + if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && $value === null) { |
|
1716 | + $selectedColumns[] = $column.' IS NULL'; |
|
1717 | 1717 | |
1718 | 1718 | continue; |
1719 | 1719 | } |
1720 | 1720 | |
1721 | 1721 | if ($comparison === Comparison::NEQ && $value === null) { |
1722 | - $selectedColumns[] = $column . ' IS NOT NULL'; |
|
1722 | + $selectedColumns[] = $column.' IS NOT NULL'; |
|
1723 | 1723 | |
1724 | 1724 | continue; |
1725 | 1725 | } |
1726 | 1726 | |
1727 | - $selectedColumns[] = $column . ' ' . sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1727 | + $selectedColumns[] = $column.' '.sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1728 | 1728 | |
1729 | 1729 | continue; |
1730 | 1730 | } |
@@ -1772,7 +1772,7 @@ discard block |
||
1772 | 1772 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
1773 | 1773 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
1774 | 1774 | |
1775 | - return [$tableAlias . '.' . $columnName]; |
|
1775 | + return [$tableAlias.'.'.$columnName]; |
|
1776 | 1776 | } |
1777 | 1777 | |
1778 | 1778 | if ($property instanceof AssociationMetadata) { |
@@ -1781,7 +1781,7 @@ discard block |
||
1781 | 1781 | |
1782 | 1782 | // Many-To-Many requires join table check for joinColumn |
1783 | 1783 | if ($owningAssociation instanceof ManyToManyAssociationMetadata) { |
1784 | - if (! $owningAssociation->isOwningSide()) { |
|
1784 | + if ( ! $owningAssociation->isOwningSide()) { |
|
1785 | 1785 | $owningAssociation = $association; |
1786 | 1786 | } |
1787 | 1787 | |
@@ -1794,10 +1794,10 @@ discard block |
||
1794 | 1794 | foreach ($joinColumns as $joinColumn) { |
1795 | 1795 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1796 | 1796 | |
1797 | - $columns[] = $joinTableName . '.' . $quotedColumnName; |
|
1797 | + $columns[] = $joinTableName.'.'.$quotedColumnName; |
|
1798 | 1798 | } |
1799 | 1799 | } else { |
1800 | - if (! $owningAssociation->isOwningSide()) { |
|
1800 | + if ( ! $owningAssociation->isOwningSide()) { |
|
1801 | 1801 | throw InvalidFindByCall::fromInverseSideUsage( |
1802 | 1802 | $this->class->getClassName(), |
1803 | 1803 | $field |
@@ -1812,7 +1812,7 @@ discard block |
||
1812 | 1812 | foreach ($owningAssociation->getJoinColumns() as $joinColumn) { |
1813 | 1813 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1814 | 1814 | |
1815 | - $columns[] = $tableAlias . '.' . $quotedColumnName; |
|
1815 | + $columns[] = $tableAlias.'.'.$quotedColumnName; |
|
1816 | 1816 | } |
1817 | 1817 | } |
1818 | 1818 | |
@@ -1921,7 +1921,7 @@ discard block |
||
1921 | 1921 | $value = $value[$targetClass->identifier[0]]; |
1922 | 1922 | } |
1923 | 1923 | |
1924 | - $criteria[$tableAlias . '.' . $quotedColumnName] = $value; |
|
1924 | + $criteria[$tableAlias.'.'.$quotedColumnName] = $value; |
|
1925 | 1925 | $parameters[] = [ |
1926 | 1926 | 'value' => $value, |
1927 | 1927 | 'field' => $fieldName, |
@@ -2006,7 +2006,7 @@ discard block |
||
2006 | 2006 | case $property instanceof AssociationMetadata: |
2007 | 2007 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
2008 | 2008 | |
2009 | - if (! $property->isOwningSide()) { |
|
2009 | + if ( ! $property->isOwningSide()) { |
|
2010 | 2010 | $property = $class->getProperty($property->getMappedBy()); |
2011 | 2011 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
2012 | 2012 | } |
@@ -2019,7 +2019,7 @@ discard block |
||
2019 | 2019 | /** @var JoinColumnMetadata $joinColumn */ |
2020 | 2020 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
2021 | 2021 | |
2022 | - if (! $joinColumn->getType()) { |
|
2022 | + if ( ! $joinColumn->getType()) { |
|
2023 | 2023 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em)); |
2024 | 2024 | } |
2025 | 2025 | |
@@ -2034,7 +2034,7 @@ discard block |
||
2034 | 2034 | } |
2035 | 2035 | |
2036 | 2036 | if (is_array($value)) { |
2037 | - return array_map(static function ($type) { |
|
2037 | + return array_map(static function($type) { |
|
2038 | 2038 | return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET; |
2039 | 2039 | }, $types); |
2040 | 2040 | } |
@@ -2091,7 +2091,7 @@ discard block |
||
2091 | 2091 | */ |
2092 | 2092 | private function getIndividualValue($value) |
2093 | 2093 | { |
2094 | - if (! is_object($value) || ! $this->em->getMetadataFactory()->hasMetadataFor(StaticClassNameConverter::getClass($value))) { |
|
2094 | + if ( ! is_object($value) || ! $this->em->getMetadataFactory()->hasMetadataFor(StaticClassNameConverter::getClass($value))) { |
|
2095 | 2095 | return $value; |
2096 | 2096 | } |
2097 | 2097 | |
@@ -2105,7 +2105,7 @@ discard block |
||
2105 | 2105 | { |
2106 | 2106 | $criteria = $this->getIdentifier($entity); |
2107 | 2107 | |
2108 | - if (! $criteria) { |
|
2108 | + if ( ! $criteria) { |
|
2109 | 2109 | return false; |
2110 | 2110 | } |
2111 | 2111 | |
@@ -2113,12 +2113,12 @@ discard block |
||
2113 | 2113 | |
2114 | 2114 | $sql = 'SELECT 1 ' |
2115 | 2115 | . $this->getLockTablesSql(null) |
2116 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
2116 | + . ' WHERE '.$this->getSelectConditionSQL($criteria); |
|
2117 | 2117 | |
2118 | 2118 | [$params, $types] = $this->expandParameters($criteria); |
2119 | 2119 | |
2120 | 2120 | if ($extraConditions !== null) { |
2121 | - $sql .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions); |
|
2121 | + $sql .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions); |
|
2122 | 2122 | [$criteriaParams, $criteriaTypes] = $this->expandCriteriaParameters($extraConditions); |
2123 | 2123 | |
2124 | 2124 | $params = array_merge($params, $criteriaParams); |
@@ -2128,7 +2128,7 @@ discard block |
||
2128 | 2128 | $filterSql = $this->generateFilterConditionSQL($this->class, $alias); |
2129 | 2129 | |
2130 | 2130 | if ($filterSql) { |
2131 | - $sql .= ' AND ' . $filterSql; |
|
2131 | + $sql .= ' AND '.$filterSql; |
|
2132 | 2132 | } |
2133 | 2133 | |
2134 | 2134 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
@@ -2141,13 +2141,13 @@ discard block |
||
2141 | 2141 | */ |
2142 | 2142 | protected function getJoinSQLForAssociation(AssociationMetadata $association) |
2143 | 2143 | { |
2144 | - if (! $association->isOwningSide()) { |
|
2144 | + if ( ! $association->isOwningSide()) { |
|
2145 | 2145 | return 'LEFT JOIN'; |
2146 | 2146 | } |
2147 | 2147 | |
2148 | 2148 | // if one of the join columns is nullable, return left join |
2149 | 2149 | foreach ($association->getJoinColumns() as $joinColumn) { |
2150 | - if (! $joinColumn->isNullable()) { |
|
2150 | + if ( ! $joinColumn->isNullable()) { |
|
2151 | 2151 | continue; |
2152 | 2152 | } |
2153 | 2153 | |
@@ -2164,7 +2164,7 @@ discard block |
||
2164 | 2164 | */ |
2165 | 2165 | public function getSQLColumnAlias() |
2166 | 2166 | { |
2167 | - return $this->platform->getSQLResultCasing('c' . $this->currentPersisterContext->sqlAliasCounter++); |
|
2167 | + return $this->platform->getSQLResultCasing('c'.$this->currentPersisterContext->sqlAliasCounter++); |
|
2168 | 2168 | } |
2169 | 2169 | |
2170 | 2170 | /** |
@@ -2183,13 +2183,13 @@ discard block |
||
2183 | 2183 | $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias); |
2184 | 2184 | |
2185 | 2185 | if ($filterExpr !== '') { |
2186 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
2186 | + $filterClauses[] = '('.$filterExpr.')'; |
|
2187 | 2187 | } |
2188 | 2188 | } |
2189 | 2189 | |
2190 | 2190 | $sql = implode(' AND ', $filterClauses); |
2191 | 2191 | |
2192 | - return $sql ? '(' . $sql . ')' : ''; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2192 | + return $sql ? '('.$sql.')' : ''; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2193 | 2193 | } |
2194 | 2194 | |
2195 | 2195 | /** |