Failed Conditions
Pull Request — 2.6 (#7785)
by Michele
07:10
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   +14 added lines, -15 removed lines patch added patch discarded remove patch
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
         $tokenStr = substr($dql, $token['position'], $length);
487 487
 
488 488
         // Building informative message
489
-        $message = 'line 0, col ' . $tokenPos . " near '" . $tokenStr . "': Error: " . $message;
489
+        $message = 'line 0, col '.$tokenPos." near '".$tokenStr."': Error: ".$message;
490 490
 
491 491
         throw QueryException::semanticalError($message, QueryException::dqlError($this->query->getDQL()));
492 492
     }
@@ -633,7 +633,7 @@  discard block
 block discarded – undo
633 633
             // If the namespace is not given then assumes the first FROM entity namespace
634 634
             if (strpos($className, '\\') === false && ! class_exists($className) && strpos($fromClassName, '\\') !== false) {
635 635
                 $namespace  = substr($fromClassName, 0, strrpos($fromClassName, '\\'));
636
-                $fqcn       = $namespace . '\\' . $className;
636
+                $fqcn       = $namespace.'\\'.$className;
637 637
 
638 638
                 if (class_exists($fqcn)) {
639 639
                     $expression->className  = $fqcn;
@@ -685,13 +685,13 @@  discard block
 block discarded – undo
685 685
                 }
686 686
 
687 687
                 $this->semanticalError(
688
-                    "There is no mapped field named '$field' on class " . $class->name . ".", $deferredItem['token']
688
+                    "There is no mapped field named '$field' on class ".$class->name.".", $deferredItem['token']
689 689
                 );
690 690
             }
691 691
 
692 692
             if (array_intersect($class->identifier, $expr->partialFieldSet) != $class->identifier) {
693 693
                 $this->semanticalError(
694
-                    "The partial field selection of class " . $class->name . " must contain the identifier.",
694
+                    "The partial field selection of class ".$class->name." must contain the identifier.",
695 695
                     $deferredItem['token']
696 696
                 );
697 697
             }
@@ -760,7 +760,7 @@  discard block
 block discarded – undo
760 760
             // Check if field or association exists
761 761
             if ( ! isset($class->associationMappings[$field]) && ! isset($class->fieldMappings[$field])) {
762 762
                 $this->semanticalError(
763
-                    'Class ' . $class->name . ' has no field or association named ' . $field,
763
+                    'Class '.$class->name.' has no field or association named '.$field,
764 764
                     $deferredItem['token']
765 765
                 );
766 766
             }
@@ -800,8 +800,8 @@  discard block
 block discarded – undo
800 800
                 // Build the error message
801 801
                 $semanticalError  = 'Invalid PathExpression. ';
802 802
                 $semanticalError .= (count($expectedStringTypes) == 1)
803
-                    ? 'Must be a ' . $expectedStringTypes[0] . '.'
804
-                    : implode(' or ', $expectedStringTypes) . ' expected.';
803
+                    ? 'Must be a '.$expectedStringTypes[0].'.'
804
+                    : implode(' or ', $expectedStringTypes).' expected.';
805 805
 
806 806
                 $this->semanticalError($semanticalError, $deferredItem['token']);
807 807
             }
@@ -843,8 +843,7 @@  discard block
 block discarded – undo
843 843
         $this->lexer->moveNext();
844 844
 
845 845
         switch ($this->lexer->lookahead === null ? null : $this->lexer->lookahead['type']) {
846
-            case Lexer::T_SELECT:
847
-                $statement = $this->SelectStatement();
846
+            case Lexer::T_SELECT : $statement = $this->SelectStatement();
848 847
                 break;
849 848
 
850 849
             case Lexer::T_UPDATE:
@@ -975,7 +974,7 @@  discard block
 block discarded – undo
975 974
 
976 975
         [$namespaceAlias, $simpleClassName] = explode(':', $this->lexer->token['value']);
977 976
 
978
-        return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName;
977
+        return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias).'\\'.$simpleClassName;
979 978
     }
980 979
 
981 980
     /**
@@ -987,7 +986,7 @@  discard block
 block discarded – undo
987 986
      */
988 987
     private function validateAbstractSchemaName($schemaName)
989 988
     {
990
-        if (! (class_exists($schemaName, true) || interface_exists($schemaName, true))) {
989
+        if ( ! (class_exists($schemaName, true) || interface_exists($schemaName, true))) {
991 990
             $this->semanticalError("Class '$schemaName' is not defined.", $this->lexer->token);
992 991
         }
993 992
     }
@@ -1043,7 +1042,7 @@  discard block
 block discarded – undo
1043 1042
 
1044 1043
         if ( ! isset($this->queryComponents[$identVariable])) {
1045 1044
             $this->semanticalError(
1046
-                'Identification Variable ' . $identVariable .' used in join path expression but was not defined before.'
1045
+                'Identification Variable '.$identVariable.' used in join path expression but was not defined before.'
1047 1046
             );
1048 1047
         }
1049 1048
 
@@ -1057,7 +1056,7 @@  discard block
 block discarded – undo
1057 1056
         $class = $qComp['metadata'];
1058 1057
 
1059 1058
         if ( ! $class->hasAssociation($field)) {
1060
-            $this->semanticalError('Class ' . $class->name . ' has no association named ' . $field);
1059
+            $this->semanticalError('Class '.$class->name.' has no association named '.$field);
1061 1060
         }
1062 1061
 
1063 1062
         return new AST\JoinAssociationPathExpression($identVariable, $field);
@@ -2480,7 +2479,7 @@  discard block
 block discarded – undo
2480 2479
         $peek = $this->peekBeyondClosingParenthesis();
2481 2480
 
2482 2481
         if ($peek !== null) {
2483
-            if (in_array($peek['value'], ["=",  "<", "<=", "<>", ">", ">=", "!="]) ||
2482
+            if (in_array($peek['value'], ["=", "<", "<=", "<>", ">", ">=", "!="]) ||
2484 2483
                 in_array($peek['type'], [Lexer::T_NOT, Lexer::T_BETWEEN, Lexer::T_LIKE, Lexer::T_IN, Lexer::T_IS, Lexer::T_EXISTS]) ||
2485 2484
                 $this->isMathOperator($peek)) {
2486 2485
                 $condPrimary->simpleConditionalExpression = $this->SimpleConditionalExpression();
@@ -2586,7 +2585,7 @@  discard block
 block discarded – undo
2586 2585
             return $this->NullComparisonExpression();
2587 2586
         }
2588 2587
 
2589
-        if ($token['type'] === Lexer::T_IS  && $lookahead['type'] === Lexer::T_EMPTY) {
2588
+        if ($token['type'] === Lexer::T_IS && $lookahead['type'] === Lexer::T_EMPTY) {
2590 2589
             return $this->EmptyCollectionComparisonExpression();
2591 2590
         }
2592 2591
 
Please login to merge, or discard this patch.