Completed
Push — master ( 64839c...c17d6d )
by Ivan
12:22 queued 13s
created
src/driver/mysql/Result.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
                 if ($temp) {
33 33
                     $temp = $temp->fetch_fields();
34 34
                     if ($temp) {
35
-                        $columns = array_map(function ($v) {
35
+                        $columns = array_map(function($v) {
36 36
                             return $v->name;
37 37
                         }, $temp);
38 38
                     }
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     }
54 54
     public function affected() : int
55 55
     {
56
-        return (int)$this->statement->affected_rows;
56
+        return (int) $this->statement->affected_rows;
57 57
     }
58 58
     public function insertID(string $sequence = null): mixed
59 59
     {
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     }
76 76
     public function current(): mixed
77 77
     {
78
-        return $this->nativeDriver ? $this->last : array_map(function ($v) {
78
+        return $this->nativeDriver ? $this->last : array_map(function($v) {
79 79
             return $v;
80 80
         }, $this->row);
81 81
     }
@@ -94,8 +94,8 @@  discard block
 block discarded – undo
94 94
     }
95 95
     public function next(): void
96 96
     {
97
-        $this->fetched ++;
98
-        $this->last = $this->nativeDriver ? ($this->result->fetch_assoc()?:null) : $this->statement->fetch();
97
+        $this->fetched++;
98
+        $this->last = $this->nativeDriver ? ($this->result->fetch_assoc() ?: null) : $this->statement->fetch();
99 99
     }
100 100
     public function valid(): bool
101 101
     {
Please login to merge, or discard this patch.
src/driver/mysql/Statement.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
             foreach ($lng as $index) {
78 78
                 if (is_resource($data[$index]) && get_resource_type($data[$index]) === 'stream') {
79 79
                     while (!feof($data[$index])) {
80
-                        $this->statement->send_long_data($index, (string)fread($data[$index], $lds));
80
+                        $this->statement->send_long_data($index, (string) fread($data[$index], $lds));
81 81
                     }
82 82
                 } else {
83 83
                     $data[$index] = str_split($data[$index], $lds);
@@ -92,24 +92,24 @@  discard block
 block discarded – undo
92 92
             $tm = microtime(true);
93 93
         }
94 94
         if (!$this->statement->execute()) {
95
-            if ($log && (int)$this->driver->option('log_errors', 1)) {
95
+            if ($log && (int) $this->driver->option('log_errors', 1)) {
96 96
                 @file_put_contents(
97 97
                     $log,
98
-                    '--' . date('Y-m-d H:i:s') . ' ERROR: ' . $this->statement->error . "\r\n" .
99
-                    $this->sql . "\r\n" .
98
+                    '--'.date('Y-m-d H:i:s').' ERROR: '.$this->statement->error."\r\n".
99
+                    $this->sql."\r\n".
100 100
                     "\r\n",
101 101
                     FILE_APPEND
102 102
                 );
103 103
             }
104
-            throw new DBException('Prepared execute error: ' . $this->statement->error);
104
+            throw new DBException('Prepared execute error: '.$this->statement->error);
105 105
         }
106 106
         if ($log) {
107 107
             $tm = microtime(true) - $tm;
108
-            if ($tm >= (float)$this->driver->option('log_slow', 0)) {
108
+            if ($tm >= (float) $this->driver->option('log_slow', 0)) {
109 109
                 @file_put_contents(
110 110
                     $log,
111
-                    '--' . date('Y-m-d H:i:s') . ' ' . sprintf('%01.6f', $tm) . "s\r\n" .
112
-                    $this->sql . "\r\n" .
111
+                    '--'.date('Y-m-d H:i:s').' '.sprintf('%01.6f', $tm)."s\r\n".
112
+                    $this->sql."\r\n".
113 113
                     "\r\n",
114 114
                     FILE_APPEND
115 115
                 );
Please login to merge, or discard this patch.
src/driver/sphinx/Result.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,8 +57,8 @@
 block discarded – undo
57 57
     }
58 58
     public function next(): void
59 59
     {
60
-        $this->fetched ++;
61
-        $this->last = $this->result->fetch_assoc()?:null;
60
+        $this->fetched++;
61
+        $this->last = $this->result->fetch_assoc() ?: null;
62 62
     }
63 63
     public function valid(): bool
64 64
     {
Please login to merge, or discard this patch.
src/driver/sphinx/Statement.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -40,23 +40,23 @@
 block discarded – undo
40 40
                             break;
41 41
                         case 'array':
42 42
                             $par = implode(',', $par);
43
-                            $par = "'" . $this->lnk->escape_string($par) . "'";
43
+                            $par = "'".$this->lnk->escape_string($par)."'";
44 44
                             break;
45 45
                         case 'object':
46 46
                             $par = serialize($par);
47
-                            $par = "'" . $this->lnk->escape_string($par) . "'";
47
+                            $par = "'".$this->lnk->escape_string($par)."'";
48 48
                             break;
49 49
                         case 'resource':
50 50
                             if (is_resource($par) && get_resource_type($par) === 'stream') {
51 51
                                 $par = stream_get_contents($par);
52
-                                $par = "'" . $this->lnk->escape_string($par) . "'";
52
+                                $par = "'".$this->lnk->escape_string($par)."'";
53 53
                             } else {
54 54
                                 $par = serialize($par);
55
-                                $par = "'" . $this->lnk->escape_string($par) . "'";
55
+                                $par = "'".$this->lnk->escape_string($par)."'";
56 56
                             }
57 57
                             break;
58 58
                         default:
59
-                            $par = "'" . $this->lnk->escape_string((string)$par) . "'";
59
+                            $par = "'".$this->lnk->escape_string((string) $par)."'";
60 60
                             break;
61 61
                     }
62 62
                     $sql .= $par;
Please login to merge, or discard this patch.
src/driver/odbc/Result.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@
 block discarded – undo
78 78
     }
79 79
     public function next(): void
80 80
     {
81
-        $this->fetched ++;
81
+        $this->fetched++;
82 82
         $temp = \odbc_fetch_row($this->statement);
83 83
         if (!$temp) {
84 84
             $this->last = null;
Please login to merge, or discard this patch.
src/driver/postgre/Statement.php 1 patch
Spacing   +12 added lines, -14 removed lines patch added patch discarded remove patch
@@ -23,17 +23,17 @@  discard block
 block discarded – undo
23 23
         if (strpos(strtolower($statement), 'prepare') === 0) {
24 24
             $this->drv->raw($this->statement);
25 25
             if (!isset($this->name)) {
26
-                $this->name = trim((preg_split('(\s+)', trim($this->statement))?:[])[1]??'', '"');
26
+                $this->name = trim((preg_split('(\s+)', trim($this->statement)) ?: [])[1] ?? '', '"');
27 27
             }
28 28
         } elseif ($this->name !== null) {
29 29
             $temp = \pg_prepare($this->driver, $this->name, $this->statement);
30 30
             if (!$temp) {
31 31
                 $log = $this->drv->option('log_file');
32
-                if ($log && (int)$this->drv->option('log_errors', 1)) {
32
+                if ($log && (int) $this->drv->option('log_errors', 1)) {
33 33
                     @file_put_contents(
34 34
                         $log,
35
-                        '--' . date('Y-m-d H:i:s') . ' ERROR PREPARING: ' . \pg_last_error($this->driver) . "\r\n" .
36
-                        $this->statement . "\r\n" .
35
+                        '--'.date('Y-m-d H:i:s').' ERROR PREPARING: '.\pg_last_error($this->driver)."\r\n".
36
+                        $this->statement."\r\n".
37 37
                         "\r\n",
38 38
                         FILE_APPEND
39 39
                     );
@@ -59,19 +59,17 @@  discard block
 block discarded – undo
59 59
         }
60 60
         if ($this->name !== null) {
61 61
             $temp = (is_array($data) && count($data)) ?
62
-                \pg_execute($this->driver, $this->name, $data) :
63
-                \pg_execute($this->driver, $this->name, array());
62
+                \pg_execute($this->driver, $this->name, $data) : \pg_execute($this->driver, $this->name, array());
64 63
         } else {
65 64
             $temp = (is_array($data) && count($data)) ?
66
-                \pg_query_params($this->driver, $this->statement, $data) :
67
-                \pg_query_params($this->driver, $this->statement, array());
65
+                \pg_query_params($this->driver, $this->statement, $data) : \pg_query_params($this->driver, $this->statement, array());
68 66
         }
69 67
         if (!$temp) {
70
-            if ($log && (int)$this->drv->option('log_errors', 1)) {
68
+            if ($log && (int) $this->drv->option('log_errors', 1)) {
71 69
                 @file_put_contents(
72 70
                     $log,
73
-                    '--' . date('Y-m-d H:i:s') . ' ERROR: ' . \pg_last_error($this->driver) . "\r\n" .
74
-                    $this->statement . "\r\n" .
71
+                    '--'.date('Y-m-d H:i:s').' ERROR: '.\pg_last_error($this->driver)."\r\n".
72
+                    $this->statement."\r\n".
75 73
                     "\r\n",
76 74
                     FILE_APPEND
77 75
                 );
@@ -80,11 +78,11 @@  discard block
 block discarded – undo
80 78
         }
81 79
         if ($log) {
82 80
             $tm = microtime(true) - $tm;
83
-            if ($tm >= (float)$this->drv->option('log_slow', 0)) {
81
+            if ($tm >= (float) $this->drv->option('log_slow', 0)) {
84 82
                 @file_put_contents(
85 83
                     $log,
86
-                    '--' . date('Y-m-d H:i:s') . ' ' . sprintf('%01.6f', $tm) . "s\r\n" .
87
-                    $this->statement . "\r\n" .
84
+                    '--'.date('Y-m-d H:i:s').' '.sprintf('%01.6f', $tm)."s\r\n".
85
+                    $this->statement."\r\n".
88 86
                     "\r\n",
89 87
                     FILE_APPEND
90 88
                 );
Please login to merge, or discard this patch.
src/driver/sqlite/Result.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,8 +62,8 @@
 block discarded – undo
62 62
     }
63 63
     public function next(): void
64 64
     {
65
-        $this->fetched ++;
66
-        $this->last = $this->statement->fetchArray(\SQLITE3_ASSOC)?:null;
65
+        $this->fetched++;
66
+        $this->last = $this->statement->fetchArray(\SQLITE3_ASSOC) ?: null;
67 67
     }
68 68
     public function valid(): bool
69 69
     {
Please login to merge, or discard this patch.
src/driver/ibase/Result.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -67,8 +67,8 @@
 block discarded – undo
67 67
     }
68 68
     public function next(): void
69 69
     {
70
-        $this->fetched ++;
71
-        $this->last = \ibase_fetch_assoc($this->result, \IBASE_TEXT)?:null;
70
+        $this->fetched++;
71
+        $this->last = \ibase_fetch_assoc($this->result, \IBASE_TEXT) ?: null;
72 72
     }
73 73
     public function valid(): bool
74 74
     {
Please login to merge, or discard this patch.
src/schema/Table.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -79,10 +79,10 @@  discard block
 block discarded – undo
79 79
      * @param  array|string        $column either a single column name or an array of column names
80 80
      * @return  static
81 81
      */
82
-    public function setPrimaryKey(array|string $column): static
82
+    public function setPrimaryKey(array | string $column): static
83 83
     {
84 84
         if (!is_array($column)) {
85
-            $column = [ $column ];
85
+            $column = [$column];
86 86
         }
87 87
         $this->data['primary'] = array_values($column);
88 88
         return $this;
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
      */
110 110
     public function getFullName(): string
111 111
     {
112
-        return ($this->data['schema'] ? $this->data['schema'] . '.' : '') . $this->data['name'];
112
+        return ($this->data['schema'] ? $this->data['schema'].'.' : '').$this->data['name'];
113 113
     }
114 114
     /**
115 115
      * Get a column definition
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
     public function hasOne(
157 157
         Table $toTable,
158 158
         string $name = null,
159
-        string|array|null $toTableColumn = null,
159
+        string | array | null $toTableColumn = null,
160 160
         string $sql = null,
161 161
         array $par = []
162 162
     ) : static {
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
         }
185 185
 
186 186
         if (!isset($name)) {
187
-            $name = $toTable->getName() . '_' . implode('_', array_keys($keymap));
187
+            $name = $toTable->getName().'_'.implode('_', array_keys($keymap));
188 188
         }
189 189
         $this->addRelation(new TableRelation(
190 190
             $name,
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
     public function hasMany(
211 211
         Table $toTable,
212 212
         string $name = null,
213
-        string|array|null $toTableColumn = null,
213
+        string | array | null $toTableColumn = null,
214 214
         ?string $sql = null,
215 215
         array $par = []
216 216
     ): static {
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
     public function belongsTo(
265 265
         Table $toTable,
266 266
         string $name = null,
267
-        string|array|null $localColumn = null,
267
+        string | array | null $localColumn = null,
268 268
         ?string $sql = null,
269 269
         array $par = []
270 270
     ): static {
@@ -319,8 +319,8 @@  discard block
 block discarded – undo
319 319
         Table $toTable,
320 320
         Table $pivot,
321 321
         ?string $name = null,
322
-        string|array|null $toTableColumn = null,
323
-        string|array|null $localColumn = null
322
+        string | array | null $toTableColumn = null,
323
+        string | array | null $localColumn = null
324 324
     ): static {
325 325
         $pivotColumns = $pivot->getColumns();
326 326
 
Please login to merge, or discard this patch.