@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | */ |
106 | 106 | protected function onNotFoundMetadata($className) |
107 | 107 | { |
108 | - if (! $this->evm->hasListeners(Events::onClassMetadataNotFound)) { |
|
108 | + if ( ! $this->evm->hasListeners(Events::onClassMetadataNotFound)) { |
|
109 | 109 | return; |
110 | 110 | } |
111 | 111 | |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | $this->completeIdGeneratorMapping($class); |
163 | 163 | } |
164 | 164 | |
165 | - if (!$class->isMappedSuperclass) { |
|
165 | + if ( ! $class->isMappedSuperclass) { |
|
166 | 166 | foreach ($class->embeddedClasses as $property => $embeddableClass) { |
167 | 167 | |
168 | 168 | if (isset($embeddableClass['inherited'])) { |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | |
188 | 188 | $identifier = $embeddableMetadata->getIdentifier(); |
189 | 189 | |
190 | - if (! empty($identifier)) { |
|
190 | + if ( ! empty($identifier)) { |
|
191 | 191 | $this->inheritIdGeneratorMapping($class, $embeddableMetadata); |
192 | 192 | } |
193 | 193 | |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | */ |
258 | 258 | protected function validateRuntimeMetadata($class, $parent) |
259 | 259 | { |
260 | - if ( ! $class->reflClass ) { |
|
260 | + if ( ! $class->reflClass) { |
|
261 | 261 | // only validate if there is a reflection class instance |
262 | 262 | return; |
263 | 263 | } |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | $class->validateLifecycleCallbacks($this->getReflectionService()); |
268 | 268 | |
269 | 269 | // verify inheritance |
270 | - if ( ! $class->isMappedSuperclass && !$class->isInheritanceTypeNone()) { |
|
270 | + if ( ! $class->isMappedSuperclass && ! $class->isInheritanceTypeNone()) { |
|
271 | 271 | if ( ! $parent) { |
272 | 272 | if (count($class->discriminatorMap) == 0) { |
273 | 273 | throw MappingException::missingDiscriminatorMap($class->name); |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | { |
429 | 429 | foreach ($parentClass->associationMappings as $field => $mapping) { |
430 | 430 | if ($parentClass->isMappedSuperclass) { |
431 | - if ($mapping['type'] & ClassMetadata::TO_MANY && !$mapping['isOwningSide']) { |
|
431 | + if ($mapping['type'] & ClassMetadata::TO_MANY && ! $mapping['isOwningSide']) { |
|
432 | 432 | throw MappingException::illegalToManyAssociationOnMappedSuperclass($parentClass->name, $field); |
433 | 433 | } |
434 | 434 | $mapping['sourceEntity'] = $subClass->name; |
@@ -477,11 +477,11 @@ discard block |
||
477 | 477 | |
478 | 478 | $parentClass->mapEmbedded( |
479 | 479 | [ |
480 | - 'fieldName' => $prefix . '.' . $property, |
|
480 | + 'fieldName' => $prefix.'.'.$property, |
|
481 | 481 | 'class' => $embeddableMetadata->name, |
482 | 482 | 'columnPrefix' => $embeddableClass['columnPrefix'], |
483 | 483 | 'declaredField' => $embeddableClass['declaredField'] |
484 | - ? $prefix . '.' . $embeddableClass['declaredField'] |
|
484 | + ? $prefix.'.'.$embeddableClass['declaredField'] |
|
485 | 485 | : $prefix, |
486 | 486 | 'originalField' => $embeddableClass['originalField'] ?: $property, |
487 | 487 | ] |
@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | */ |
500 | 500 | private function addInheritedIndexes(ClassMetadata $subClass, ClassMetadata $parentClass) |
501 | 501 | { |
502 | - if (! $parentClass->isMappedSuperclass) { |
|
502 | + if ( ! $parentClass->isMappedSuperclass) { |
|
503 | 503 | return; |
504 | 504 | } |
505 | 505 | |
@@ -707,14 +707,14 @@ discard block |
||
707 | 707 | throw new ORMException("Can't instantiate custom generator : no custom generator definition"); |
708 | 708 | } |
709 | 709 | if ( ! class_exists($definition['class'])) { |
710 | - throw new ORMException("Can't instantiate custom generator : " . |
|
710 | + throw new ORMException("Can't instantiate custom generator : ". |
|
711 | 711 | $definition['class']); |
712 | 712 | } |
713 | 713 | $class->setIdGenerator(new $definition['class']); |
714 | 714 | break; |
715 | 715 | |
716 | 716 | default: |
717 | - throw new ORMException("Unknown generator type: " . $class->generatorType); |
|
717 | + throw new ORMException("Unknown generator type: ".$class->generatorType); |
|
718 | 718 | } |
719 | 719 | } |
720 | 720 | |
@@ -764,7 +764,7 @@ discard block |
||
764 | 764 | */ |
765 | 765 | protected function getFqcnFromAlias($namespaceAlias, $simpleClassName) |
766 | 766 | { |
767 | - return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName; |
|
767 | + return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias).'\\'.$simpleClassName; |
|
768 | 768 | } |
769 | 769 | |
770 | 770 | /** |
@@ -788,7 +788,7 @@ discard block |
||
788 | 788 | */ |
789 | 789 | private function getTargetPlatform() |
790 | 790 | { |
791 | - if (!$this->targetPlatform) { |
|
791 | + if ( ! $this->targetPlatform) { |
|
792 | 792 | $this->targetPlatform = $this->em->getConnection()->getDatabasePlatform(); |
793 | 793 | } |
794 | 794 |
@@ -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 |