Failed Conditions
Pull Request — 2.6 (#7785)
by Michele
07:39
created
lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Query/Parser.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/PersistentCollection.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.