@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | $tokenStr = substr($dql, $token['position'], $length); |
488 | 488 | |
489 | 489 | // Building informative message |
490 | - $message = 'line 0, col ' . $tokenPos . " near '" . $tokenStr . "': Error: " . $message; |
|
490 | + $message = 'line 0, col '.$tokenPos." near '".$tokenStr."': Error: ".$message; |
|
491 | 491 | |
492 | 492 | throw QueryException::semanticalError($message, QueryException::dqlError($this->query->getDQL())); |
493 | 493 | } |
@@ -634,7 +634,7 @@ discard block |
||
634 | 634 | // If the namespace is not given then assumes the first FROM entity namespace |
635 | 635 | if (strpos($className, '\\') === false && ! class_exists($className) && strpos($fromClassName, '\\') !== false) { |
636 | 636 | $namespace = substr($fromClassName, 0, strrpos($fromClassName, '\\')); |
637 | - $fqcn = $namespace . '\\' . $className; |
|
637 | + $fqcn = $namespace.'\\'.$className; |
|
638 | 638 | |
639 | 639 | if (class_exists($fqcn)) { |
640 | 640 | $expression->className = $fqcn; |
@@ -686,13 +686,13 @@ discard block |
||
686 | 686 | } |
687 | 687 | |
688 | 688 | $this->semanticalError( |
689 | - "There is no mapped field named '$field' on class " . $class->name . ".", $deferredItem['token'] |
|
689 | + "There is no mapped field named '$field' on class ".$class->name.".", $deferredItem['token'] |
|
690 | 690 | ); |
691 | 691 | } |
692 | 692 | |
693 | 693 | if (array_intersect($class->identifier, $expr->partialFieldSet) != $class->identifier) { |
694 | 694 | $this->semanticalError( |
695 | - "The partial field selection of class " . $class->name . " must contain the identifier.", |
|
695 | + "The partial field selection of class ".$class->name." must contain the identifier.", |
|
696 | 696 | $deferredItem['token'] |
697 | 697 | ); |
698 | 698 | } |
@@ -761,7 +761,7 @@ discard block |
||
761 | 761 | // Check if field or association exists |
762 | 762 | if ( ! isset($class->associationMappings[$field]) && ! isset($class->fieldMappings[$field])) { |
763 | 763 | $this->semanticalError( |
764 | - 'Class ' . $class->name . ' has no field or association named ' . $field, |
|
764 | + 'Class '.$class->name.' has no field or association named '.$field, |
|
765 | 765 | $deferredItem['token'] |
766 | 766 | ); |
767 | 767 | } |
@@ -801,8 +801,8 @@ discard block |
||
801 | 801 | // Build the error message |
802 | 802 | $semanticalError = 'Invalid PathExpression. '; |
803 | 803 | $semanticalError .= (count($expectedStringTypes) == 1) |
804 | - ? 'Must be a ' . $expectedStringTypes[0] . '.' |
|
805 | - : implode(' or ', $expectedStringTypes) . ' expected.'; |
|
804 | + ? 'Must be a '.$expectedStringTypes[0].'.' |
|
805 | + : implode(' or ', $expectedStringTypes).' expected.'; |
|
806 | 806 | |
807 | 807 | $this->semanticalError($semanticalError, $deferredItem['token']); |
808 | 808 | } |
@@ -976,7 +976,7 @@ discard block |
||
976 | 976 | |
977 | 977 | [$namespaceAlias, $simpleClassName] = explode(':', $this->lexer->token['value']); |
978 | 978 | |
979 | - return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName; |
|
979 | + return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias).'\\'.$simpleClassName; |
|
980 | 980 | } |
981 | 981 | |
982 | 982 | /** |
@@ -988,7 +988,7 @@ discard block |
||
988 | 988 | */ |
989 | 989 | private function validateAbstractSchemaName($schemaName) |
990 | 990 | { |
991 | - if (! (class_exists($schemaName, true) || interface_exists($schemaName, true))) { |
|
991 | + if ( ! (class_exists($schemaName, true) || interface_exists($schemaName, true))) { |
|
992 | 992 | $this->semanticalError("Class '$schemaName' is not defined.", $this->lexer->token); |
993 | 993 | } |
994 | 994 | } |
@@ -1044,7 +1044,7 @@ discard block |
||
1044 | 1044 | |
1045 | 1045 | if ( ! isset($this->queryComponents[$identVariable])) { |
1046 | 1046 | $this->semanticalError( |
1047 | - 'Identification Variable ' . $identVariable .' used in join path expression but was not defined before.' |
|
1047 | + 'Identification Variable '.$identVariable.' used in join path expression but was not defined before.' |
|
1048 | 1048 | ); |
1049 | 1049 | } |
1050 | 1050 | |
@@ -1058,7 +1058,7 @@ discard block |
||
1058 | 1058 | $class = $qComp['metadata']; |
1059 | 1059 | |
1060 | 1060 | if ( ! $class->hasAssociation($field)) { |
1061 | - $this->semanticalError('Class ' . $class->name . ' has no association named ' . $field); |
|
1061 | + $this->semanticalError('Class '.$class->name.' has no association named '.$field); |
|
1062 | 1062 | } |
1063 | 1063 | |
1064 | 1064 | return new AST\JoinAssociationPathExpression($identVariable, $field); |
@@ -2587,7 +2587,7 @@ discard block |
||
2587 | 2587 | return $this->NullComparisonExpression(); |
2588 | 2588 | } |
2589 | 2589 | |
2590 | - if ($token['type'] === Lexer::T_IS && $lookahead['type'] === Lexer::T_EMPTY) { |
|
2590 | + if ($token['type'] === Lexer::T_IS && $lookahead['type'] === Lexer::T_EMPTY) { |
|
2591 | 2591 | return $this->EmptyCollectionComparisonExpression(); |
2592 | 2592 | } |
2593 | 2593 |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | */ |
402 | 402 | public function containsKey($key) |
403 | 403 | { |
404 | - if (! $this->initialized && $this->association['fetch'] === ClassMetadata::FETCH_EXTRA_LAZY |
|
404 | + if ( ! $this->initialized && $this->association['fetch'] === ClassMetadata::FETCH_EXTRA_LAZY |
|
405 | 405 | && isset($this->association['indexBy'])) { |
406 | 406 | $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association); |
407 | 407 | |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | && $this->association['fetch'] === ClassMetadata::FETCH_EXTRA_LAZY |
435 | 435 | && isset($this->association['indexBy']) |
436 | 436 | ) { |
437 | - if (!$this->typeClass->isIdentifierComposite && $this->typeClass->isIdentifier($this->association['indexBy'])) { |
|
437 | + if ( ! $this->typeClass->isIdentifierComposite && $this->typeClass->isIdentifier($this->association['indexBy'])) { |
|
438 | 438 | return $this->em->find($this->typeClass->name, $key); |
439 | 439 | } |
440 | 440 | |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | */ |
450 | 450 | public function count() |
451 | 451 | { |
452 | - if (! $this->initialized && $this->association !== null && $this->association['fetch'] === ClassMetadata::FETCH_EXTRA_LAZY) { |
|
452 | + if ( ! $this->initialized && $this->association !== null && $this->association['fetch'] === ClassMetadata::FETCH_EXTRA_LAZY) { |
|
453 | 453 | $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association); |
454 | 454 | |
455 | 455 | return $persister->count($this) + ($this->isDirty ? $this->collection->count() : 0); |
@@ -567,7 +567,7 @@ discard block |
||
567 | 567 | if ($this->association['isOwningSide'] && $this->owner) { |
568 | 568 | $this->changed(); |
569 | 569 | |
570 | - if (! $this->em->getClassMetadata(get_class($this->owner))->isChangeTrackingDeferredExplicit()) { |
|
570 | + if ( ! $this->em->getClassMetadata(get_class($this->owner))->isChangeTrackingDeferredExplicit()) { |
|
571 | 571 | $uow->scheduleCollectionDeletion($this); |
572 | 572 | } |
573 | 573 |
@@ -108,15 +108,15 @@ discard block |
||
108 | 108 | { |
109 | 109 | require_once __DIR__."/../../Models/Global/GlobalNamespaceModel.php"; |
110 | 110 | |
111 | - $metadataDriver = $this->createAnnotationDriver([__DIR__ . '/../../Models/Global/']); |
|
111 | + $metadataDriver = $this->createAnnotationDriver([__DIR__.'/../../Models/Global/']); |
|
112 | 112 | |
113 | 113 | $entityManager = $this->_createEntityManager($metadataDriver); |
114 | 114 | |
115 | 115 | $mf = $entityManager->getMetadataFactory(); |
116 | 116 | $m1 = $mf->getMetadataFor(DoctrineGlobal_Article::class); |
117 | 117 | $h1 = $mf->hasMetadataFor(DoctrineGlobal_Article::class); |
118 | - $h2 = $mf->hasMetadataFor('\\' . DoctrineGlobal_Article::class); |
|
119 | - $m2 = $mf->getMetadataFor('\\' . DoctrineGlobal_Article::class); |
|
118 | + $h2 = $mf->hasMetadataFor('\\'.DoctrineGlobal_Article::class); |
|
119 | + $m2 = $mf->getMetadataFor('\\'.DoctrineGlobal_Article::class); |
|
120 | 120 | |
121 | 121 | $this->assertNotSame($m1, $m2); |
122 | 122 | $this->assertFalse($h2); |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | self::markTestSkipped('This test is just incorrect and must be fixed'); |
174 | 174 | |
175 | 175 | $cmf = new ClassMetadataFactory(); |
176 | - $driver = $this->createAnnotationDriver([__DIR__ . '/../../Models/JoinedInheritanceType/']); |
|
176 | + $driver = $this->createAnnotationDriver([__DIR__.'/../../Models/JoinedInheritanceType/']); |
|
177 | 177 | $em = $this->_createEntityManager($driver); |
178 | 178 | $cmf->setEntityManager($em); |
179 | 179 | |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | { |
214 | 214 | // DDC-3551 |
215 | 215 | $conn = $this->createMock(Connection::class); |
216 | - $mockDriver = new MetadataDriverMock(); |
|
216 | + $mockDriver = new MetadataDriverMock(); |
|
217 | 217 | $em = $this->_createEntityManager($mockDriver, $conn); |
218 | 218 | |
219 | 219 | $conn->expects($this->any()) |
@@ -233,10 +233,10 @@ discard block |
||
233 | 233 | { |
234 | 234 | $driverMock = new DriverMock(); |
235 | 235 | $config = new Configuration(); |
236 | - $config->setProxyDir(__DIR__ . '/../../Proxies'); |
|
236 | + $config->setProxyDir(__DIR__.'/../../Proxies'); |
|
237 | 237 | $config->setProxyNamespace('Doctrine\Tests\Proxies'); |
238 | 238 | $eventManager = new EventManager(); |
239 | - if (!$conn) { |
|
239 | + if ( ! $conn) { |
|
240 | 240 | $conn = new ConnectionMock([], $driverMock, $config, $eventManager); |
241 | 241 | } |
242 | 242 | $config->setMetadataDriverImpl($metadataDriver); |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | public function testQuoteMetadata() |
291 | 291 | { |
292 | 292 | $cmf = new ClassMetadataFactory(); |
293 | - $driver = $this->createAnnotationDriver([__DIR__ . '/../../Models/Quote/']); |
|
293 | + $driver = $this->createAnnotationDriver([__DIR__.'/../../Models/Quote/']); |
|
294 | 294 | $em = $this->_createEntityManager($driver); |
295 | 295 | $cmf->setEntityManager($em); |
296 | 296 | |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | $listener |
386 | 386 | ->expects($this->any()) |
387 | 387 | ->method('onClassMetadataNotFound') |
388 | - ->will($this->returnCallback(function (OnClassMetadataNotFoundEventArgs $args) use ($metadata, $em, $test) { |
|
388 | + ->will($this->returnCallback(function(OnClassMetadataNotFoundEventArgs $args) use ($metadata, $em, $test) { |
|
389 | 389 | $test->assertNull($args->getFoundMetadata()); |
390 | 390 | $test->assertSame('Foo', $args->getClassName()); |
391 | 391 | $test->assertSame($em, $args->getObjectManager()); |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | public function testInheritsIdGeneratorMappingFromEmbeddable() |
446 | 446 | { |
447 | 447 | $cmf = new ClassMetadataFactory(); |
448 | - $driver = $this->createAnnotationDriver([__DIR__ . '/../../Models/DDC4006/']); |
|
448 | + $driver = $this->createAnnotationDriver([__DIR__.'/../../Models/DDC4006/']); |
|
449 | 449 | $em = $this->_createEntityManager($driver); |
450 | 450 | $cmf->setEntityManager($em); |
451 | 451 |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | { |
48 | 48 | parent::setUp(); |
49 | 49 | |
50 | - if (! Type::hasType(GH7820LineTextType::class)) { |
|
50 | + if ( ! Type::hasType(GH7820LineTextType::class)) { |
|
51 | 51 | Type::addType(GH7820LineTextType::class, GH7820LineTextType::class); |
52 | 52 | } |
53 | 53 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | |
69 | 69 | self::assertSame( |
70 | 70 | self::SONG, |
71 | - array_map(static function (GH7820Line $line) : string { |
|
71 | + array_map(static function(GH7820Line $line) : string { |
|
72 | 72 | return $line->toString(); |
73 | 73 | }, iterator_to_array(new Paginator($query))) |
74 | 74 | ); |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | |
126 | 126 | public function __toString() : string |
127 | 127 | { |
128 | - return 'Line: ' . $this->text; |
|
128 | + return 'Line: '.$this->text; |
|
129 | 129 | } |
130 | 130 | } |
131 | 131 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | { |
136 | 136 | $text = parent::convertToPHPValue($value, $platform); |
137 | 137 | |
138 | - if (! is_string($text)) { |
|
138 | + if ( ! is_string($text)) { |
|
139 | 139 | return $text; |
140 | 140 | } |
141 | 141 | |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | |
145 | 145 | public function convertToDatabaseValue($value, AbstractPlatform $platform) |
146 | 146 | { |
147 | - if (! $value instanceof GH7820LineText) { |
|
147 | + if ( ! $value instanceof GH7820LineText) { |
|
148 | 148 | return parent::convertToDatabaseValue($value, $platform); |
149 | 149 | } |
150 | 150 |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | { |
19 | 19 | parent::setUp(); |
20 | 20 | |
21 | - if (! Type::hasType('rot13')) { |
|
21 | + if ( ! Type::hasType('rot13')) { |
|
22 | 22 | Type::addType('rot13', Rot13Type::class); |
23 | 23 | } |
24 | 24 | } |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | */ |
189 | 189 | public function testWhereInQueryWithArbitraryJoin_NoWhere() |
190 | 190 | { |
191 | - $whereInQuery = $this->entityManager->createQuery( |
|
191 | + $whereInQuery = $this->entityManager->createQuery( |
|
192 | 192 | 'SELECT p FROM Doctrine\Tests\ORM\Tools\Pagination\BlogPost p JOIN Doctrine\Tests\ORM\Tools\Pagination\Category c WITH p.category = c' |
193 | 193 | ); |
194 | 194 | $whereInQuery->setHint(Query::HINT_CUSTOM_TREE_WALKERS, [WhereInWalker::class]); |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | public function testWillReplaceBoundQueryIdentifiersWithConvertedTypesAsPerIdentifierMapping() : void |
228 | 228 | { |
229 | 229 | $whereInQuery = $this->entityManager->createQuery( |
230 | - 'SELECT e.id4 FROM ' . AuxiliaryEntity::class . ' e' |
|
230 | + 'SELECT e.id4 FROM '.AuxiliaryEntity::class.' e' |
|
231 | 231 | ); |
232 | 232 | $whereInQuery->setHint(Query::HINT_CUSTOM_TREE_WALKERS, [WhereInWalker::class]); |
233 | 233 | $whereInQuery->setHint(WhereInWalker::HINT_PAGINATOR_ID_COUNT, 3); |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | public function testWillReplaceBoundQueryIdentifiersWithConvertedTypesAsPerAssociatedEntityIdentifierMapping() : void |
243 | 243 | { |
244 | 244 | $whereInQuery = $this->entityManager->createQuery( |
245 | - 'SELECT e FROM ' . OwningManyToOneIdForeignKeyEntity::class . ' e' |
|
245 | + 'SELECT e FROM '.OwningManyToOneIdForeignKeyEntity::class.' e' |
|
246 | 246 | ); |
247 | 247 | $whereInQuery->setHint(Query::HINT_CUSTOM_TREE_WALKERS, [WhereInWalker::class]); |
248 | 248 | $whereInQuery->setHint(WhereInWalker::HINT_PAGINATOR_ID_COUNT, 3); |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | [$pathExpression] |
109 | 109 | ); |
110 | 110 | $expression = new InExpression($arithmeticExpression); |
111 | - $expression->literals[] = new InputParameter(":" . self::PAGINATOR_ID_ALIAS); |
|
111 | + $expression->literals[] = new InputParameter(":".self::PAGINATOR_ID_ALIAS); |
|
112 | 112 | |
113 | 113 | $this->convertWhereInIdentifiersToDatabaseValue( |
114 | 114 | PersisterHelper::getTypeOfField( |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | ->getEntityManager() |
178 | 178 | ->getConnection(); |
179 | 179 | |
180 | - $query->setParameter(self::PAGINATOR_ID_ALIAS, array_map(static function ($id) use ($connection, $type) { |
|
180 | + $query->setParameter(self::PAGINATOR_ID_ALIAS, array_map(static function($id) use ($connection, $type) { |
|
181 | 181 | return $connection->convertToDatabaseValue($id, $type); |
182 | 182 | }, $identifiers)); |
183 | 183 | } |
@@ -344,9 +344,9 @@ discard block |
||
344 | 344 | $columnName = $this->quoteStrategy->getColumnName($versionField, $versionedClass, $this->platform); |
345 | 345 | |
346 | 346 | // FIXME: Order with composite keys might not be correct |
347 | - $sql = 'SELECT ' . $columnName |
|
348 | - . ' FROM ' . $tableName |
|
349 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
347 | + $sql = 'SELECT '.$columnName |
|
348 | + . ' FROM '.$tableName |
|
349 | + . ' WHERE '.implode(' = ? AND ', $identifier).' = ?'; |
|
350 | 350 | |
351 | 351 | |
352 | 352 | $flatId = $this->identifierFlattener->flattenIdentifier($versionedClass, $id); |
@@ -439,7 +439,7 @@ discard block |
||
439 | 439 | } |
440 | 440 | |
441 | 441 | $params[] = $value; |
442 | - $set[] = $column . ' = ' . $placeholder; |
|
442 | + $set[] = $column.' = '.$placeholder; |
|
443 | 443 | $types[] = $this->columnTypes[$columnName]; |
444 | 444 | } |
445 | 445 | |
@@ -485,18 +485,18 @@ discard block |
||
485 | 485 | case Type::SMALLINT: |
486 | 486 | case Type::INTEGER: |
487 | 487 | case Type::BIGINT: |
488 | - $set[] = $versionColumn . ' = ' . $versionColumn . ' + 1'; |
|
488 | + $set[] = $versionColumn.' = '.$versionColumn.' + 1'; |
|
489 | 489 | break; |
490 | 490 | |
491 | 491 | case Type::DATETIME: |
492 | - $set[] = $versionColumn . ' = CURRENT_TIMESTAMP'; |
|
492 | + $set[] = $versionColumn.' = CURRENT_TIMESTAMP'; |
|
493 | 493 | break; |
494 | 494 | } |
495 | 495 | } |
496 | 496 | |
497 | - $sql = 'UPDATE ' . $quotedTableName |
|
498 | - . ' SET ' . implode(', ', $set) |
|
499 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
497 | + $sql = 'UPDATE '.$quotedTableName |
|
498 | + . ' SET '.implode(', ', $set) |
|
499 | + . ' WHERE '.implode(' = ? AND ', $where).' = ?'; |
|
500 | 500 | |
501 | 501 | $result = $this->conn->executeUpdate($sql, $params, $types); |
502 | 502 | |
@@ -539,7 +539,7 @@ discard block |
||
539 | 539 | |
540 | 540 | |
541 | 541 | if ($selfReferential) { |
542 | - $otherColumns = (! $mapping['isOwningSide']) |
|
542 | + $otherColumns = ( ! $mapping['isOwningSide']) |
|
543 | 543 | ? $association['joinTable']['joinColumns'] |
544 | 544 | : $association['joinTable']['inverseJoinColumns']; |
545 | 545 | } |
@@ -1021,7 +1021,7 @@ discard block |
||
1021 | 1021 | ); |
1022 | 1022 | } |
1023 | 1023 | |
1024 | - $criteria[$quotedJoinTable . '.' . $quotedKeyColumn] = $value; |
|
1024 | + $criteria[$quotedJoinTable.'.'.$quotedKeyColumn] = $value; |
|
1025 | 1025 | $parameters[] = [ |
1026 | 1026 | 'value' => $value, |
1027 | 1027 | 'field' => $field, |
@@ -1064,11 +1064,11 @@ discard block |
||
1064 | 1064 | |
1065 | 1065 | switch ($lockMode) { |
1066 | 1066 | case LockMode::PESSIMISTIC_READ: |
1067 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
1067 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
1068 | 1068 | break; |
1069 | 1069 | |
1070 | 1070 | case LockMode::PESSIMISTIC_WRITE: |
1071 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
1071 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
1072 | 1072 | break; |
1073 | 1073 | } |
1074 | 1074 | |
@@ -1079,14 +1079,14 @@ discard block |
||
1079 | 1079 | |
1080 | 1080 | if ('' !== $filterSql) { |
1081 | 1081 | $conditionSql = $conditionSql |
1082 | - ? $conditionSql . ' AND ' . $filterSql |
|
1082 | + ? $conditionSql.' AND '.$filterSql |
|
1083 | 1083 | : $filterSql; |
1084 | 1084 | } |
1085 | 1085 | |
1086 | - $select = 'SELECT ' . $columnList; |
|
1087 | - $from = ' FROM ' . $tableName . ' '. $tableAlias; |
|
1088 | - $join = $this->currentPersisterContext->selectJoinSql . $joinSql; |
|
1089 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : ''); |
|
1086 | + $select = 'SELECT '.$columnList; |
|
1087 | + $from = ' FROM '.$tableName.' '.$tableAlias; |
|
1088 | + $join = $this->currentPersisterContext->selectJoinSql.$joinSql; |
|
1089 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : ''); |
|
1090 | 1090 | $lock = $this->platform->appendLockHint($from, $lockMode); |
1091 | 1091 | $query = $select |
1092 | 1092 | . $lock |
@@ -1094,7 +1094,7 @@ discard block |
||
1094 | 1094 | . $where |
1095 | 1095 | . $orderBySql; |
1096 | 1096 | |
1097 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
1097 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
1098 | 1098 | } |
1099 | 1099 | |
1100 | 1100 | /** |
@@ -1113,13 +1113,13 @@ discard block |
||
1113 | 1113 | |
1114 | 1114 | if ('' !== $filterSql) { |
1115 | 1115 | $conditionSql = $conditionSql |
1116 | - ? $conditionSql . ' AND ' . $filterSql |
|
1116 | + ? $conditionSql.' AND '.$filterSql |
|
1117 | 1117 | : $filterSql; |
1118 | 1118 | } |
1119 | 1119 | |
1120 | 1120 | $sql = 'SELECT COUNT(*) ' |
1121 | - . 'FROM ' . $tableName . ' ' . $tableAlias |
|
1122 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
1121 | + . 'FROM '.$tableName.' '.$tableAlias |
|
1122 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
1123 | 1123 | |
1124 | 1124 | return $sql; |
1125 | 1125 | } |
@@ -1152,7 +1152,7 @@ discard block |
||
1152 | 1152 | : $baseTableAlias; |
1153 | 1153 | |
1154 | 1154 | $columnName = $this->quoteStrategy->getColumnName($fieldName, $this->class, $this->platform); |
1155 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
1155 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
1156 | 1156 | |
1157 | 1157 | continue; |
1158 | 1158 | } |
@@ -1169,7 +1169,7 @@ discard block |
||
1169 | 1169 | |
1170 | 1170 | foreach ($this->class->associationMappings[$fieldName]['joinColumns'] as $joinColumn) { |
1171 | 1171 | $columnName = $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
1172 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
1172 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
1173 | 1173 | } |
1174 | 1174 | |
1175 | 1175 | continue; |
@@ -1178,7 +1178,7 @@ discard block |
||
1178 | 1178 | throw ORMException::unrecognizedField($fieldName); |
1179 | 1179 | } |
1180 | 1180 | |
1181 | - return ' ORDER BY ' . implode(', ', $orderByList); |
|
1181 | + return ' ORDER BY '.implode(', ', $orderByList); |
|
1182 | 1182 | } |
1183 | 1183 | |
1184 | 1184 | /** |
@@ -1206,8 +1206,8 @@ discard block |
||
1206 | 1206 | $columnList[] = $this->getSelectColumnSQL($field, $this->class); |
1207 | 1207 | } |
1208 | 1208 | |
1209 | - $this->currentPersisterContext->selectJoinSql = ''; |
|
1210 | - $eagerAliasCounter = 0; |
|
1209 | + $this->currentPersisterContext->selectJoinSql = ''; |
|
1210 | + $eagerAliasCounter = 0; |
|
1211 | 1211 | |
1212 | 1212 | foreach ($this->class->associationMappings as $assocField => $assoc) { |
1213 | 1213 | $assocColumnSQL = $this->getSelectColumnAssociationSQL($assocField, $assoc, $this->class); |
@@ -1233,7 +1233,7 @@ discard block |
||
1233 | 1233 | continue; // now this is why you shouldn't use inheritance |
1234 | 1234 | } |
1235 | 1235 | |
1236 | - $assocAlias = 'e' . ($eagerAliasCounter++); |
|
1236 | + $assocAlias = 'e'.($eagerAliasCounter++); |
|
1237 | 1237 | $this->currentPersisterContext->rsm->addJoinedEntityResult($assoc['targetEntity'], $assocAlias, 'r', $assocField); |
1238 | 1238 | |
1239 | 1239 | foreach ($eagerEntity->fieldNames as $field) { |
@@ -1266,14 +1266,14 @@ discard block |
||
1266 | 1266 | $joinTableName = $this->quoteStrategy->getTableName($eagerEntity, $this->platform); |
1267 | 1267 | |
1268 | 1268 | if ($assoc['isOwningSide']) { |
1269 | - $tableAlias = $this->getSQLTableAlias($association['targetEntity'], $assocAlias); |
|
1270 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $this->getJoinSQLForJoinColumns($association['joinColumns']); |
|
1269 | + $tableAlias = $this->getSQLTableAlias($association['targetEntity'], $assocAlias); |
|
1270 | + $this->currentPersisterContext->selectJoinSql .= ' '.$this->getJoinSQLForJoinColumns($association['joinColumns']); |
|
1271 | 1271 | |
1272 | 1272 | foreach ($association['joinColumns'] as $joinColumn) { |
1273 | 1273 | $sourceCol = $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
1274 | 1274 | $targetCol = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $this->class, $this->platform); |
1275 | 1275 | $joinCondition[] = $this->getSQLTableAlias($association['sourceEntity']) |
1276 | - . '.' . $sourceCol . ' = ' . $tableAlias . '.' . $targetCol; |
|
1276 | + . '.'.$sourceCol.' = '.$tableAlias.'.'.$targetCol; |
|
1277 | 1277 | } |
1278 | 1278 | |
1279 | 1279 | // Add filter SQL |
@@ -1289,12 +1289,12 @@ discard block |
||
1289 | 1289 | $sourceCol = $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
1290 | 1290 | $targetCol = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $this->class, $this->platform); |
1291 | 1291 | |
1292 | - $joinCondition[] = $this->getSQLTableAlias($association['sourceEntity'], $assocAlias) . '.' . $sourceCol . ' = ' |
|
1293 | - . $this->getSQLTableAlias($association['targetEntity']) . '.' . $targetCol; |
|
1292 | + $joinCondition[] = $this->getSQLTableAlias($association['sourceEntity'], $assocAlias).'.'.$sourceCol.' = ' |
|
1293 | + . $this->getSQLTableAlias($association['targetEntity']).'.'.$targetCol; |
|
1294 | 1294 | } |
1295 | 1295 | } |
1296 | 1296 | |
1297 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $joinTableName . ' ' . $joinTableAlias . ' ON '; |
|
1297 | + $this->currentPersisterContext->selectJoinSql .= ' '.$joinTableName.' '.$joinTableAlias.' ON '; |
|
1298 | 1298 | $this->currentPersisterContext->selectJoinSql .= implode(' AND ', $joinCondition); |
1299 | 1299 | } |
1300 | 1300 | |
@@ -1315,7 +1315,7 @@ discard block |
||
1315 | 1315 | */ |
1316 | 1316 | protected function getSelectColumnAssociationSQL($field, $assoc, ClassMetadata $class, $alias = 'r') |
1317 | 1317 | { |
1318 | - if ( ! ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE) ) { |
|
1318 | + if ( ! ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE)) { |
|
1319 | 1319 | return ''; |
1320 | 1320 | } |
1321 | 1321 | |
@@ -1364,10 +1364,10 @@ discard block |
||
1364 | 1364 | foreach ($joinColumns as $joinColumn) { |
1365 | 1365 | $quotedSourceColumn = $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
1366 | 1366 | $quotedTargetColumn = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $this->class, $this->platform); |
1367 | - $conditions[] = $sourceTableAlias . '.' . $quotedTargetColumn . ' = ' . $joinTableName . '.' . $quotedSourceColumn; |
|
1367 | + $conditions[] = $sourceTableAlias.'.'.$quotedTargetColumn.' = '.$joinTableName.'.'.$quotedSourceColumn; |
|
1368 | 1368 | } |
1369 | 1369 | |
1370 | - return ' INNER JOIN ' . $joinTableName . ' ON ' . implode(' AND ', $conditions); |
|
1370 | + return ' INNER JOIN '.$joinTableName.' ON '.implode(' AND ', $conditions); |
|
1371 | 1371 | } |
1372 | 1372 | |
1373 | 1373 | /** |
@@ -1446,7 +1446,7 @@ discard block |
||
1446 | 1446 | continue; |
1447 | 1447 | } |
1448 | 1448 | |
1449 | - if (! $this->class->isIdGeneratorIdentity() || $this->class->identifier[0] != $name) { |
|
1449 | + if ( ! $this->class->isIdGeneratorIdentity() || $this->class->identifier[0] != $name) { |
|
1450 | 1450 | $columns[] = $this->quoteStrategy->getColumnName($name, $this->class, $this->platform); |
1451 | 1451 | $this->columnTypes[$name] = $this->class->fieldMappings[$name]['type']; |
1452 | 1452 | } |
@@ -1467,7 +1467,7 @@ discard block |
||
1467 | 1467 | */ |
1468 | 1468 | protected function getSelectColumnSQL($field, ClassMetadata $class, $alias = 'r') |
1469 | 1469 | { |
1470 | - $root = $alias == 'r' ? '' : $alias ; |
|
1470 | + $root = $alias == 'r' ? '' : $alias; |
|
1471 | 1471 | $tableAlias = $this->getSQLTableAlias($class->name, $root); |
1472 | 1472 | $fieldMapping = $class->fieldMappings[$field]; |
1473 | 1473 | $sql = sprintf('%s.%s', $tableAlias, $this->quoteStrategy->getColumnName($field, $class, $this->platform)); |
@@ -1480,7 +1480,7 @@ discard block |
||
1480 | 1480 | $sql = $type->convertToPHPValueSQL($sql, $this->platform); |
1481 | 1481 | } |
1482 | 1482 | |
1483 | - return $sql . ' AS ' . $columnAlias; |
|
1483 | + return $sql.' AS '.$columnAlias; |
|
1484 | 1484 | } |
1485 | 1485 | |
1486 | 1486 | /** |
@@ -1496,14 +1496,14 @@ discard block |
||
1496 | 1496 | protected function getSQLTableAlias($className, $assocName = '') |
1497 | 1497 | { |
1498 | 1498 | if ($assocName) { |
1499 | - $className .= '#' . $assocName; |
|
1499 | + $className .= '#'.$assocName; |
|
1500 | 1500 | } |
1501 | 1501 | |
1502 | 1502 | if (isset($this->currentPersisterContext->sqlTableAliases[$className])) { |
1503 | 1503 | return $this->currentPersisterContext->sqlTableAliases[$className]; |
1504 | 1504 | } |
1505 | 1505 | |
1506 | - $tableAlias = 't' . $this->currentPersisterContext->sqlAliasCounter++; |
|
1506 | + $tableAlias = 't'.$this->currentPersisterContext->sqlAliasCounter++; |
|
1507 | 1507 | |
1508 | 1508 | $this->currentPersisterContext->sqlTableAliases[$className] = $tableAlias; |
1509 | 1509 | |
@@ -1530,7 +1530,7 @@ discard block |
||
1530 | 1530 | } |
1531 | 1531 | |
1532 | 1532 | $lock = $this->getLockTablesSql($lockMode); |
1533 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
|
1533 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : '').' '; |
|
1534 | 1534 | $sql = 'SELECT 1 ' |
1535 | 1535 | . $lock |
1536 | 1536 | . $where |
@@ -1552,7 +1552,7 @@ discard block |
||
1552 | 1552 | { |
1553 | 1553 | return $this->platform->appendLockHint( |
1554 | 1554 | 'FROM ' |
1555 | - . $this->quoteStrategy->getTableName($this->class, $this->platform) . ' ' |
|
1555 | + . $this->quoteStrategy->getTableName($this->class, $this->platform).' ' |
|
1556 | 1556 | . $this->getSQLTableAlias($this->class->name), |
1557 | 1557 | $lockMode |
1558 | 1558 | ); |
@@ -1604,19 +1604,19 @@ discard block |
||
1604 | 1604 | |
1605 | 1605 | if (null !== $comparison) { |
1606 | 1606 | // special case null value handling |
1607 | - if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null ===$value) { |
|
1608 | - $selectedColumns[] = $column . ' IS NULL'; |
|
1607 | + if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null === $value) { |
|
1608 | + $selectedColumns[] = $column.' IS NULL'; |
|
1609 | 1609 | |
1610 | 1610 | continue; |
1611 | 1611 | } |
1612 | 1612 | |
1613 | 1613 | if ($comparison === Comparison::NEQ && null === $value) { |
1614 | - $selectedColumns[] = $column . ' IS NOT NULL'; |
|
1614 | + $selectedColumns[] = $column.' IS NOT NULL'; |
|
1615 | 1615 | |
1616 | 1616 | continue; |
1617 | 1617 | } |
1618 | 1618 | |
1619 | - $selectedColumns[] = $column . ' ' . sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1619 | + $selectedColumns[] = $column.' '.sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1620 | 1620 | |
1621 | 1621 | continue; |
1622 | 1622 | } |
@@ -1664,7 +1664,7 @@ discard block |
||
1664 | 1664 | ? $this->class->fieldMappings[$field]['inherited'] |
1665 | 1665 | : $this->class->name; |
1666 | 1666 | |
1667 | - return [$this->getSQLTableAlias($className) . '.' . $this->quoteStrategy->getColumnName($field, $this->class, $this->platform)]; |
|
1667 | + return [$this->getSQLTableAlias($className).'.'.$this->quoteStrategy->getColumnName($field, $this->class, $this->platform)]; |
|
1668 | 1668 | } |
1669 | 1669 | |
1670 | 1670 | if (isset($this->class->associationMappings[$field])) { |
@@ -1685,7 +1685,7 @@ discard block |
||
1685 | 1685 | |
1686 | 1686 | |
1687 | 1687 | foreach ($joinColumns as $joinColumn) { |
1688 | - $columns[] = $joinTableName . '.' . $this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform); |
|
1688 | + $columns[] = $joinTableName.'.'.$this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform); |
|
1689 | 1689 | } |
1690 | 1690 | |
1691 | 1691 | } else { |
@@ -1693,12 +1693,12 @@ discard block |
||
1693 | 1693 | throw ORMException::invalidFindByInverseAssociation($this->class->name, $field); |
1694 | 1694 | } |
1695 | 1695 | |
1696 | - $className = (isset($association['inherited'])) |
|
1696 | + $className = (isset($association['inherited'])) |
|
1697 | 1697 | ? $association['inherited'] |
1698 | 1698 | : $this->class->name; |
1699 | 1699 | |
1700 | 1700 | foreach ($association['joinColumns'] as $joinColumn) { |
1701 | - $columns[] = $this->getSQLTableAlias($className) . '.' . $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
|
1701 | + $columns[] = $this->getSQLTableAlias($className).'.'.$this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
|
1702 | 1702 | } |
1703 | 1703 | } |
1704 | 1704 | return $columns; |
@@ -1790,7 +1790,7 @@ discard block |
||
1790 | 1790 | $value = $value[$this->em->getClassMetadata($sourceClass->associationMappings[$field]['targetEntity'])->identifier[0]]; |
1791 | 1791 | } |
1792 | 1792 | |
1793 | - $criteria[$tableAlias . "." . $targetKeyColumn] = $value; |
|
1793 | + $criteria[$tableAlias.".".$targetKeyColumn] = $value; |
|
1794 | 1794 | $parameters[] = [ |
1795 | 1795 | 'value' => $value, |
1796 | 1796 | 'field' => $field, |
@@ -1803,7 +1803,7 @@ discard block |
||
1803 | 1803 | $field = $sourceClass->fieldNames[$sourceKeyColumn]; |
1804 | 1804 | $value = $sourceClass->reflFields[$field]->getValue($sourceEntity); |
1805 | 1805 | |
1806 | - $criteria[$tableAlias . "." . $targetKeyColumn] = $value; |
|
1806 | + $criteria[$tableAlias.".".$targetKeyColumn] = $value; |
|
1807 | 1807 | $parameters[] = [ |
1808 | 1808 | 'value' => $value, |
1809 | 1809 | 'field' => $field, |
@@ -1891,7 +1891,7 @@ discard block |
||
1891 | 1891 | $assoc = $class->associationMappings[$field]; |
1892 | 1892 | $class = $this->em->getClassMetadata($assoc['targetEntity']); |
1893 | 1893 | |
1894 | - if (! $assoc['isOwningSide']) { |
|
1894 | + if ( ! $assoc['isOwningSide']) { |
|
1895 | 1895 | $assoc = $class->associationMappings[$assoc['mappedBy']]; |
1896 | 1896 | $class = $this->em->getClassMetadata($assoc['targetEntity']); |
1897 | 1897 | } |
@@ -1900,7 +1900,7 @@ discard block |
||
1900 | 1900 | ? $assoc['relationToTargetKeyColumns'] |
1901 | 1901 | : $assoc['sourceToTargetKeyColumns']; |
1902 | 1902 | |
1903 | - foreach ($columns as $column){ |
|
1903 | + foreach ($columns as $column) { |
|
1904 | 1904 | $types[] = PersisterHelper::getTypeOfColumn($column, $class, $this->em); |
1905 | 1905 | } |
1906 | 1906 | break; |
@@ -1911,7 +1911,7 @@ discard block |
||
1911 | 1911 | } |
1912 | 1912 | |
1913 | 1913 | if (is_array($value)) { |
1914 | - return array_map(function ($type) { |
|
1914 | + return array_map(function($type) { |
|
1915 | 1915 | $type = Type::getType($type); |
1916 | 1916 | |
1917 | 1917 | return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET; |
@@ -1987,12 +1987,12 @@ discard block |
||
1987 | 1987 | |
1988 | 1988 | $sql = 'SELECT 1 ' |
1989 | 1989 | . $this->getLockTablesSql(null) |
1990 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
1990 | + . ' WHERE '.$this->getSelectConditionSQL($criteria); |
|
1991 | 1991 | |
1992 | 1992 | list($params, $types) = $this->expandParameters($criteria); |
1993 | 1993 | |
1994 | 1994 | if (null !== $extraConditions) { |
1995 | - $sql .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions); |
|
1995 | + $sql .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions); |
|
1996 | 1996 | list($criteriaParams, $criteriaTypes) = $this->expandCriteriaParameters($extraConditions); |
1997 | 1997 | |
1998 | 1998 | $params = array_merge($params, $criteriaParams); |
@@ -2000,7 +2000,7 @@ discard block |
||
2000 | 2000 | } |
2001 | 2001 | |
2002 | 2002 | if ($filterSql = $this->generateFilterConditionSQL($this->class, $alias)) { |
2003 | - $sql .= ' AND ' . $filterSql; |
|
2003 | + $sql .= ' AND '.$filterSql; |
|
2004 | 2004 | } |
2005 | 2005 | |
2006 | 2006 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
@@ -2047,13 +2047,13 @@ discard block |
||
2047 | 2047 | |
2048 | 2048 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
2049 | 2049 | if ('' !== $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { |
2050 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
2050 | + $filterClauses[] = '('.$filterExpr.')'; |
|
2051 | 2051 | } |
2052 | 2052 | } |
2053 | 2053 | |
2054 | 2054 | $sql = implode(' AND ', $filterClauses); |
2055 | 2055 | |
2056 | - return $sql ? "(" . $sql . ")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2056 | + return $sql ? "(".$sql.")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2057 | 2057 | } |
2058 | 2058 | |
2059 | 2059 | /** |
@@ -2083,7 +2083,7 @@ discard block |
||
2083 | 2083 | $entityManager = $this->em; |
2084 | 2084 | |
2085 | 2085 | return array_map( |
2086 | - static function ($fieldName) use ($class, $entityManager) : string { |
|
2086 | + static function($fieldName) use ($class, $entityManager) : string { |
|
2087 | 2087 | $types = PersisterHelper::getTypeOfField($fieldName, $class, $entityManager); |
2088 | 2088 | assert(isset($types[0])); |
2089 | 2089 |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | { |
22 | 22 | parent::setUp(); |
23 | 23 | |
24 | - if (! DBALType::hasType(GH5988CustomIdObjectHashType::class)) { |
|
24 | + if ( ! DBALType::hasType(GH5988CustomIdObjectHashType::class)) { |
|
25 | 25 | DBALType::addType(GH5988CustomIdObjectHashType::class, GH5988CustomIdObjectHashType::class); |
26 | 26 | } |
27 | 27 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function convertToDatabaseValue($value, AbstractPlatform $platform) |
56 | 56 | { |
57 | - return $value->id . '_test'; |
|
57 | + return $value->id.'_test'; |
|
58 | 58 | } |
59 | 59 | /** |
60 | 60 | * {@inheritdoc} |