Completed
Pull Request — 2.6 (#7785)
by Michele
08:08
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   +15 added lines, -16 removed lines patch added patch discarded remove patch
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
         if ($token === null) {
472 472
             $token = $this->lexer->lookahead;
473 473
             if ($token === null) {
474
-                $token  = [
474
+                $token = [
475 475
                     'position' => null,
476 476
                 ];
477 477
             }
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
         $tokenStr = substr($dql, $token['position'], $length);
492 492
 
493 493
         // Building informative message
494
-        $message = 'line 0, col ' . $tokenPos . " near '" . $tokenStr . "': Error: " . $message;
494
+        $message = 'line 0, col '.$tokenPos." near '".$tokenStr."': Error: ".$message;
495 495
 
496 496
         throw QueryException::semanticalError($message, QueryException::dqlError($this->query->getDQL()));
497 497
     }
@@ -638,7 +638,7 @@  discard block
 block discarded – undo
638 638
             // If the namespace is not given then assumes the first FROM entity namespace
639 639
             if (strpos($className, '\\') === false && ! class_exists($className) && strpos($fromClassName, '\\') !== false) {
640 640
                 $namespace  = substr($fromClassName, 0, strrpos($fromClassName, '\\'));
641
-                $fqcn       = $namespace . '\\' . $className;
641
+                $fqcn       = $namespace.'\\'.$className;
642 642
 
643 643
                 if (class_exists($fqcn)) {
644 644
                     $expression->className  = $fqcn;
@@ -690,13 +690,13 @@  discard block
 block discarded – undo
690 690
                 }
691 691
 
692 692
                 $this->semanticalError(
693
-                    "There is no mapped field named '$field' on class " . $class->name . ".", $deferredItem['token']
693
+                    "There is no mapped field named '$field' on class ".$class->name.".", $deferredItem['token']
694 694
                 );
695 695
             }
696 696
 
697 697
             if (array_intersect($class->identifier, $expr->partialFieldSet) != $class->identifier) {
698 698
                 $this->semanticalError(
699
-                    "The partial field selection of class " . $class->name . " must contain the identifier.",
699
+                    "The partial field selection of class ".$class->name." must contain the identifier.",
700 700
                     $deferredItem['token']
701 701
                 );
702 702
             }
@@ -765,7 +765,7 @@  discard block
 block discarded – undo
765 765
             // Check if field or association exists
766 766
             if ( ! isset($class->associationMappings[$field]) && ! isset($class->fieldMappings[$field])) {
767 767
                 $this->semanticalError(
768
-                    'Class ' . $class->name . ' has no field or association named ' . $field,
768
+                    'Class '.$class->name.' has no field or association named '.$field,
769 769
                     $deferredItem['token']
770 770
                 );
771 771
             }
@@ -805,8 +805,8 @@  discard block
 block discarded – undo
805 805
                 // Build the error message
806 806
                 $semanticalError  = 'Invalid PathExpression. ';
807 807
                 $semanticalError .= (count($expectedStringTypes) == 1)
808
-                    ? 'Must be a ' . $expectedStringTypes[0] . '.'
809
-                    : implode(' or ', $expectedStringTypes) . ' expected.';
808
+                    ? 'Must be a '.$expectedStringTypes[0].'.'
809
+                    : implode(' or ', $expectedStringTypes).' expected.';
810 810
 
811 811
                 $this->semanticalError($semanticalError, $deferredItem['token']);
812 812
             }
@@ -848,8 +848,7 @@  discard block
 block discarded – undo
848 848
         $this->lexer->moveNext();
849 849
 
850 850
         switch ($this->lexer->lookahead === null ? null : $this->lexer->lookahead['type']) {
851
-            case Lexer::T_SELECT:
852
-                $statement = $this->SelectStatement();
851
+            case Lexer::T_SELECT : $statement = $this->SelectStatement();
853 852
                 break;
854 853
 
855 854
             case Lexer::T_UPDATE:
@@ -980,7 +979,7 @@  discard block
 block discarded – undo
980 979
 
981 980
         [$namespaceAlias, $simpleClassName] = explode(':', $this->lexer->token['value']);
982 981
 
983
-        return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName;
982
+        return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias).'\\'.$simpleClassName;
984 983
     }
985 984
 
986 985
     /**
@@ -992,7 +991,7 @@  discard block
 block discarded – undo
992 991
      */
993 992
     private function validateAbstractSchemaName($schemaName)
994 993
     {
995
-        if (! (class_exists($schemaName, true) || interface_exists($schemaName, true))) {
994
+        if ( ! (class_exists($schemaName, true) || interface_exists($schemaName, true))) {
996 995
             $this->semanticalError("Class '$schemaName' is not defined.", $this->lexer->token);
997 996
         }
998 997
     }
@@ -1048,7 +1047,7 @@  discard block
 block discarded – undo
1048 1047
 
1049 1048
         if ( ! isset($this->queryComponents[$identVariable])) {
1050 1049
             $this->semanticalError(
1051
-                'Identification Variable ' . $identVariable .' used in join path expression but was not defined before.'
1050
+                'Identification Variable '.$identVariable.' used in join path expression but was not defined before.'
1052 1051
             );
1053 1052
         }
1054 1053
 
@@ -1062,7 +1061,7 @@  discard block
 block discarded – undo
1062 1061
         $class = $qComp['metadata'];
1063 1062
 
1064 1063
         if ( ! $class->hasAssociation($field)) {
1065
-            $this->semanticalError('Class ' . $class->name . ' has no association named ' . $field);
1064
+            $this->semanticalError('Class '.$class->name.' has no association named '.$field);
1066 1065
         }
1067 1066
 
1068 1067
         return new AST\JoinAssociationPathExpression($identVariable, $field);
@@ -2485,7 +2484,7 @@  discard block
 block discarded – undo
2485 2484
         $peek = $this->peekBeyondClosingParenthesis();
2486 2485
 
2487 2486
         if ($peek !== null) {
2488
-            if (in_array($peek['value'], ["=",  "<", "<=", "<>", ">", ">=", "!="]) ||
2487
+            if (in_array($peek['value'], ["=", "<", "<=", "<>", ">", ">=", "!="]) ||
2489 2488
                 in_array($peek['type'], [Lexer::T_NOT, Lexer::T_BETWEEN, Lexer::T_LIKE, Lexer::T_IN, Lexer::T_IS, Lexer::T_EXISTS]) ||
2490 2489
                 $this->isMathOperator($peek)) {
2491 2490
                 $condPrimary->simpleConditionalExpression = $this->SimpleConditionalExpression();
@@ -2591,7 +2590,7 @@  discard block
 block discarded – undo
2591 2590
             return $this->NullComparisonExpression();
2592 2591
         }
2593 2592
 
2594
-        if ($token['type'] === Lexer::T_IS  && $lookahead['type'] === Lexer::T_EMPTY) {
2593
+        if ($token['type'] === Lexer::T_IS && $lookahead['type'] === Lexer::T_EMPTY) {
2595 2594
             return $this->EmptyCollectionComparisonExpression();
2596 2595
         }
2597 2596
 
Please login to merge, or discard this patch.