Completed
Push — master ( bbde74...290f10 )
by Ivan
13:51
created
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/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.
src/driver/ibase/Driver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
         $this->softDetect($sql);
72 72
         $statement = \ibase_prepare($this->transaction !== null ? $this->transaction : $this->lnk, $sql);
73 73
         if ($statement === false) {
74
-            throw new DBException('Prepare error: ' . \ibase_errmsg());
74
+            throw new DBException('Prepare error: '.\ibase_errmsg());
75 75
         }
76 76
         return new Statement(
77 77
             $statement,
Please login to merge, or discard this patch.
src/driver/oracle/Driver.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
                 $this->query("ALTER SESSION SET time_zone = '".addslashes($timezone)."'");
45 45
             }
46 46
             if ($schema = $this->option('schema')) {
47
-                $this->query("ALTER SESSION SET CURRENT_SCHEMA = " . $schema);
47
+                $this->query("ALTER SESSION SET CURRENT_SCHEMA = ".$schema);
48 48
             }
49 49
         }
50 50
     }
@@ -81,11 +81,11 @@  discard block
 block discarded – undo
81 81
         );
82 82
         if ($log) {
83 83
             $tm = microtime(true) - $tm;
84
-            if ($tm >= (float)$this->option('log_slow', 0)) {
84
+            if ($tm >= (float) $this->option('log_slow', 0)) {
85 85
                 @file_put_contents(
86 86
                     $log,
87
-                    '--' . date('Y-m-d H:i:s') . ' ' . sprintf('%01.6f', $tm) . "s\r\n" .
88
-                    $sql . "\r\n" .
87
+                    '--'.date('Y-m-d H:i:s').' '.sprintf('%01.6f', $tm)."s\r\n".
88
+                    $sql."\r\n".
89 89
                     "\r\n",
90 90
                     FILE_APPEND
91 91
                 );
Please login to merge, or discard this patch.
src/driver/oracle/Result.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
     }
25 25
     public function affected() : int
26 26
     {
27
-        return (int)\oci_num_rows($this->statement);
27
+        return (int) \oci_num_rows($this->statement);
28 28
     }
29 29
     public function insertID(string $sequence = null): mixed
30 30
     {
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 
38 38
     public function count(): int
39 39
     {
40
-        return (int)\oci_num_rows($this->statement);
40
+        return (int) \oci_num_rows($this->statement);
41 41
     }
42 42
 
43 43
     public function key(): mixed
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
     }
66 66
     public function next(): void
67 67
     {
68
-        $this->fetched ++;
69
-        $this->last = \oci_fetch_array($this->statement, \OCI_ASSOC + \OCI_RETURN_NULLS + \OCI_RETURN_LOBS)?:null;
68
+        $this->fetched++;
69
+        $this->last = \oci_fetch_array($this->statement, \OCI_ASSOC +\OCI_RETURN_NULLS +\OCI_RETURN_LOBS) ?: null;
70 70
         if (is_array($this->last)) {
71 71
             $this->cast();
72 72
         }
@@ -78,23 +78,23 @@  discard block
 block discarded – undo
78 78
     protected function cast(): void
79 79
     {
80 80
         if (!count($this->types)) {
81
-            foreach (array_keys($this->last??[]) as $k => $v) {
81
+            foreach (array_keys($this->last ?? []) as $k => $v) {
82 82
                 $this->types[$v] = \oci_field_type($this->statement, $k + 1);
83 83
                 if ($this->types[$v] === 'NUMBER') {
84 84
                     $scale = \oci_field_scale($this->statement, $k + 1);
85 85
                     $precision = \oci_field_precision($this->statement, $k + 1);
86 86
                     // true float
87
-                    if ((int)$scale === -127 && (int)$precision !== 0) {
87
+                    if ((int) $scale === -127 && (int) $precision !== 0) {
88 88
                         $this->types[$v] = 'FLOAT';
89 89
                     }
90 90
                     // TODO: decimal
91
-                    if ((int)$scale > 0) {
91
+                    if ((int) $scale > 0) {
92 92
                         $this->types[$v] = 'DECIMAL';
93 93
                     }
94 94
                 }
95 95
             }
96 96
         }
97
-        foreach ($this->last??[] as $k => $v) {
97
+        foreach ($this->last ?? [] as $k => $v) {
98 98
             if (!isset($this->types[$k])) {
99 99
                 continue;
100 100
             }
@@ -109,10 +109,10 @@  discard block
 block discarded – undo
109 109
             }
110 110
             switch ($this->types[$k]) {
111 111
                 case 'NUMBER':
112
-                    $this->last[$k] = (int)$v;
112
+                    $this->last[$k] = (int) $v;
113 113
                     break;
114 114
                 case 'FLOAT':
115
-                    $this->last[$k] = (float)$v;
115
+                    $this->last[$k] = (float) $v;
116 116
                     break;
117 117
             }
118 118
         }
Please login to merge, or discard this patch.