Failed Conditions
Pull Request — master (#7297)
by Gabriel
11:55
created
lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
         $classMetadata = $this->em->getClassMetadata($class);
124 124
         $platform      = $this->em->getConnection()->getDatabasePlatform();
125 125
 
126
-        if (! $this->isInheritanceSupported($classMetadata)) {
126
+        if ( ! $this->isInheritanceSupported($classMetadata)) {
127 127
             throw new \InvalidArgumentException(
128 128
                 'ResultSetMapping builder does not currently support your inheritance scheme.'
129 129
             );
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
                             );
164 164
                         }
165 165
 
166
-                        if (! $joinColumn->getType()) {
166
+                        if ( ! $joinColumn->getType()) {
167 167
                             $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
168 168
                         }
169 169
 
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
     {
203 203
         switch ($mode) {
204 204
             case self::COLUMN_RENAMING_INCREMENT:
205
-                return $columnName . $this->sqlCounter++;
205
+                return $columnName.$this->sqlCounter++;
206 206
 
207 207
             case self::COLUMN_RENAMING_CUSTOM:
208 208
                 return $customRenameColumns[$columnName] ?? $columnName;
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
                 $sql .= ', ';
234 234
             }
235 235
 
236
-            $sql .= $tableAlias . '.';
236
+            $sql .= $tableAlias.'.';
237 237
 
238 238
             if (isset($this->fieldMappings[$columnName])) {
239 239
                 $class = $this->em->getClassMetadata($this->declaringClasses[$columnName]);
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
                 $sql .= $this->discriminatorColumns[$dqlAlias];
246 246
             }
247 247
 
248
-            $sql .= ' AS ' . $columnName;
248
+            $sql .= ' AS '.$columnName;
249 249
         }
250 250
 
251 251
         return $sql;
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Query/ResultSetMapping.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
         $found = false;
223 223
 
224 224
         foreach (array_merge($this->metaMappings, $this->fieldMappings) as $columnName => $columnFieldName) {
225
-            if (! ($columnFieldName === $fieldName && $this->columnOwnerMap[$columnName] === $alias)) {
225
+            if ( ! ($columnFieldName === $fieldName && $this->columnOwnerMap[$columnName] === $alias)) {
226 226
                 continue;
227 227
             }
228 228
 
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
         // field name => class name of declaring class
332 332
         $this->declaringClasses[$columnName] = $declaringClass ?: $this->aliasMap[$alias];
333 333
 
334
-        if (! $this->isMixed && $this->scalarMappings) {
334
+        if ( ! $this->isMixed && $this->scalarMappings) {
335 335
             $this->isMixed = true;
336 336
         }
337 337
 
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
         $this->scalarMappings[$columnName] = $alias;
377 377
         $this->typeMappings[$columnName]   = $type;
378 378
 
379
-        if (! $this->isMixed && $this->fieldMappings) {
379
+        if ( ! $this->isMixed && $this->fieldMappings) {
380 380
             $this->isMixed = true;
381 381
         }
382 382
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Query/Parser.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
         }
396 396
 
397 397
         foreach ($this->queryComponents as $dqlAlias => $qComp) {
398
-            if (! isset($this->identVariableExpressions[$dqlAlias])) {
398
+            if ( ! isset($this->identVariableExpressions[$dqlAlias])) {
399 399
                 continue;
400 400
             }
401 401
 
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
         $tokenStr = substr($dql, (int) $token['position'], $length);
460 460
 
461 461
         // Building informative message
462
-        $message = 'line 0, col ' . $tokenPos . " near '" . $tokenStr . "': Error: " . $message;
462
+        $message = 'line 0, col '.$tokenPos." near '".$tokenStr."': Error: ".$message;
463 463
 
464 464
         throw QueryException::semanticalError(
465 465
             $message,
@@ -562,7 +562,7 @@  discard block
 block discarded – undo
562 562
             $identVariable = $deferredItem['expression'];
563 563
 
564 564
             // Check if IdentificationVariable exists in queryComponents
565
-            if (! isset($this->queryComponents[$identVariable])) {
565
+            if ( ! isset($this->queryComponents[$identVariable])) {
566 566
                 $this->semanticalError(
567 567
                     sprintf("'%s' is not defined.", $identVariable),
568 568
                     $deferredItem['token']
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
             $qComp = $this->queryComponents[$identVariable];
573 573
 
574 574
             // Check if queryComponent points to an AbstractSchemaName or a ResultVariable
575
-            if (! isset($qComp['metadata'])) {
575
+            if ( ! isset($qComp['metadata'])) {
576 576
                 $this->semanticalError(
577 577
                     sprintf("'%s' does not point to a Class.", $identVariable),
578 578
                     $deferredItem['token']
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
             // If the namespace is not given then assumes the first FROM entity namespace
607 607
             if (strpos($className, '\\') === false && ! class_exists($className) && strpos($fromClassName, '\\') !== false) {
608 608
                 $namespace = substr($fromClassName, 0, strrpos($fromClassName, '\\'));
609
-                $fqcn      = $namespace . '\\' . $className;
609
+                $fqcn      = $namespace.'\\'.$className;
610 610
 
611 611
                 if (class_exists($fqcn)) {
612 612
                     $expression->className = $fqcn;
@@ -614,13 +614,13 @@  discard block
 block discarded – undo
614 614
                 }
615 615
             }
616 616
 
617
-            if (! class_exists($className)) {
617
+            if ( ! class_exists($className)) {
618 618
                 $this->semanticalError(sprintf('Class "%s" is not defined.', $className), $token);
619 619
             }
620 620
 
621 621
             $class = new \ReflectionClass($className);
622 622
 
623
-            if (! $class->isInstantiable()) {
623
+            if ( ! $class->isInstantiable()) {
624 624
                 $this->semanticalError(sprintf('Class "%s" can not be instantiated.', $className), $token);
625 625
             }
626 626
 
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
             $resultVariable = $deferredItem['expression'];
678 678
 
679 679
             // Check if ResultVariable exists in queryComponents
680
-            if (! isset($this->queryComponents[$resultVariable])) {
680
+            if ( ! isset($this->queryComponents[$resultVariable])) {
681 681
                 $this->semanticalError(
682 682
                     sprintf("'%s' is not defined.", $resultVariable),
683 683
                     $deferredItem['token']
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
             $qComp = $this->queryComponents[$resultVariable];
688 688
 
689 689
             // Check if queryComponent points to an AbstractSchemaName or a ResultVariable
690
-            if (! isset($qComp['resultVariable'])) {
690
+            if ( ! isset($qComp['resultVariable'])) {
691 691
                 $this->semanticalError(
692 692
                     sprintf("'%s' does not point to a ResultVariable.", $resultVariable),
693 693
                     $deferredItem['token']
@@ -729,9 +729,9 @@  discard block
 block discarded – undo
729 729
             $property = $class->getProperty($field);
730 730
 
731 731
             // Check if field or association exists
732
-            if (! $property) {
732
+            if ( ! $property) {
733 733
                 $this->semanticalError(
734
-                    'Class ' . $class->getClassName() . ' has no field or association named ' . $field,
734
+                    'Class '.$class->getClassName().' has no field or association named '.$field,
735 735
                     $deferredItem['token']
736 736
                 );
737 737
             }
@@ -748,7 +748,7 @@  discard block
 block discarded – undo
748 748
             // Validate if PathExpression is one of the expected types
749 749
             $expectedType = $pathExpression->expectedType;
750 750
 
751
-            if (! ($expectedType & $fieldType)) {
751
+            if ( ! ($expectedType & $fieldType)) {
752 752
                 // We need to recognize which was expected type(s)
753 753
                 $expectedStringTypes = [];
754 754
 
@@ -770,8 +770,8 @@  discard block
 block discarded – undo
770 770
                 // Build the error message
771 771
                 $semanticalError  = 'Invalid PathExpression. ';
772 772
                 $semanticalError .= count($expectedStringTypes) === 1
773
-                    ? 'Must be a ' . $expectedStringTypes[0] . '.'
774
-                    : implode(' or ', $expectedStringTypes) . ' expected.';
773
+                    ? 'Must be a '.$expectedStringTypes[0].'.'
774
+                    : implode(' or ', $expectedStringTypes).' expected.';
775 775
 
776 776
                 $this->semanticalError($semanticalError, $deferredItem['token']);
777 777
             }
@@ -783,7 +783,7 @@  discard block
 block discarded – undo
783 783
 
784 784
     private function processRootEntityAliasSelected()
785 785
     {
786
-        if (! $this->identVariableExpressions) {
786
+        if ( ! $this->identVariableExpressions) {
787 787
             return;
788 788
         }
789 789
 
@@ -940,7 +940,7 @@  discard block
 block discarded – undo
940 940
 
941 941
         [$namespaceAlias, $simpleClassName] = explode(':', $this->lexer->token['value']);
942 942
 
943
-        return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName;
943
+        return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias).'\\'.$simpleClassName;
944 944
     }
945 945
 
946 946
     /**
@@ -1019,9 +1019,9 @@  discard block
 block discarded – undo
1019 1019
     {
1020 1020
         $identVariable = $this->IdentificationVariable();
1021 1021
 
1022
-        if (! isset($this->queryComponents[$identVariable])) {
1022
+        if ( ! isset($this->queryComponents[$identVariable])) {
1023 1023
             $this->semanticalError(
1024
-                'Identification Variable ' . $identVariable . ' used in join path expression but was not defined before.'
1024
+                'Identification Variable '.$identVariable.' used in join path expression but was not defined before.'
1025 1025
             );
1026 1026
         }
1027 1027
 
@@ -1035,8 +1035,8 @@  discard block
 block discarded – undo
1035 1035
         $class    = $qComp['metadata'];
1036 1036
         $property = $class->getProperty($field);
1037 1037
 
1038
-        if (! ($property !== null && $property instanceof AssociationMetadata)) {
1039
-            $this->semanticalError('Class ' . $class->getClassName() . ' has no association named ' . $field);
1038
+        if ( ! ($property !== null && $property instanceof AssociationMetadata)) {
1039
+            $this->semanticalError('Class '.$class->getClassName().' has no association named '.$field);
1040 1040
         }
1041 1041
 
1042 1042
         return new AST\JoinAssociationPathExpression($identVariable, $field);
@@ -1066,7 +1066,7 @@  discard block
 block discarded – undo
1066 1066
             while ($this->lexer->isNextToken(Lexer::T_DOT)) {
1067 1067
                 $this->match(Lexer::T_DOT);
1068 1068
                 $this->match(Lexer::T_IDENTIFIER);
1069
-                $field .= '.' . $this->lexer->token['value'];
1069
+                $field .= '.'.$this->lexer->token['value'];
1070 1070
             }
1071 1071
         }
1072 1072
 
@@ -1450,7 +1450,7 @@  discard block
 block discarded – undo
1450 1450
         // Still need to decide between IdentificationVariable or ResultVariable
1451 1451
         $lookaheadValue = $this->lexer->lookahead['value'];
1452 1452
 
1453
-        if (! isset($this->queryComponents[$lookaheadValue])) {
1453
+        if ( ! isset($this->queryComponents[$lookaheadValue])) {
1454 1454
             $this->semanticalError('Cannot group by undefined identification or result variable.');
1455 1455
         }
1456 1456
 
@@ -1798,7 +1798,7 @@  discard block
 block discarded – undo
1798 1798
         while ($this->lexer->isNextToken(Lexer::T_DOT)) {
1799 1799
             $this->match(Lexer::T_DOT);
1800 1800
             $this->match(Lexer::T_IDENTIFIER);
1801
-            $field .= '.' . $this->lexer->token['value'];
1801
+            $field .= '.'.$this->lexer->token['value'];
1802 1802
         }
1803 1803
 
1804 1804
         $partialFieldSet[] = $field;
@@ -1812,7 +1812,7 @@  discard block
 block discarded – undo
1812 1812
             while ($this->lexer->isNextToken(Lexer::T_DOT)) {
1813 1813
                 $this->match(Lexer::T_DOT);
1814 1814
                 $this->match(Lexer::T_IDENTIFIER);
1815
-                $field .= '.' . $this->lexer->token['value'];
1815
+                $field .= '.'.$this->lexer->token['value'];
1816 1816
             }
1817 1817
 
1818 1818
             $partialFieldSet[] = $field;
@@ -2433,7 +2433,7 @@  discard block
 block discarded – undo
2433 2433
 
2434 2434
         // Phase 1 AST optimization: Prevent AST\ConditionalFactor
2435 2435
         // if only one AST\ConditionalPrimary is defined
2436
-        if (! $not) {
2436
+        if ( ! $not) {
2437 2437
             return $conditionalPrimary;
2438 2438
         }
2439 2439
 
@@ -2452,7 +2452,7 @@  discard block
 block discarded – undo
2452 2452
     {
2453 2453
         $condPrimary = new AST\ConditionalPrimary();
2454 2454
 
2455
-        if (! $this->lexer->isNextToken(Lexer::T_OPEN_PARENTHESIS)) {
2455
+        if ( ! $this->lexer->isNextToken(Lexer::T_OPEN_PARENTHESIS)) {
2456 2456
             $condPrimary->simpleConditionalExpression = $this->SimpleConditionalExpression();
2457 2457
 
2458 2458
             return $condPrimary;
@@ -2620,7 +2620,7 @@  discard block
 block discarded – undo
2620 2620
             $this->match(Lexer::T_OF);
2621 2621
         }
2622 2622
 
2623
-        $collMemberExpr      = new AST\CollectionMemberExpression(
2623
+        $collMemberExpr = new AST\CollectionMemberExpression(
2624 2624
             $entityExpr,
2625 2625
             $this->CollectionValuedPathExpression()
2626 2626
         );
@@ -2955,7 +2955,7 @@  discard block
 block discarded – undo
2955 2955
         $lookaheadType = $this->lexer->lookahead['type'];
2956 2956
         $isDistinct    = false;
2957 2957
 
2958
-        if (! in_array($lookaheadType, [Lexer::T_COUNT, Lexer::T_AVG, Lexer::T_MAX, Lexer::T_MIN, Lexer::T_SUM], true)) {
2958
+        if ( ! in_array($lookaheadType, [Lexer::T_COUNT, Lexer::T_AVG, Lexer::T_MAX, Lexer::T_MIN, Lexer::T_SUM], true)) {
2959 2959
             $this->syntaxError('One of: MAX, MIN, AVG, SUM, COUNT');
2960 2960
         }
2961 2961
 
@@ -2985,7 +2985,7 @@  discard block
 block discarded – undo
2985 2985
         $lookaheadType = $this->lexer->lookahead['type'];
2986 2986
         $value         = $this->lexer->lookahead['value'];
2987 2987
 
2988
-        if (! in_array($lookaheadType, [Lexer::T_ALL, Lexer::T_ANY, Lexer::T_SOME], true)) {
2988
+        if ( ! in_array($lookaheadType, [Lexer::T_ALL, Lexer::T_ANY, Lexer::T_SOME], true)) {
2989 2989
             $this->syntaxError('ALL, ANY or SOME');
2990 2990
         }
2991 2991
 
@@ -3223,7 +3223,7 @@  discard block
 block discarded – undo
3223 3223
                 $lookaheadValue = $this->lexer->lookahead['value'];
3224 3224
 
3225 3225
                 // Validate existing component
3226
-                if (! isset($this->queryComponents[$lookaheadValue])) {
3226
+                if ( ! isset($this->queryComponents[$lookaheadValue])) {
3227 3227
                     $this->semanticalError('Cannot add having condition on undefined result variable.');
3228 3228
                 }
3229 3229
 
@@ -3234,7 +3234,7 @@  discard block
 block discarded – undo
3234 3234
                 }
3235 3235
 
3236 3236
                 // Validating ResultVariable
3237
-                if (! isset($this->queryComponents[$lookaheadValue]['resultVariable'])) {
3237
+                if ( ! isset($this->queryComponents[$lookaheadValue]['resultVariable'])) {
3238 3238
                     $this->semanticalError('Cannot add having condition on a non result variable.');
3239 3239
                 }
3240 3240
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Query/Printer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      */
46 46
     public function startProduction($name)
47 47
     {
48
-        $this->println('(' . $name);
48
+        $this->println('('.$name);
49 49
         $this->indent++;
50 50
     }
51 51
 
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
      */
68 68
     public function println($str)
69 69
     {
70
-        if (! $this->silent) {
70
+        if ( ! $this->silent) {
71 71
             echo str_repeat('    ', $this->indent), $str, "\n";
72 72
         }
73 73
     }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Query/QueryException.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
      */
33 33
     public static function syntaxError($message, $previous = null)
34 34
     {
35
-        return new self('[Syntax Error] ' . $message, 0, $previous);
35
+        return new self('[Syntax Error] '.$message, 0, $previous);
36 36
     }
37 37
 
38 38
     /**
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
      */
44 44
     public static function semanticalError($message, $previous = null)
45 45
     {
46
-        return new self('[Semantical Error] ' . $message, 0, $previous);
46
+        return new self('[Semantical Error] '.$message, 0, $previous);
47 47
     }
48 48
 
49 49
     /**
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
      */
63 63
     public static function invalidParameterType($expected, $received)
64 64
     {
65
-        return new self('Invalid parameter type, ' . $received . ' given, but ' . $expected . ' expected.');
65
+        return new self('Invalid parameter type, '.$received.' given, but '.$expected.' expected.');
66 66
     }
67 67
 
68 68
     /**
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
      */
73 73
     public static function invalidParameterPosition($pos)
74 74
     {
75
-        return new self('Invalid parameter position: ' . $pos);
75
+        return new self('Invalid parameter position: '.$pos);
76 76
     }
77 77
 
78 78
     /**
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
      */
84 84
     public static function tooManyParameters($expected, $received)
85 85
     {
86
-        return new self('Too many parameters: the query defines ' . $expected . ' parameters and you bound ' . $received);
86
+        return new self('Too many parameters: the query defines '.$expected.' parameters and you bound '.$received);
87 87
     }
88 88
 
89 89
     /**
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
      */
95 95
     public static function tooFewParameters($expected, $received)
96 96
     {
97
-        return new self('Too few parameters: the query defines ' . $expected . ' parameters but you only bound ' . $received);
97
+        return new self('Too few parameters: the query defines '.$expected.' parameters but you only bound '.$received);
98 98
     }
99 99
 
100 100
     /**
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
      */
105 105
     public static function invalidParameterFormat($value)
106 106
     {
107
-        return new self('Invalid parameter format, ' . $value . ' given, but :<name> or ?<num> expected.');
107
+        return new self('Invalid parameter format, '.$value.' given, but :<name> or ?<num> expected.');
108 108
     }
109 109
 
110 110
     /**
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
      */
115 115
     public static function unknownParameter($key)
116 116
     {
117
-        return new self('Invalid parameter: token ' . $key . ' is not defined in the query.');
117
+        return new self('Invalid parameter: token '.$key.' is not defined in the query.');
118 118
     }
119 119
 
120 120
     /**
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
     public static function invalidPathExpression($pathExpr)
134 134
     {
135 135
         return new self(
136
-            "Invalid PathExpression '" . $pathExpr->identificationVariable . '.' . $pathExpr->field . "'."
136
+            "Invalid PathExpression '".$pathExpr->identificationVariable.'.'.$pathExpr->field."'."
137 137
         );
138 138
     }
139 139
 
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
      */
145 145
     public static function invalidLiteral($literal)
146 146
     {
147
-        return new self("Invalid literal '" . $literal . "'");
147
+        return new self("Invalid literal '".$literal."'");
148 148
     }
149 149
 
150 150
     /**
@@ -155,8 +155,8 @@  discard block
 block discarded – undo
155 155
     public static function iterateWithFetchJoinCollectionNotAllowed($assoc)
156 156
     {
157 157
         return new self(
158
-            'Invalid query operation: Not allowed to iterate over fetch join collections ' .
159
-            'in class ' . $assoc['sourceEntity'] . ' association ' . $assoc['fieldName']
158
+            'Invalid query operation: Not allowed to iterate over fetch join collections '.
159
+            'in class '.$assoc['sourceEntity'].' association '.$assoc['fieldName']
160 160
         );
161 161
     }
162 162
 
@@ -166,8 +166,8 @@  discard block
 block discarded – undo
166 166
     public static function partialObjectsAreDangerous()
167 167
     {
168 168
         return new self(
169
-            'Loading partial objects is dangerous. Fetch full objects or consider ' .
170
-            'using a different fetch mode. If you really want partial objects, ' .
169
+            'Loading partial objects is dangerous. Fetch full objects or consider '.
170
+            'using a different fetch mode. If you really want partial objects, '.
171 171
             'set the doctrine.forcePartialLoad query hint to TRUE.'
172 172
         );
173 173
     }
@@ -180,8 +180,8 @@  discard block
 block discarded – undo
180 180
     public static function overwritingJoinConditionsNotYetSupported($assoc)
181 181
     {
182 182
         return new self(
183
-            'Unsupported query operation: It is not yet possible to overwrite the join ' .
184
-            'conditions in class ' . $assoc['sourceEntityName'] . ' association ' . $assoc['fieldName'] . '. ' .
183
+            'Unsupported query operation: It is not yet possible to overwrite the join '.
184
+            'conditions in class '.$assoc['sourceEntityName'].' association '.$assoc['fieldName'].'. '.
185 185
             'Use WITH to append additional join conditions to the association.'
186 186
         );
187 187
     }
@@ -192,8 +192,8 @@  discard block
 block discarded – undo
192 192
     public static function associationPathInverseSideNotSupported(PathExpression $pathExpr)
193 193
     {
194 194
         return new self(
195
-            'A single-valued association path expression to an inverse side is not supported in DQL queries. ' .
196
-            'Instead of "' . $pathExpr->identificationVariable . '.' . $pathExpr->field . '" use an explicit join.'
195
+            'A single-valued association path expression to an inverse side is not supported in DQL queries. '.
196
+            'Instead of "'.$pathExpr->identificationVariable.'.'.$pathExpr->field.'" use an explicit join.'
197 197
         );
198 198
     }
199 199
 
@@ -217,8 +217,8 @@  discard block
 block discarded – undo
217 217
     public static function associationPathCompositeKeyNotSupported()
218 218
     {
219 219
         return new self(
220
-            'A single-valued association path expression to an entity with a composite primary ' .
221
-            'key is not supported. Explicitly name the components of the composite primary key ' .
220
+            'A single-valued association path expression to an entity with a composite primary '.
221
+            'key is not supported. Explicitly name the components of the composite primary key '.
222 222
             'in the query.'
223 223
         );
224 224
     }
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
      */
232 232
     public static function instanceOfUnrelatedClass($className, $rootClass)
233 233
     {
234
-        return new self("Cannot check if a child of '" . $rootClass . "' is instanceof '" . $className . "', " .
234
+        return new self("Cannot check if a child of '".$rootClass."' is instanceof '".$className."', ".
235 235
             'inheritance hierarchy does not exists between these two classes.');
236 236
     }
237 237
 
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
     public static function invalidQueryComponent($dqlAlias)
244 244
     {
245 245
         return new self(
246
-            "Invalid query component given for DQL alias '" . $dqlAlias . "', " .
246
+            "Invalid query component given for DQL alias '".$dqlAlias."', ".
247 247
             "requires 'metadata', 'parent', 'relation', 'map', 'nestingLevel' and 'token' keys."
248 248
         );
249 249
     }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Proxy/Factory/StaticProxyFactory.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
      */
55 55
     public function generateProxyClasses(array $classes) : int
56 56
     {
57
-        $concreteClasses = array_filter($classes, function (ClassMetadata $metadata) : bool {
57
+        $concreteClasses = array_filter($classes, function(ClassMetadata $metadata) : bool {
58 58
             return ! ($metadata->isMappedSuperclass || $metadata->getReflectionClass()->isAbstract());
59 59
         });
60 60
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
                 ->proxyFactory
64 64
                 ->createProxy(
65 65
                     $metadata->getClassName(),
66
-                    function () {
66
+                    function() {
67 67
                         // empty closure, serves its purpose, for now
68 68
                     },
69 69
                     $this->skippedFieldsFqns($metadata)
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
                 ->getUnitOfWork()
88 88
                 ->getEntityPersister($metadata->getClassName());
89 89
 
90
-        $proxyInstance                                            = $this
90
+        $proxyInstance = $this
91 91
             ->proxyFactory
92 92
             ->createProxy(
93 93
                 $metadata->getClassName(),
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 
107 107
     private function makeInitializer(ClassMetadata $metadata, EntityPersister $persister) : \Closure
108 108
     {
109
-        return function (
109
+        return function(
110 110
             GhostObjectInterface $ghostObject,
111 111
             string $method,
112 112
             // we don't care
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
             $identifier = $persister->getIdentifier($ghostObject);
125 125
 
126 126
             // @TODO how do we use `$properties` in the persister? That would be a massive optimisation
127
-            if (! $persister->loadById($identifier, $ghostObject)) {
127
+            if ( ! $persister->loadById($identifier, $ghostObject)) {
128 128
                 $initializer = $originalInitializer;
129 129
 
130 130
                 throw EntityNotFoundException::fromClassNameAndIdentifier(
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
         $transientFieldsFqns = [];
157 157
 
158 158
         foreach ($metadata->getDeclaredPropertiesIterator() as $name => $property) {
159
-            if (! $property instanceof TransientMetadata) {
159
+            if ( ! $property instanceof TransientMetadata) {
160 160
                 continue;
161 161
             }
162 162
 
@@ -194,11 +194,11 @@  discard block
 block discarded – undo
194 194
     private function propertyFqcn(\ReflectionProperty $property) : string
195 195
     {
196 196
         if ($property->isPrivate()) {
197
-            return "\0" . $property->getDeclaringClass()->getName() . "\0" . $property->getName();
197
+            return "\0".$property->getDeclaringClass()->getName()."\0".$property->getName();
198 198
         }
199 199
 
200 200
         if ($property->isProtected()) {
201
-            return "\0*\0" . $property->getName();
201
+            return "\0*\0".$property->getName();
202 202
         }
203 203
 
204 204
         return $property->getName();
Please login to merge, or discard this patch.
lib/Doctrine/ORM/OptimisticLockException.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         $expectedLockVersion = ($expectedLockVersion instanceof \DateTime) ? $expectedLockVersion->getTimestamp() : $expectedLockVersion;
58 58
         $actualLockVersion   = ($actualLockVersion instanceof \DateTime) ? $actualLockVersion->getTimestamp() : $actualLockVersion;
59 59
 
60
-        return new self('The optimistic lock failed, version ' . $expectedLockVersion . ' was expected, but is actually ' . $actualLockVersion, $entity);
60
+        return new self('The optimistic lock failed, version '.$expectedLockVersion.' was expected, but is actually '.$actualLockVersion, $entity);
61 61
     }
62 62
 
63 63
     /**
@@ -67,6 +67,6 @@  discard block
 block discarded – undo
67 67
      */
68 68
     public static function notVersioned($entityName)
69 69
     {
70
-        return new self('Cannot obtain optimistic lock on unversioned entity ' . $entityName, null);
70
+        return new self('Cannot obtain optimistic lock on unversioned entity '.$entityName, null);
71 71
     }
72 72
 }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/SchemaTool.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -176,11 +176,11 @@  discard block
 block discarded – undo
176 176
                     $pkColumns = [];
177 177
 
178 178
                     foreach ($class->getDeclaredPropertiesIterator() as $fieldName => $property) {
179
-                        if (! ($property instanceof FieldMetadata)) {
179
+                        if ( ! ($property instanceof FieldMetadata)) {
180 180
                             continue;
181 181
                         }
182 182
 
183
-                        if (! $class->isInheritedProperty($fieldName)) {
183
+                        if ( ! $class->isInheritedProperty($fieldName)) {
184 184
                             $columnName = $this->platform->quoteIdentifier($property->getColumnName());
185 185
 
186 186
                             $this->gatherColumn($class, $property, $table);
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
                             }
216 216
                         }
217 217
 
218
-                        if (! empty($inheritedKeyColumns)) {
218
+                        if ( ! empty($inheritedKeyColumns)) {
219 219
                             // Add a FK constraint on the ID column
220 220
                             $rootClass = $this->em->getClassMetadata($class->getRootClassName());
221 221
 
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
                 }
261 261
             }
262 262
 
263
-            if (! $table->hasIndex('primary')) {
263
+            if ( ! $table->hasIndex('primary')) {
264 264
                 $table->setPrimaryKey($pkColumns);
265 265
             }
266 266
 
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
             $processedClasses[$class->getClassName()] = true;
321 321
 
322 322
             foreach ($class->getDeclaredPropertiesIterator() as $property) {
323
-                if (! $property instanceof FieldMetadata
323
+                if ( ! $property instanceof FieldMetadata
324 324
                     || ! $property->hasValueGenerator()
325 325
                     || $property->getValueGenerator()->getType() !== GeneratorType::SEQUENCE
326 326
                     || $class->getClassName() !== $class->getRootClassName()) {
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 
330 330
                 $quotedName = $this->platform->quoteIdentifier($property->getValueGenerator()->getDefinition()['sequenceName']);
331 331
 
332
-                if (! $schema->hasSequence($quotedName)) {
332
+                if ( ! $schema->hasSequence($quotedName)) {
333 333
                     $schema->createSequence($quotedName, $property->getValueGenerator()->getDefinition()['allocationSize']);
334 334
                 }
335 335
             }
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
             }
343 343
         }
344 344
 
345
-        if (! $this->platform->supportsSchemas() && ! $this->platform->canEmulateSchemas()) {
345
+        if ( ! $this->platform->supportsSchemas() && ! $this->platform->canEmulateSchemas()) {
346 346
             $schema->visit(new RemoveNamespacedAssets());
347 347
         }
348 348
 
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
                 break;
382 382
         }
383 383
 
384
-        if (! empty($discrColumn->getColumnDefinition())) {
384
+        if ( ! empty($discrColumn->getColumnDefinition())) {
385 385
             $options['columnDefinition'] = $discrColumn->getColumnDefinition();
386 386
         }
387 387
 
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
         $pkColumns = [];
400 400
 
401 401
         foreach ($class->getDeclaredPropertiesIterator() as $fieldName => $property) {
402
-            if (! ($property instanceof FieldMetadata)) {
402
+            if ( ! ($property instanceof FieldMetadata)) {
403 403
                 continue;
404 404
             }
405 405
 
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
     private function gatherRelationsSql($class, $table, $schema, &$addedFks, &$blacklistedFks)
515 515
     {
516 516
         foreach ($class->getDeclaredPropertiesIterator() as $fieldName => $property) {
517
-            if (! ($property instanceof AssociationMetadata)) {
517
+            if ( ! ($property instanceof AssociationMetadata)) {
518 518
                 continue;
519 519
             }
520 520
 
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
                 continue;
523 523
             }
524 524
 
525
-            if (! $property->isOwningSide()) {
525
+            if ( ! $property->isOwningSide()) {
526 526
                 continue;
527 527
             }
528 528
 
@@ -612,7 +612,7 @@  discard block
 block discarded – undo
612 612
         $idColumns        = $class->getIdentifierColumns($this->em);
613 613
         $idColumnNameList = array_keys($idColumns);
614 614
 
615
-        if (! in_array($referencedColumnName, $idColumnNameList, true)) {
615
+        if ( ! in_array($referencedColumnName, $idColumnNameList, true)) {
616 616
             return null;
617 617
         }
618 618
 
@@ -620,7 +620,7 @@  discard block
 block discarded – undo
620 620
         foreach ($class->getIdentifierFieldNames() as $fieldName) {
621 621
             $property = $class->getProperty($fieldName);
622 622
 
623
-            if (! ($property instanceof AssociationMetadata)) {
623
+            if ( ! ($property instanceof AssociationMetadata)) {
624 624
                 continue;
625 625
             }
626 626
 
@@ -676,7 +676,7 @@  discard block
 block discarded – undo
676 676
                 $joinColumn->getReferencedColumnName()
677 677
             );
678 678
 
679
-            if (! $definingClass) {
679
+            if ( ! $definingClass) {
680 680
                 throw MissingColumnException::fromColumnSourceAndTarget(
681 681
                     $joinColumn->getReferencedColumnName(),
682 682
                     $mapping->getSourceEntity(),
@@ -691,14 +691,14 @@  discard block
 block discarded – undo
691 691
             $localColumns[]      = $quotedColumnName;
692 692
             $foreignColumns[]    = $quotedReferencedColumnName;
693 693
 
694
-            if (! $theJoinTable->hasColumn($quotedColumnName)) {
694
+            if ( ! $theJoinTable->hasColumn($quotedColumnName)) {
695 695
                 // Only add the column to the table if it does not exist already.
696 696
                 // It might exist already if the foreign key is mapped into a regular
697 697
                 // property as well.
698 698
                 $property  = $definingClass->getProperty($referencedFieldName);
699 699
                 $columnDef = null;
700 700
 
701
-                if (! empty($joinColumn->getColumnDefinition())) {
701
+                if ( ! empty($joinColumn->getColumnDefinition())) {
702 702
                     $columnDef = $joinColumn->getColumnDefinition();
703 703
                 } elseif ($property->getColumnDefinition()) {
704 704
                     $columnDef = $property->getColumnDefinition();
@@ -732,7 +732,7 @@  discard block
 block discarded – undo
732 732
                 $uniqueConstraints[] = ['columns' => [$quotedColumnName]];
733 733
             }
734 734
 
735
-            if (! empty($joinColumn->getOnDelete())) {
735
+            if ( ! empty($joinColumn->getOnDelete())) {
736 736
                 $fkOptions['onDelete'] = $joinColumn->getOnDelete();
737 737
             }
738 738
         }
@@ -743,7 +743,7 @@  discard block
 block discarded – undo
743 743
             $theJoinTable->addUniqueIndex($unique['columns'], is_numeric($indexName) ? null : $indexName);
744 744
         }
745 745
 
746
-        $compositeName = $theJoinTable->getName() . '.' . implode('', $localColumns);
746
+        $compositeName = $theJoinTable->getName().'.'.implode('', $localColumns);
747 747
 
748 748
         if (isset($addedFks[$compositeName])
749 749
             && ($foreignTableName !== $addedFks[$compositeName]['foreignTableName']
@@ -760,7 +760,7 @@  discard block
 block discarded – undo
760 760
             }
761 761
 
762 762
             $blacklistedFks[$compositeName] = true;
763
-        } elseif (! isset($blacklistedFks[$compositeName])) {
763
+        } elseif ( ! isset($blacklistedFks[$compositeName])) {
764 764
             $addedFks[$compositeName] = [
765 765
                 'foreignTableName' => $foreignTableName,
766 766
                 'foreignColumns'   => $foreignColumns,
@@ -842,7 +842,7 @@  discard block
 block discarded – undo
842 842
         $fullSchema = $sm->createSchema();
843 843
 
844 844
         foreach ($fullSchema->getTables() as $table) {
845
-            if (! $schema->hasTable($table->getName())) {
845
+            if ( ! $schema->hasTable($table->getName())) {
846 846
                 foreach ($table->getForeignKeys() as $foreignKey) {
847 847
                     /** @var $foreignKey \Doctrine\DBAL\Schema\ForeignKeyConstraint */
848 848
                     if ($schema->hasTable($foreignKey->getForeignTableName())) {
@@ -867,7 +867,7 @@  discard block
 block discarded – undo
867 867
                 if ($table->hasPrimaryKey()) {
868 868
                     $columns = $table->getPrimaryKey()->getColumns();
869 869
                     if (count($columns) === 1) {
870
-                        $checkSequence = $table->getName() . '_' . $columns[0] . '_seq';
870
+                        $checkSequence = $table->getName().'_'.$columns[0].'_seq';
871 871
                         if ($fullSchema->hasSequence($checkSequence)) {
872 872
                             $visitor->acceptSequence($fullSchema->getSequence($checkSequence));
873 873
                         }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/ToolsException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,6 +14,6 @@
 block discarded – undo
14 14
 {
15 15
     public static function schemaToolFailure(string $sql, Throwable $e) : self
16 16
     {
17
-        return new self("Schema-Tool failed with Error '" . $e->getMessage() . "' while executing DDL: " . $sql, 0, $e);
17
+        return new self("Schema-Tool failed with Error '".$e->getMessage()."' while executing DDL: ".$sql, 0, $e);
18 18
     }
19 19
 }
Please login to merge, or discard this patch.