Failed Conditions
Pull Request — master (#7084)
by
unknown
13:36
created
lib/Doctrine/ORM/Query/QueryException.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM\Query;
6 6
 
@@ -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
     /**
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
      */
83 83
     public static function invalidParameterFormat($value)
84 84
     {
85
-        return new self('Invalid parameter format, ' . $value . ' given, but :<name> or ?<num> expected.');
85
+        return new self('Invalid parameter format, '.$value.' given, but :<name> or ?<num> expected.');
86 86
     }
87 87
 
88 88
     /**
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
      */
93 93
     public static function unknownParameter($key)
94 94
     {
95
-        return new self('Invalid parameter: token ' . $key . ' is not defined in the query.');
95
+        return new self('Invalid parameter: token '.$key.' is not defined in the query.');
96 96
     }
97 97
     
98 98
     /**
@@ -104,13 +104,13 @@  discard block
 block discarded – undo
104 104
     public static function missingParameter($expected, $received)
105 105
     {
106 106
         foreach (array_keys($expected) as $token) {
107
-            if (!in_array($token, $received)) {
108
-                return new self('Missing parameter: no parameter set for token ' . $token . '.');
107
+            if ( ! in_array($token, $received)) {
108
+                return new self('Missing parameter: no parameter set for token '.$token.'.');
109 109
             }
110 110
         }
111 111
         
112
-        return new self('Too few parameters: the query defines ' . count($expected)
113
-                . ' parameters but you only bound ' . count($received));
112
+        return new self('Too few parameters: the query defines '.count($expected)
113
+                . ' parameters but you only bound '.count($received));
114 114
     }
115 115
 
116 116
     /**
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
     public static function invalidPathExpression($pathExpr)
130 130
     {
131 131
         return new self(
132
-            "Invalid PathExpression '" . $pathExpr->identificationVariable . '.' . $pathExpr->field . "'."
132
+            "Invalid PathExpression '".$pathExpr->identificationVariable.'.'.$pathExpr->field."'."
133 133
         );
134 134
     }
135 135
 
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
      */
141 141
     public static function invalidLiteral($literal)
142 142
     {
143
-        return new self("Invalid literal '" . $literal . "'");
143
+        return new self("Invalid literal '".$literal."'");
144 144
     }
145 145
 
146 146
     /**
@@ -151,8 +151,8 @@  discard block
 block discarded – undo
151 151
     public static function iterateWithFetchJoinCollectionNotAllowed($assoc)
152 152
     {
153 153
         return new self(
154
-            'Invalid query operation: Not allowed to iterate over fetch join collections ' .
155
-            'in class ' . $assoc['sourceEntity'] . ' association ' . $assoc['fieldName']
154
+            'Invalid query operation: Not allowed to iterate over fetch join collections '.
155
+            'in class '.$assoc['sourceEntity'].' association '.$assoc['fieldName']
156 156
         );
157 157
     }
158 158
 
@@ -162,8 +162,8 @@  discard block
 block discarded – undo
162 162
     public static function partialObjectsAreDangerous()
163 163
     {
164 164
         return new self(
165
-            'Loading partial objects is dangerous. Fetch full objects or consider ' .
166
-            'using a different fetch mode. If you really want partial objects, ' .
165
+            'Loading partial objects is dangerous. Fetch full objects or consider '.
166
+            'using a different fetch mode. If you really want partial objects, '.
167 167
             'set the doctrine.forcePartialLoad query hint to TRUE.'
168 168
         );
169 169
     }
@@ -176,8 +176,8 @@  discard block
 block discarded – undo
176 176
     public static function overwritingJoinConditionsNotYetSupported($assoc)
177 177
     {
178 178
         return new self(
179
-            'Unsupported query operation: It is not yet possible to overwrite the join ' .
180
-            'conditions in class ' . $assoc['sourceEntityName'] . ' association ' . $assoc['fieldName'] . '. ' .
179
+            'Unsupported query operation: It is not yet possible to overwrite the join '.
180
+            'conditions in class '.$assoc['sourceEntityName'].' association '.$assoc['fieldName'].'. '.
181 181
             'Use WITH to append additional join conditions to the association.'
182 182
         );
183 183
     }
@@ -188,8 +188,8 @@  discard block
 block discarded – undo
188 188
     public static function associationPathInverseSideNotSupported(PathExpression $pathExpr)
189 189
     {
190 190
         return new self(
191
-            'A single-valued association path expression to an inverse side is not supported in DQL queries. ' .
192
-            'Instead of "' . $pathExpr->identificationVariable . '.' . $pathExpr->field . '" use an explicit join.'
191
+            'A single-valued association path expression to an inverse side is not supported in DQL queries. '.
192
+            'Instead of "'.$pathExpr->identificationVariable.'.'.$pathExpr->field.'" use an explicit join.'
193 193
         );
194 194
     }
195 195
 
@@ -213,8 +213,8 @@  discard block
 block discarded – undo
213 213
     public static function associationPathCompositeKeyNotSupported()
214 214
     {
215 215
         return new self(
216
-            'A single-valued association path expression to an entity with a composite primary ' .
217
-            'key is not supported. Explicitly name the components of the composite primary key ' .
216
+            'A single-valued association path expression to an entity with a composite primary '.
217
+            'key is not supported. Explicitly name the components of the composite primary key '.
218 218
             'in the query.'
219 219
         );
220 220
     }
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
      */
228 228
     public static function instanceOfUnrelatedClass($className, $rootClass)
229 229
     {
230
-        return new self("Cannot check if a child of '" . $rootClass . "' is instanceof '" . $className . "', " .
230
+        return new self("Cannot check if a child of '".$rootClass."' is instanceof '".$className."', ".
231 231
             'inheritance hierarchy does not exists between these two classes.');
232 232
     }
233 233
 
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
     public static function invalidQueryComponent($dqlAlias)
240 240
     {
241 241
         return new self(
242
-            "Invalid query component given for DQL alias '" . $dqlAlias . "', " .
242
+            "Invalid query component given for DQL alias '".$dqlAlias."', ".
243 243
             "requires 'metadata', 'parent', 'relation', 'map', 'nestingLevel' and 'token' keys."
244 244
         );
245 245
     }
Please login to merge, or discard this patch.