@@ -162,7 +162,7 @@ |
||
162 | 162 | |
163 | 163 | // Recognize identifiers, aliased or qualified names |
164 | 164 | case ctype_alpha($value[0]) || $value[0] === '_' || $value[0] === '\\': |
165 | - $name = 'Doctrine\ORM\Query\Lexer::T_' . strtoupper($value); |
|
165 | + $name = 'Doctrine\ORM\Query\Lexer::T_'.strtoupper($value); |
|
166 | 166 | |
167 | 167 | if (defined($name)) { |
168 | 168 | $type = constant($name); |
@@ -63,12 +63,12 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function add($arg) |
65 | 65 | { |
66 | - if ($arg !== null && (! $arg instanceof self || $arg->count() > 0)) { |
|
66 | + if ($arg !== null && ( ! $arg instanceof self || $arg->count() > 0)) { |
|
67 | 67 | // If we decide to keep Expr\Base instances, we can use this check |
68 | - if (! is_string($arg)) { |
|
68 | + if ( ! is_string($arg)) { |
|
69 | 69 | $class = get_class($arg); |
70 | 70 | |
71 | - if (! in_array($class, $this->allowedClasses, true)) { |
|
71 | + if ( ! in_array($class, $this->allowedClasses, true)) { |
|
72 | 72 | throw new InvalidArgumentException( |
73 | 73 | sprintf("Expression of type '%s' not allowed in this context.", $class) |
74 | 74 | ); |
@@ -98,6 +98,6 @@ discard block |
||
98 | 98 | return (string) $this->parts[0]; |
99 | 99 | } |
100 | 100 | |
101 | - return $this->preSeparator . implode($this->separator, $this->parts) . $this->postSeparator; |
|
101 | + return $this->preSeparator.implode($this->separator, $this->parts).$this->postSeparator; |
|
102 | 102 | } |
103 | 103 | } |
@@ -81,11 +81,11 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function enable($name) |
83 | 83 | { |
84 | - if (! $this->has($name)) { |
|
85 | - throw new InvalidArgumentException("Filter '" . $name . "' does not exist."); |
|
84 | + if ( ! $this->has($name)) { |
|
85 | + throw new InvalidArgumentException("Filter '".$name."' does not exist."); |
|
86 | 86 | } |
87 | 87 | |
88 | - if (! $this->isEnabled($name)) { |
|
88 | + if ( ! $this->isEnabled($name)) { |
|
89 | 89 | $filterClass = $this->config->getFilterClassName($name); |
90 | 90 | |
91 | 91 | $this->enabledFilters[$name] = new $filterClass($this->em); |
@@ -133,8 +133,8 @@ discard block |
||
133 | 133 | */ |
134 | 134 | public function getFilter($name) |
135 | 135 | { |
136 | - if (! $this->isEnabled($name)) { |
|
137 | - throw new InvalidArgumentException("Filter '" . $name . "' is not enabled."); |
|
136 | + if ( ! $this->isEnabled($name)) { |
|
137 | + throw new InvalidArgumentException("Filter '".$name."' is not enabled."); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | return $this->enabledFilters[$name]; |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | $filterHash = ''; |
188 | 188 | |
189 | 189 | foreach ($this->enabledFilters as $name => $filter) { |
190 | - $filterHash .= $name . $filter; |
|
190 | + $filterHash .= $name.$filter; |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | return $filterHash; |
@@ -83,8 +83,8 @@ |
||
83 | 83 | */ |
84 | 84 | final public function getParameter($name) |
85 | 85 | { |
86 | - if (! isset($this->parameters[$name])) { |
|
87 | - throw new InvalidArgumentException("Parameter '" . $name . "' does not exist."); |
|
86 | + if ( ! isset($this->parameters[$name])) { |
|
87 | + throw new InvalidArgumentException("Parameter '".$name."' does not exist."); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | return $this->em->getConnection()->quote($this->parameters[$name]['value'], $this->parameters[$name]['type']); |
@@ -57,8 +57,8 @@ discard block |
||
57 | 57 | // 1. Create an INSERT INTO temptable ... SELECT identifiers WHERE $AST->getWhereClause() |
58 | 58 | $sqlWalker->setSQLTableAlias($primaryClass->getTableName(), 'i0', $primaryDqlAlias); |
59 | 59 | |
60 | - $this->insertSql = 'INSERT INTO ' . $tempTable . ' (' . $idColumnNameList . ')' |
|
61 | - . ' SELECT i0.' . implode(', i0.', array_keys($idColumns)); |
|
60 | + $this->insertSql = 'INSERT INTO '.$tempTable.' ('.$idColumnNameList.')' |
|
61 | + . ' SELECT i0.'.implode(', i0.', array_keys($idColumns)); |
|
62 | 62 | |
63 | 63 | $rangeDecl = new AST\RangeVariableDeclaration($primaryClass->getClassName(), $primaryDqlAlias); |
64 | 64 | $fromClause = new AST\FromClause([new AST\IdentificationVariableDeclaration($rangeDecl, null, [])]); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | // 3. Create and store DELETE statements |
81 | 81 | $hierarchyClasses = array_merge( |
82 | 82 | array_map( |
83 | - static function ($className) use ($em) { |
|
83 | + static function($className) use ($em) { |
|
84 | 84 | return $em->getClassMetadata($className); |
85 | 85 | }, |
86 | 86 | array_reverse($primaryClass->getSubClasses()) |
@@ -103,8 +103,8 @@ discard block |
||
103 | 103 | ]; |
104 | 104 | } |
105 | 105 | |
106 | - $this->createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable . ' (' |
|
107 | - . $platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; |
|
106 | + $this->createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable.' (' |
|
107 | + . $platform->getColumnDeclarationListSQL($columnDefinitions).')'; |
|
108 | 108 | |
109 | 109 | $this->dropTempTableSql = $platform->getDropTemporaryTableSQL($tempTable); |
110 | 110 | } |
@@ -67,8 +67,8 @@ discard block |
||
67 | 67 | // 1. Create an INSERT INTO temptable ... SELECT identifiers WHERE $AST->getWhereClause() |
68 | 68 | $sqlWalker->setSQLTableAlias($primaryClass->getTableName(), 'i0', $updateClause->aliasIdentificationVariable); |
69 | 69 | |
70 | - $this->insertSql = 'INSERT INTO ' . $tempTable . ' (' . $idColumnNameList . ')' |
|
71 | - . ' SELECT i0.' . implode(', i0.', array_keys($idColumns)); |
|
70 | + $this->insertSql = 'INSERT INTO '.$tempTable.' ('.$idColumnNameList.')' |
|
71 | + . ' SELECT i0.'.implode(', i0.', array_keys($idColumns)); |
|
72 | 72 | |
73 | 73 | $rangeDecl = new AST\RangeVariableDeclaration($primaryClass->getClassName(), $updateClause->aliasIdentificationVariable); |
74 | 74 | $fromClause = new AST\FromClause([new AST\IdentificationVariableDeclaration($rangeDecl, null, [])]); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | // 3. Create and store UPDATE statements |
87 | 87 | $hierarchyClasses = array_merge( |
88 | 88 | array_map( |
89 | - static function ($className) use ($em) { |
|
89 | + static function($className) use ($em) { |
|
90 | 90 | return $em->getClassMetadata($className); |
91 | 91 | }, |
92 | 92 | array_reverse($primaryClass->getSubClasses()) |
@@ -142,8 +142,8 @@ discard block |
||
142 | 142 | ]; |
143 | 143 | } |
144 | 144 | |
145 | - $this->createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable . ' (' |
|
146 | - . $platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; |
|
145 | + $this->createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable.' (' |
|
146 | + . $platform->getColumnDeclarationListSQL($columnDefinitions).')'; |
|
147 | 147 | |
148 | 148 | $this->dropTempTableSql = $platform->getDropTemporaryTableSQL($tempTable); |
149 | 149 | } |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | { |
294 | 294 | $query = new Query($this); |
295 | 295 | |
296 | - if (! empty($dql)) { |
|
296 | + if ( ! empty($dql)) { |
|
297 | 297 | $query->setDQL($dql); |
298 | 298 | } |
299 | 299 | |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | $this->checkLockRequirements($lockMode, $class); |
385 | 385 | } |
386 | 386 | |
387 | - if (! is_array($id)) { |
|
387 | + if ( ! is_array($id)) { |
|
388 | 388 | if ($class->isIdentifierComposite()) { |
389 | 389 | throw ORMInvalidArgumentException::invalidCompositeIdentifier(); |
390 | 390 | } |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | $sortedId = []; |
406 | 406 | |
407 | 407 | foreach ($class->identifier as $identifier) { |
408 | - if (! isset($id[$identifier])) { |
|
408 | + if ( ! isset($id[$identifier])) { |
|
409 | 409 | throw MissingIdentifierField::fromFieldAndClass($identifier, $className); |
410 | 410 | } |
411 | 411 | |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | // Check identity map first |
423 | 423 | $entity = $unitOfWork->tryGetById($sortedId, $class->getRootClassName()); |
424 | 424 | if ($entity !== false) { |
425 | - if (! ($entity instanceof $className)) { |
|
425 | + if ( ! ($entity instanceof $className)) { |
|
426 | 426 | return null; |
427 | 427 | } |
428 | 428 | |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | $class = $this->metadataFactory->getMetadataFor(ltrim($entityName, '\\')); |
468 | 468 | $className = $class->getClassName(); |
469 | 469 | |
470 | - if (! is_array($id)) { |
|
470 | + if ( ! is_array($id)) { |
|
471 | 471 | if ($class->isIdentifierComposite()) { |
472 | 472 | throw ORMInvalidArgumentException::invalidCompositeIdentifier(); |
473 | 473 | } |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | $sortedId = []; |
493 | 493 | |
494 | 494 | foreach ($class->identifier as $identifier) { |
495 | - if (! isset($scalarId[$identifier])) { |
|
495 | + if ( ! isset($scalarId[$identifier])) { |
|
496 | 496 | throw MissingIdentifierField::fromFieldAndClass($identifier, $className); |
497 | 497 | } |
498 | 498 | |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | $class = $this->metadataFactory->getMetadataFor(ltrim($entityName, '\\')); |
534 | 534 | $className = $class->getClassName(); |
535 | 535 | |
536 | - if (! is_array($id)) { |
|
536 | + if ( ! is_array($id)) { |
|
537 | 537 | if ($class->isIdentifierComposite()) { |
538 | 538 | throw ORMInvalidArgumentException::invalidCompositeIdentifier(); |
539 | 539 | } |
@@ -554,7 +554,7 @@ discard block |
||
554 | 554 | $sortedId = []; |
555 | 555 | |
556 | 556 | foreach ($class->identifier as $identifier) { |
557 | - if (! isset($id[$identifier])) { |
|
557 | + if ( ! isset($id[$identifier])) { |
|
558 | 558 | throw MissingIdentifierField::fromFieldAndClass($identifier, $className); |
559 | 559 | } |
560 | 560 | |
@@ -626,7 +626,7 @@ discard block |
||
626 | 626 | */ |
627 | 627 | public function persist($entity) |
628 | 628 | { |
629 | - if (! is_object($entity)) { |
|
629 | + if ( ! is_object($entity)) { |
|
630 | 630 | throw ORMInvalidArgumentException::invalidObject('EntityManager#persist()', $entity); |
631 | 631 | } |
632 | 632 | |
@@ -648,7 +648,7 @@ discard block |
||
648 | 648 | */ |
649 | 649 | public function remove($entity) |
650 | 650 | { |
651 | - if (! is_object($entity)) { |
|
651 | + if ( ! is_object($entity)) { |
|
652 | 652 | throw ORMInvalidArgumentException::invalidObject('EntityManager#remove()', $entity); |
653 | 653 | } |
654 | 654 | |
@@ -668,7 +668,7 @@ discard block |
||
668 | 668 | */ |
669 | 669 | public function refresh($entity) |
670 | 670 | { |
671 | - if (! is_object($entity)) { |
|
671 | + if ( ! is_object($entity)) { |
|
672 | 672 | throw ORMInvalidArgumentException::invalidObject('EntityManager#refresh()', $entity); |
673 | 673 | } |
674 | 674 | |
@@ -823,7 +823,7 @@ discard block |
||
823 | 823 | */ |
824 | 824 | public static function create($connection, Configuration $config, ?EventManager $eventManager = null) |
825 | 825 | { |
826 | - if (! $config->getMetadataDriverImpl()) { |
|
826 | + if ( ! $config->getMetadataDriverImpl()) { |
|
827 | 827 | throw MissingMappingDriverImplementation::create(); |
828 | 828 | } |
829 | 829 | |
@@ -850,12 +850,12 @@ discard block |
||
850 | 850 | return DriverManager::getConnection($connection, $config, $eventManager ?: new EventManager()); |
851 | 851 | } |
852 | 852 | |
853 | - if (! $connection instanceof Connection) { |
|
853 | + if ( ! $connection instanceof Connection) { |
|
854 | 854 | throw new InvalidArgumentException( |
855 | 855 | sprintf( |
856 | 856 | 'Invalid $connection argument of type %s given%s.', |
857 | 857 | is_object($connection) ? get_class($connection) : gettype($connection), |
858 | - is_object($connection) ? '' : ': "' . $connection . '"' |
|
858 | + is_object($connection) ? '' : ': "'.$connection.'"' |
|
859 | 859 | ) |
860 | 860 | ); |
861 | 861 | } |
@@ -903,13 +903,13 @@ discard block |
||
903 | 903 | { |
904 | 904 | switch ($lockMode) { |
905 | 905 | case LockMode::OPTIMISTIC: |
906 | - if (! $class->isVersioned()) { |
|
906 | + if ( ! $class->isVersioned()) { |
|
907 | 907 | throw OptimisticLockException::notVersioned($class->getClassName()); |
908 | 908 | } |
909 | 909 | break; |
910 | 910 | case LockMode::PESSIMISTIC_READ: |
911 | 911 | case LockMode::PESSIMISTIC_WRITE: |
912 | - if (! $this->getConnection()->isTransactionActive()) { |
|
912 | + if ( ! $this->getConnection()->isTransactionActive()) { |
|
913 | 913 | throw TransactionRequiredException::transactionRequired(); |
914 | 914 | } |
915 | 915 | } |
@@ -100,7 +100,7 @@ |
||
100 | 100 | */ |
101 | 101 | private function assertValidField($field) |
102 | 102 | { |
103 | - if (! isset($this->entityChangeSet[$field])) { |
|
103 | + if ( ! isset($this->entityChangeSet[$field])) { |
|
104 | 104 | throw new InvalidArgumentException(sprintf( |
105 | 105 | 'Field "%s" is not a valid field of the entity "%s" in PreUpdateEventArgs.', |
106 | 106 | $field, |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | if ($property instanceof AssociationMetadata) { |
56 | 56 | throw new RuntimeException( |
57 | - 'Paginating an entity with foreign key as identifier only works when using the Output Walkers. ' . |
|
57 | + 'Paginating an entity with foreign key as identifier only works when using the Output Walkers. '. |
|
58 | 58 | 'Call Paginator#setUseOutputWalkers(true) before iterating the paginator.' |
59 | 59 | ); |
60 | 60 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | $AST->selectClause->selectExpressions = [new SelectExpression($pathExpression, '_dctrn_id')]; |
73 | 73 | $AST->selectClause->isDistinct = true; |
74 | 74 | |
75 | - if (! isset($AST->orderByClause)) { |
|
75 | + if ( ! isset($AST->orderByClause)) { |
|
76 | 76 | return; |
77 | 77 | } |
78 | 78 | |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | if ($item->expression instanceof PathExpression) { |
81 | 81 | $AST->selectClause->selectExpressions[] = new SelectExpression( |
82 | 82 | $this->createSelectExpressionItem($item->expression), |
83 | - '_dctrn_ord' . $this->aliasCounter++ |
|
83 | + '_dctrn_ord'.$this->aliasCounter++ |
|
84 | 84 | ); |
85 | 85 | |
86 | 86 | continue; |