Passed
Push — master ( a8d0dc...f605de )
by Thomas
01:38
created
src/QueryBuilder/QueryBuilder.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -331,14 +331,14 @@
 block discarded – undo
331 331
     public function getQuery()
332 332
     {
333 333
         return 'SELECT '
334
-               . (!empty($this->modifier) ? implode(' ', $this->modifier) . ' ' : '')
335
-               . ($this->columns ? implode(',', $this->columns) : '*')
336
-               . ' FROM ' . $this->tableName . ($this->alias ? ' AS ' . $this->alias : '')
337
-               . (!empty($this->joins) ? ' ' . implode(' ', $this->joins) : '')
338
-               . (!empty($this->where) ? ' WHERE ' . implode(' ', $this->where) : '')
339
-               . (!empty($this->groupBy) ? ' GROUP BY ' . implode(',', $this->groupBy) : '')
340
-               . (!empty($this->orderBy) ? ' ORDER BY ' . implode(',', $this->orderBy) : '')
341
-               . ($this->limit ? ' LIMIT ' . $this->limit . ($this->offset ? ' OFFSET ' . $this->offset : '') : '');
334
+                . (!empty($this->modifier) ? implode(' ', $this->modifier) . ' ' : '')
335
+                . ($this->columns ? implode(',', $this->columns) : '*')
336
+                . ' FROM ' . $this->tableName . ($this->alias ? ' AS ' . $this->alias : '')
337
+                . (!empty($this->joins) ? ' ' . implode(' ', $this->joins) : '')
338
+                . (!empty($this->where) ? ' WHERE ' . implode(' ', $this->where) : '')
339
+                . (!empty($this->groupBy) ? ' GROUP BY ' . implode(',', $this->groupBy) : '')
340
+                . (!empty($this->orderBy) ? ' ORDER BY ' . implode(',', $this->orderBy) : '')
341
+                . ($this->limit ? ' LIMIT ' . $this->limit . ($this->offset ? ' OFFSET ' . $this->offset : '') : '');
342 342
     }
343 343
 
344 344
     /** {@inheritdoc} */
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         }
107 107
 
108 108
         if (!is_array($args)) {
109
-            $args = [ $args ];
109
+            $args = [$args];
110 110
         }
111 111
 
112 112
         $parts      = explode('?', $expression);
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
         $operator   = $operator ?: $this->getDefaultOperator($value);
168 168
         $expression = $column . ' ' . $operator;
169 169
 
170
-        if (in_array(strtoupper($operator), [ 'IN', 'NOT IN' ]) && is_array($value)) {
170
+        if (in_array(strtoupper($operator), ['IN', 'NOT IN']) && is_array($value)) {
171 171
             $expression .= ' (?' . str_repeat(',?', count($value) - 1) . ')';
172 172
         } else {
173 173
             $expression .= ' ?';
@@ -234,19 +234,19 @@  discard block
 block discarded – undo
234 234
                 . ($alias ? ' AS ' . $alias : '');
235 235
 
236 236
         if (preg_match('/^[A-Za-z_]+$/', $expression)) {
237
-            $join          .= ' USING (' . $expression . ')';
237
+            $join .= ' USING (' . $expression . ')';
238 238
             $this->joins[] = $join;
239 239
         } elseif ($expression) {
240 240
             $expression = $this->convertPlaceholders($expression, $args);
241 241
 
242
-            $join          .= ' ON ' . $expression;
242
+            $join .= ' ON ' . $expression;
243 243
             $this->joins[] = $join;
244 244
         } elseif ($empty) {
245 245
             $this->joins[] = $join;
246 246
         } else {
247 247
             return new Parenthesis(
248 248
                 function (ParenthesisInterface $parenthesis) use ($join) {
249
-                    $join          .= ' ON ' . $parenthesis->getExpression();
249
+                    $join .= ' ON ' . $parenthesis->getExpression();
250 250
                     $this->joins[] = $join;
251 251
                     return $this;
252 252
                 },
Please login to merge, or discard this patch.
src/Relation/ManyToMany.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
         }
141 141
 
142 142
         $statement = 'INSERT INTO ' . $table . ' (' . implode(',', $cols) . ') ' .
143
-                     'VALUES (' . implode('),(', $associations) . ')';
143
+                        'VALUES (' . implode('),(', $associations) . ')';
144 144
         $entityManager->getConnection()->query($statement);
145 145
     }
146 146
 
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
             }
163 163
 
164 164
             $where[] = $entityManager->escapeIdentifier($fkCol) . ' = ' .
165
-                       $entityManager->escapeValue($value);
165
+                        $entityManager->escapeValue($value);
166 166
         }
167 167
 
168 168
         foreach ($entities as $entity) {
@@ -179,13 +179,13 @@  discard block
 block discarded – undo
179 179
                 }
180 180
 
181 181
                 $condition[] = $entityManager->escapeIdentifier($fkCol) . ' = ' .
182
-                               $entityManager->escapeValue($value);
182
+                                $entityManager->escapeValue($value);
183 183
             }
184 184
             $where[] = implode(' AND ', $condition);
185 185
         }
186 186
 
187 187
         $statement = 'DELETE FROM ' . $table . ' WHERE ' . array_shift($where) . ' ' .
188
-                     'AND (' . implode(' OR ', $where) . ')';
188
+                        'AND (' . implode(' OR ', $where) . ')';
189 189
         $entityManager->getConnection()->query($statement);
190 190
     }
191 191
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
                             $table . '.' . $fetcher->getEntityManager()->escapeIdentifier($col);
206 206
         }
207 207
 
208
-        call_user_func([ $fetcher, $join ], $table, implode(' AND ', $expression), null, [], true);
208
+        call_user_func([$fetcher, $join], $table, implode(' AND ', $expression), null, [], true);
209 209
 
210 210
         $expression = [];
211 211
         foreach ($this->getOpponent()->getReference() as $hisVar => $col) {
@@ -213,6 +213,6 @@  discard block
 block discarded – undo
213 213
                             ' = ' . $this->name . '.' . $hisVar;
214 214
         }
215 215
 
216
-        call_user_func([ $fetcher, $join ], $this->class, implode(' AND ', $expression), $this->name, [], true);
216
+        call_user_func([$fetcher, $join], $this->class, implode(' AND ', $expression), $this->name, [], true);
217 217
     }
218 218
 }
Please login to merge, or discard this patch.
src/Dbal/Type/Set.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,12 +18,12 @@
 block discarded – undo
18 18
     public function validate($value)
19 19
     {
20 20
         if (!is_string($value)) {
21
-            return new NoString([ 'type' => 'set' ]);
21
+            return new NoString(['type' => 'set']);
22 22
         } else {
23 23
             $values = explode(',', $value);
24 24
             foreach ($values as $value) {
25 25
                 if (!in_array($value, $this->allowedValues)) {
26
-                    return new NotAllowed([ 'value' => $value, 'type' => 'set' ]);
26
+                    return new NotAllowed(['value' => $value, 'type' => 'set']);
27 27
                 }
28 28
             }
29 29
         }
Please login to merge, or discard this patch.
src/Dbal/Type/Enum.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,9 +41,9 @@
 block discarded – undo
41 41
     public function validate($value)
42 42
     {
43 43
         if (!is_string($value)) {
44
-            return new NoString([ 'type' => 'enum' ]);
44
+            return new NoString(['type' => 'enum']);
45 45
         } elseif (!in_array($value, $this->allowedValues)) {
46
-            return new NotAllowed([ 'value' => $value, 'type' => 'enum' ]);
46
+            return new NotAllowed(['value' => $value, 'type' => 'enum']);
47 47
         }
48 48
 
49 49
         return true;
Please login to merge, or discard this patch.
src/Entity.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -575,7 +575,7 @@
 block discarded – undo
575 575
         if (!empty($attribute)) {
576 576
             $col = static::getColumnName($attribute);
577 577
             return (isset($this->data[$col]) ? $this->data[$col] : null) !==
578
-                   (isset($this->originalData[$col]) ? $this->originalData[$col] : null);
578
+                    (isset($this->originalData[$col]) ? $this->originalData[$col] : null);
579 579
         }
580 580
 
581 581
         ksort($this->data);
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
      */
173 173
     public static function getPrimaryKeyVars()
174 174
     {
175
-        return !is_array(static::$primaryKey) ? [ static::$primaryKey ] : static::$primaryKey;
175
+        return !is_array(static::$primaryKey) ? [static::$primaryKey] : static::$primaryKey;
176 176
     }
177 177
 
178 178
     /**
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
         $em     = EM::getInstance(static::class);
317 317
         $getter = $em->getNamer()->getMethodName('get' . ucfirst($attribute), self::$namingSchemeMethods);
318 318
 
319
-        if (method_exists($this, $getter) && is_callable([ $this, $getter ])) {
319
+        if (method_exists($this, $getter) && is_callable([$this, $getter])) {
320 320
             return $this->$getter();
321 321
         } else {
322 322
             $col    = static::getColumnName($attribute);
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
         $em     = EM::getInstance(static::class);
342 342
         $getter = $em->getNamer()->getMethodName('get' . ucfirst($attribute), self::$namingSchemeMethods);
343 343
 
344
-        if (method_exists($this, $getter) && is_callable([ $this, $getter ])) {
344
+        if (method_exists($this, $getter) && is_callable([$this, $getter])) {
345 345
             return $this->$getter() !== null;
346 346
         } else {
347 347
             $col = static::getColumnName($attribute);
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
         $em     = EM::getInstance(static::class);
379 379
         $setter = $em->getNamer()->getMethodName('set' . ucfirst($attribute), self::$namingSchemeMethods);
380 380
 
381
-        if (method_exists($this, $setter) && is_callable([ $this, $setter ])) {
381
+        if (method_exists($this, $setter) && is_callable([$this, $setter])) {
382 382
             $oldValue   = $this->__get($attribute);
383 383
             $md5OldData = md5(serialize($this->data));
384 384
             $this->$setter($value);
@@ -794,7 +794,7 @@  discard block
 block discarded – undo
794 794
      */
795 795
     public function serialize()
796 796
     {
797
-        return serialize([ $this->data, $this->relatedObjects ]);
797
+        return serialize([$this->data, $this->relatedObjects]);
798 798
     }
799 799
 
800 800
     /**
Please login to merge, or discard this patch.
src/Namer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -305,7 +305,7 @@
 block discarded – undo
305 305
             }
306 306
 
307 307
             $array = substr($accessor, -1) === '*' ?
308
-                array_slice($array, $from) : [ $array[$from] ];
308
+                array_slice($array, $from) : [$array[$from]];
309 309
         }
310 310
 
311 311
         return implode($glue, $array);
Please login to merge, or discard this patch.
src/Dbal/Error/NotNullable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,6 +19,6 @@
 block discarded – undo
19 19
 
20 20
     public function __construct(Column $column)
21 21
     {
22
-        parent::__construct([ 'column' => $column->name ]);
22
+        parent::__construct(['column' => $column->name]);
23 23
     }
24 24
 }
Please login to merge, or discard this patch.
src/Dbal/Type/Json.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,9 +24,9 @@
 block discarded – undo
24 24
     public function validate($value)
25 25
     {
26 26
         if (!is_string($value)) {
27
-            return new NoString([ 'type' => 'json' ]);
27
+            return new NoString(['type' => 'json']);
28 28
         } elseif ($value !== 'null' && json_decode($value) === null) {
29
-            return new InvalidJson([ 'value' => (string) $value ]);
29
+            return new InvalidJson(['value' => (string) $value]);
30 30
         }
31 31
 
32 32
         return true;
Please login to merge, or discard this patch.
src/Dbal/Type/VarChar.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,9 +48,9 @@
 block discarded – undo
48 48
     public function validate($value)
49 49
     {
50 50
         if (!is_string($value)) {
51
-            return new NoString([ 'type' => $this->type ]);
51
+            return new NoString(['type' => $this->type]);
52 52
         } elseif ($this->maxLength !== 0 && mb_strlen($value) > $this->maxLength) {
53
-            return new TooLong([ 'value' => $value, 'max' => $this->maxLength ]);
53
+            return new TooLong(['value' => $value, 'max' => $this->maxLength]);
54 54
         }
55 55
 
56 56
         return true;
Please login to merge, or discard this patch.