Passed
Push — master ( 050c29...4fa43a )
by Thomas
58s
created
src/Dbal/Type/DateTime.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -35,8 +35,7 @@  discard block
 block discarded – undo
35 35
     {
36 36
         $this->precision = (int) $precision;
37 37
         $this->regex     = $dateOnly ?
38
-            '/^' . self::DATE_REGEX . '([ T]' . self::TIME_REGEX . self::ZONE_REGEX . ')?$/' :
39
-            '/^' . self::DATE_REGEX . '[ T]' . self::TIME_REGEX . self::ZONE_REGEX . '$/';
38
+            '/^' . self::DATE_REGEX . '([ T]' . self::TIME_REGEX . self::ZONE_REGEX . ')?$/' : '/^' . self::DATE_REGEX . '[ T]' . self::TIME_REGEX . self::ZONE_REGEX . '$/';
40 39
     }
41 40
 
42 41
     public static function factory(Dbal $dbal, array $columnDefinition)
@@ -56,7 +55,7 @@  discard block
 block discarded – undo
56 55
     public function validate($value)
57 56
     {
58 57
         if (!$value instanceof \DateTime && (!is_string($value) || !preg_match($this->regex, $value))) {
59
-            return new NoDateTime([ 'value' => (string) $value ]);
58
+            return new NoDateTime(['value' => (string) $value]);
60 59
         }
61 60
 
62 61
         return true;
Please login to merge, or discard this patch.
src/Dbal/Type/Time.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
                 return new Error([], 'DATETIME', 'DateTime is not allowed for time');
33 33
             }
34 34
 
35
-            return new NoTime([ 'value' => (string) $value ]);
35
+            return new NoTime(['value' => (string) $value]);
36 36
         }
37 37
 
38 38
         return true;
Please login to merge, or discard this patch.
src/Dbal/Dbal.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -164,8 +164,8 @@  discard block
 block discarded – undo
164 164
         }
165 165
 
166 166
         $statement = 'UPDATE ' . $this->escapeIdentifier($entity::getTableName()) . ' ' .
167
-                     'SET ' . implode(',', $set) . ' ' .
168
-                     'WHERE ' . implode(' AND ', $where);
167
+                        'SET ' . implode(',', $set) . ' ' .
168
+                        'WHERE ' . implode(' AND ', $where);
169 169
         $this->entityManager->getConnection()->query($statement);
170 170
 
171 171
         return $this->entityManager->sync($entity, true);
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
         }
190 190
 
191 191
         $statement = 'DELETE FROM ' . $this->escapeIdentifier($entity::getTableName()) . ' ' .
192
-                     'WHERE ' . implode(' AND ', $where);
192
+                        'WHERE ' . implode(' AND ', $where);
193 193
         $this->entityManager->getConnection()->query($statement);
194 194
 
195 195
         return true;
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
         );
221 221
 
222 222
         $statement = 'INSERT INTO ' . $this->escapeIdentifier($entity::getTableName()) . ' ' .
223
-                     '(' . implode(',', $cols) . ') VALUES (' . implode(',', $values) . ')';
223
+                        '(' . implode(',', $cols) . ') VALUES (' . implode(',', $values) . ')';
224 224
 
225 225
         return $statement;
226 226
     }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
     public function escapeValue($value)
97 97
     {
98 98
         $type   = is_object($value) ? get_class($value) : gettype($value);
99
-        $method = [ $this, 'escape' . ucfirst($type) ];
99
+        $method = [$this, 'escape' . ucfirst($type)];
100 100
 
101 101
         if (is_callable($method)) {
102 102
             return call_user_func($method, $value);
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
         $var    = $entity::getPrimaryKeyVars()[0];
237 237
         $column = $entity::getColumnName($var);
238 238
 
239
-        $entity->setOriginalData(array_merge($entity->getData(), [ $column => $value ]));
239
+        $entity->setOriginalData(array_merge($entity->getData(), [$column => $value]));
240 240
         $entity->__set($var, $value);
241 241
     }
242 242
 
Please login to merge, or discard this patch.
src/Dbal/Column.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     protected static function getRegisteredType(array $columnDefinition)
42 42
     {
43 43
         foreach (self::$registeredTypes as $class) {
44
-            if (call_user_func([ $class, 'fits' ], $columnDefinition)) {
44
+            if (call_user_func([$class, 'fits'], $columnDefinition)) {
45 45
                 return $class;
46 46
             }
47 47
         }
@@ -152,11 +152,11 @@  discard block
 block discarded – undo
152 152
                 $class = $this->columnDefinition['type'];
153 153
             }
154 154
 
155
-            if ($class === null || !is_callable([ $class, 'factory' ])) {
155
+            if ($class === null || !is_callable([$class, 'factory'])) {
156 156
                 $class = Type\Text::class;
157 157
             }
158 158
 
159
-            $this->type = call_user_func([ $class, 'factory' ], $this->dbal, $this->columnDefinition);
159
+            $this->type = call_user_func([$class, 'factory'], $this->dbal, $this->columnDefinition);
160 160
         }
161 161
 
162 162
         return $this->type;
Please login to merge, or discard this patch.
src/Dbal/Pgsql.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
         if ($useAutoIncrement && $entity::isAutoIncremented()) {
51 51
             $statement .= ' RETURNING ' . $entity::getColumnName($entity::getPrimaryKeyVars()[0]);
52
-            $result    = $pdo->query($statement);
52
+            $result = $pdo->query($statement);
53 53
             $this->updateAutoincrement($entity, $result->fetchColumn());
54 54
         } else {
55 55
             $pdo->query($statement);
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     public function describe($schemaTable)
62 62
     {
63 63
         $table = explode($this->identifierDivider, $schemaTable);
64
-        list($schema, $table) = count($table) === 2 ? $table : [ 'public', $table[0] ];
64
+        list($schema, $table) = count($table) === 2 ? $table : ['public', $table[0]];
65 65
 
66 66
         $query = new QueryBuilder('INFORMATION_SCHEMA.COLUMNS', '', $this->entityManager);
67 67
         $query->where('table_name', $table)->andWhere('table_schema', $schema);
Please login to merge, or discard this patch.
src/Dbal/Mysql.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -92,8 +92,7 @@
 block discarded – undo
92 92
 
93 93
         $definition['column_name']              = $rawColumn['Field'];
94 94
         $definition['is_nullable']              = $rawColumn['Null'] === 'YES';
95
-        $definition['column_default']           = $rawColumn['Default'] !== null ? $rawColumn['Default'] :
96
-            ($rawColumn['Extra'] === 'auto_increment' ? 'sequence(AUTO_INCREMENT)' : null);
95
+        $definition['column_default']           = $rawColumn['Default'] !== null ? $rawColumn['Default'] : ($rawColumn['Extra'] === 'auto_increment' ? 'sequence(AUTO_INCREMENT)' : null);
97 96
         $definition['character_maximum_length'] = null;
98 97
         $definition['datetime_precision']       = null;
99 98
 
Please login to merge, or discard this patch.
src/Dbal/Sqlite.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     public function describe($schemaTable)
54 54
     {
55 55
         $table = explode($this->identifierDivider, $schemaTable);
56
-        list($schema, $table) = count($table) === 2 ? $table : [ null, $table[ 0 ] ];
56
+        list($schema, $table) = count($table) === 2 ? $table : [null, $table[0]];
57 57
         $schema = $schema !== null ? $this->escapeIdentifier($schema) . '.' : '';
58 58
 
59 59
         $result     = $this->entityManager->getConnection()->query(
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
     {
86 86
         return count(array_filter(array_map(
87 87
             function ($rawColumn) {
88
-                return $rawColumn[ 'pk' ];
88
+                return $rawColumn['pk'];
89 89
             },
90 90
             $rawColumns
91 91
         ))) > 1;
Please login to merge, or discard this patch.
src/QueryBuilder/QueryBuilder.php 1 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 1 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.