Completed
Push — master ( e5c5d6...6b5dbf )
by Ivan
15:12
created
src/schema/TableColumn.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
             $instance->setLength($data['length']);
52 52
         }
53 53
         if ($instance->getBasicType() === 'enum' && strpos($instance->getType(), 'enum(') === 0) {
54
-            $temp = array_map(function ($v) {
54
+            $temp = array_map(function($v) {
55 55
                 return str_replace("''", "'", $v);
56 56
             }, explode("','", substr($instance->getType(), 6, -2)));
57 57
             $instance->setValues($temp);
Please login to merge, or discard this patch.
src/driver/pdo/Statement.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -24,28 +24,28 @@
 block discarded – undo
24 24
         foreach ($data as $i => $v) {
25 25
             switch (gettype($v)) {
26 26
                 case 'boolean':
27
-                    $this->statement->bindValue($i+1, $v, \PDO::PARAM_BOOL);
27
+                    $this->statement->bindValue($i + 1, $v, \PDO::PARAM_BOOL);
28 28
                     break;
29 29
                 case 'integer':
30
-                    $this->statement->bindValue($i+1, $v, \PDO::PARAM_INT);
30
+                    $this->statement->bindValue($i + 1, $v, \PDO::PARAM_INT);
31 31
                     break;
32 32
                 case 'NULL':
33
-                    $this->statement->bindValue($i+1, $v, \PDO::PARAM_NULL);
33
+                    $this->statement->bindValue($i + 1, $v, \PDO::PARAM_NULL);
34 34
                     break;
35 35
                 case 'double':
36
-                    $this->statement->bindValue($i+1, $v);
36
+                    $this->statement->bindValue($i + 1, $v);
37 37
                     break;
38 38
                 default:
39 39
                     // keep in mind oracle needs a transaction when inserting LOBs, aside from the specific syntax:
40 40
                     // INSERT INTO table (column, lobcolumn) VALUES (?, ?, EMPTY_BLOB()) RETURNING lobcolumn INTO ?
41 41
                     if (is_resource($v) && get_resource_type($v) === 'stream') {
42
-                        $this->statement->bindParam($i+1, $v, \PDO::PARAM_LOB);
42
+                        $this->statement->bindParam($i + 1, $v, \PDO::PARAM_LOB);
43 43
                         break;
44 44
                     }
45 45
                     if (!is_string($data[$i])) {
46 46
                         $data[$i] = serialize($data[$i]);
47 47
                     }
48
-                    $this->statement->bindValue($i+1, $v);
48
+                    $this->statement->bindValue($i + 1, $v);
49 49
                     break;
50 50
             }
51 51
         }
Please login to merge, or discard this patch.
src/driver/oracle/Driver.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
 
91 91
     public function begin() : bool
92 92
     {
93
-         return $this->transaction = true;
93
+            return $this->transaction = true;
94 94
     }
95 95
     public function commit() : bool
96 96
     {
Please login to merge, or discard this patch.
src/driver/mysql/Driver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
     {
38 38
         if ($this->lnk === null) {
39 39
             $this->lnk = new \mysqli(
40
-                (isset($this->connection['opts']['persist']) && $this->connection['opts']['persist'] ? 'p:' : '') .
40
+                (isset($this->connection['opts']['persist']) && $this->connection['opts']['persist'] ? 'p:' : '').
41 41
                     $this->connection['host'],
42 42
                 $this->connection['user'],
43 43
                 $this->connection['pass'],
Please login to merge, or discard this patch.
src/driver/oracle/Schema.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@
 block discarded – undo
124 124
                     }
125 125
                     return $new;
126 126
                 })
127
-                 as $relation
127
+                    as $relation
128 128
             ) {
129 129
                 $relations[$relation['CONSTRAINT_NAME']]['table'] = $relation['TABLE_NAME'];
130 130
                 $relations[$relation['CONSTRAINT_NAME']]['keymap'][$primary[(int)$relation['POSITION']-1]] =
Please login to merge, or discard this patch.
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -29,19 +29,19 @@  discard block
 block discarded – undo
29 29
         $columns = Collection::from($this
30 30
             ->query(
31 31
                 "SELECT * FROM all_tab_cols WHERE table_name = ? AND owner = ?",
32
-                [ strtoupper($table), $this->name() ]
32
+                [strtoupper($table), $this->name()]
33 33
             ))
34
-            ->map(function ($v) {
34
+            ->map(function($v) {
35 35
                 $new = [];
36 36
                 foreach ($v as $kk => $vv) {
37 37
                     $new[strtoupper($kk)] = $vv;
38 38
                 }
39 39
                 return $new;
40 40
             })
41
-            ->mapKey(function ($v) {
41
+            ->mapKey(function($v) {
42 42
                 return $v['COLUMN_NAME'];
43 43
             })
44
-            ->map(function ($v) {
44
+            ->map(function($v) {
45 45
                 $v['length'] = null;
46 46
                 if (!isset($v['DATA_TYPE'])) {
47 47
                     return $v;
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
                     default:
54 54
                         if (strpos($type, 'char') !== false && strpos($type, '(') !== false) {
55 55
                             // extract length from varchar
56
-                            $v['length'] = (int)explode(')', (explode('(', $type)[1] ?? ''))[0];
56
+                            $v['length'] = (int) explode(')', (explode('(', $type)[1] ?? ''))[0];
57 57
                             $v['length'] = $v['length'] > 0 ? $v['length'] : null;
58 58
                         }
59 59
                         break;
@@ -69,9 +69,9 @@  discard block
 block discarded – undo
69 69
             ->query(
70 70
                 "SELECT constraint_name FROM all_constraints
71 71
                 WHERE table_name = ? AND constraint_type = ? AND owner = ?",
72
-                [ strtoupper($table), 'P', $owner ]
72
+                [strtoupper($table), 'P', $owner]
73 73
             ))
74
-            ->map(function ($v) {
74
+            ->map(function($v) {
75 75
                 $new = [];
76 76
                 foreach ($v as $kk => $vv) {
77 77
                     $new[strtoupper($kk)] = $vv;
@@ -86,9 +86,9 @@  discard block
 block discarded – undo
86 86
                 ->query(
87 87
                     "SELECT column_name FROM all_cons_columns
88 88
                     WHERE table_name = ? AND constraint_name = ? AND owner = ?",
89
-                    [ strtoupper($table), $pkname, $owner ]
89
+                    [strtoupper($table), $pkname, $owner]
90 90
                 ))
91
-                ->map(function ($v) {
91
+                ->map(function($v) {
92 92
                     $new = [];
93 93
                     foreach ($v as $kk => $vv) {
94 94
                         $new[strtoupper($kk)] = $vv;
@@ -115,9 +115,9 @@  discard block
 block discarded – undo
115 115
                     LEFT JOIN all_cons_columns cc ON cc.OWNER = ac.OWNER AND cc.CONSTRAINT_NAME = ac.CONSTRAINT_NAME
116 116
                     WHERE ac.OWNER = ? AND ac.R_OWNER = ? AND ac.R_CONSTRAINT_NAME = ? AND ac.CONSTRAINT_TYPE = ?
117 117
                     ORDER BY cc.POSITION",
118
-                    [ $owner, $owner, $pkname, 'R' ]
118
+                    [$owner, $owner, $pkname, 'R']
119 119
                 ))
120
-                ->map(function ($v) {
120
+                ->map(function($v) {
121 121
                     $new = [];
122 122
                     foreach ($v as $kk => $vv) {
123 123
                         $new[strtoupper($kk)] = $vv;
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
                  as $relation
128 128
             ) {
129 129
                 $relations[$relation['CONSTRAINT_NAME']]['table'] = $relation['TABLE_NAME'];
130
-                $relations[$relation['CONSTRAINT_NAME']]['keymap'][$primary[(int)$relation['POSITION']-1]] =
130
+                $relations[$relation['CONSTRAINT_NAME']]['keymap'][$primary[(int) $relation['POSITION'] - 1]] =
131 131
                     $relation['COLUMN_NAME'];
132 132
             }
133 133
             foreach ($relations as $data) {
@@ -157,9 +157,9 @@  discard block
 block discarded – undo
157 157
                                 ac.OWNER = ? AND ac.R_OWNER = ? AND ac.TABLE_NAME = ? AND ac.CONSTRAINT_TYPE = ? AND
158 158
                                 cc.COLUMN_NAME IN (??)
159 159
                             ORDER BY POSITION",
160
-                            [ $owner, $owner, $data['table'], 'R', $columns ]
160
+                            [$owner, $owner, $data['table'], 'R', $columns]
161 161
                         ))
162
-                        ->map(function ($v) {
162
+                        ->map(function($v) {
163 163
                             $new = [];
164 164
                             foreach ($v as $kk => $vv) {
165 165
                                 $new[strtoupper($kk)] = $vv;
@@ -179,9 +179,9 @@  discard block
 block discarded – undo
179 179
                         ->query(
180 180
                             "SELECT COLUMN_NAME FROM all_cons_columns
181 181
                              WHERE OWNER = ? AND CONSTRAINT_NAME = ? ORDER BY POSITION",
182
-                            [ $owner, current($foreign['keymap']) ]
182
+                            [$owner, current($foreign['keymap'])]
183 183
                         ))
184
-                        ->map(function ($v) {
184
+                        ->map(function($v) {
185 185
                             $new = [];
186 186
                             foreach ($v as $kk => $vv) {
187 187
                                 $new[strtoupper($kk)] = $vv;
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
                     $relname = $foreign['table'];
197 197
                     $cntr = 1;
198 198
                     while ($definition->hasRelation($relname) || $definition->getName() == $relname) {
199
-                        $relname = $foreign['table'] . '_' . (++ $cntr);
199
+                        $relname = $foreign['table'].'_'.(++$cntr);
200 200
                     }
201 201
                     $definition->addRelation(
202 202
                         new TableRelation(
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
                     $relname = $data['table'];
213 213
                     $cntr = 1;
214 214
                     while ($definition->hasRelation($relname) || $definition->getName() == $relname) {
215
-                        $relname = $data['table'] . '_' . (++ $cntr);
215
+                        $relname = $data['table'].'_'.(++$cntr);
216 216
                     }
217 217
                     $definition->addRelation(
218 218
                         new TableRelation(
@@ -240,9 +240,9 @@  discard block
 block discarded – undo
240 240
                     LEFT JOIN all_cons_columns cc ON cc.OWNER = ac.OWNER AND cc.CONSTRAINT_NAME = ac.CONSTRAINT_NAME
241 241
                     WHERE ac.OWNER = ? AND ac.R_OWNER = ? AND ac.TABLE_NAME = ? AND ac.CONSTRAINT_TYPE = ?
242 242
                     ORDER BY cc.POSITION",
243
-                    [ $owner, $owner, strtoupper($table), 'R' ]
243
+                    [$owner, $owner, strtoupper($table), 'R']
244 244
                 ))
245
-                ->map(function ($v) {
245
+                ->map(function($v) {
246 246
                     $new = [];
247 247
                     foreach ($v as $kk => $vv) {
248 248
                         $new[strtoupper($kk)] = $vv;
@@ -260,9 +260,9 @@  discard block
 block discarded – undo
260 260
                     ->query(
261 261
                         "SELECT COLUMN_NAME FROM all_cons_columns
262 262
                          WHERE OWNER = ? AND CONSTRAINT_NAME = ? ORDER BY POSITION",
263
-                        [ $owner, current($data['keymap']) ]
263
+                        [$owner, current($data['keymap'])]
264 264
                     ))
265
-                    ->map(function ($v) {
265
+                    ->map(function($v) {
266 266
                         $new = [];
267 267
                         foreach ($v as $kk => $vv) {
268 268
                             $new[strtoupper($kk)] = $vv;
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
                 $relname = $data['table'];
278 278
                 $cntr = 1;
279 279
                 while ($definition->hasRelation($relname) || $definition->getName() == $relname) {
280
-                    $relname = $data['table'] . '_' . (++ $cntr);
280
+                    $relname = $data['table'].'_'.(++$cntr);
281 281
                 }
282 282
                 $definition->addRelation(
283 283
                     new TableRelation(
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
                 "SELECT TABLE_NAME FROM ALL_TABLES where OWNER = ?",
299 299
                 [$this->connection['name']]
300 300
             ))
301
-            ->map(function ($v) {
301
+            ->map(function($v) {
302 302
                 $new = [];
303 303
                 foreach ($v as $kk => $vv) {
304 304
                     $new[strtoupper($kk)] = $vv;
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
                 return $new;
307 307
             })
308 308
             ->pluck('TABLE_NAME')
309
-            ->map(function ($v) {
309
+            ->map(function($v) {
310 310
                 return $this->table($v);
311 311
             })
312 312
             ->toArray();
Please login to merge, or discard this patch.
src/driver/mysql/Result.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
                 if ($temp) {
30 30
                     $temp = $temp->fetch_fields();
31 31
                     if ($temp) {
32
-                        $columns = array_map(function ($v) {
32
+                        $columns = array_map(function($v) {
33 33
                             return $v->name;
34 34
                         }, $temp);
35 35
                     }
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
     }
71 71
     public function current()
72 72
     {
73
-        return $this->nativeDriver ? $this->last : array_map(function ($v) {
73
+        return $this->nativeDriver ? $this->last : array_map(function($v) {
74 74
             return $v;
75 75
         }, $this->row);
76 76
     }
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
     }
90 90
     public function next()
91 91
     {
92
-        $this->fetched ++;
92
+        $this->fetched++;
93 93
         $this->last = $this->nativeDriver ? $this->result->fetch_assoc() : $this->statement->fetch();
94 94
     }
95 95
     public function valid()
Please login to merge, or discard this patch.
src/driver/oracle/Result.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
     }
24 24
     public function affected() : int
25 25
     {
26
-        return (int)\oci_num_rows($this->statement);
26
+        return (int) \oci_num_rows($this->statement);
27 27
     }
28 28
     public function insertID()
29 29
     {
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
     }
65 65
     public function next()
66 66
     {
67
-        $this->fetched ++;
67
+        $this->fetched++;
68 68
         $this->last = \oci_fetch_array($this->statement, \OCI_ASSOC + \OCI_RETURN_NULLS + \OCI_RETURN_LOBS);
69 69
     }
70 70
     public function valid()
Please login to merge, or discard this patch.
src/schema/Entity.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,8 +47,7 @@
 block discarded – undo
47 47
         if (isset($this->definition->getRelations()[$method])) {
48 48
             if (array_key_exists($method, $this->fetched)) {
49 49
                 return is_callable($this->fetched[$method]) ?
50
-                    $this->fetched[$method] = call_user_func($this->fetched[$method], $args[0] ?? null) :
51
-                    $this->fetched[$method];
50
+                    $this->fetched[$method] = call_user_func($this->fetched[$method], $args[0] ?? null) : $this->fetched[$method];
52 51
             }
53 52
         }
54 53
         return null;
Please login to merge, or discard this patch.
src/driver/mysql/Statement.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@
 block discarded – undo
83 83
             }
84 84
         }
85 85
         if (!$this->statement->execute()) {
86
-            throw new DBException('Prepared execute error: ' . $this->statement->error);
86
+            throw new DBException('Prepared execute error: '.$this->statement->error);
87 87
         }
88 88
         return new Result($this->statement, $buff);
89 89
     }
Please login to merge, or discard this patch.