@@ -24,28 +24,28 @@ |
||
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 | } |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | JOIN information_schema.constraint_table_usage ct ON kc.constraint_name = ct.constraint_name AND ct.table_schema = kc.table_schema |
148 | 148 | WHERE |
149 | 149 | kc.table_schema = ? AND kc.table_name IS NOT NULL AND kc.position_in_unique_constraint IS NOT NULL", |
150 | - [ $this->connection['opts']['schema'] ?? $this->connection['name'] ] |
|
150 | + [$this->connection['opts']['schema'] ?? $this->connection['name']] |
|
151 | 151 | ) |
152 | 152 | )->toArray(); |
153 | 153 | foreach ($col as $row) { |
@@ -159,10 +159,10 @@ discard block |
||
159 | 159 | $columns = Collection::from($this |
160 | 160 | ->query( |
161 | 161 | "SELECT * FROM information_schema.columns WHERE table_name = ? AND table_schema = ?", |
162 | - [ $table, $this->connection['opts']['schema'] ?? $this->connection['name'] ] |
|
162 | + [$table, $this->connection['opts']['schema'] ?? $this->connection['name']] |
|
163 | 163 | )) |
164 | - ->mapKey(function ($v) { return $v['column_name']; }) |
|
165 | - ->map(function ($v) { |
|
164 | + ->mapKey(function($v) { return $v['column_name']; }) |
|
165 | + ->map(function($v) { |
|
166 | 166 | $v['length'] = null; |
167 | 167 | if (!isset($v['data_type'])) { |
168 | 168 | return $v; |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | switch ($v['data_type']) { |
171 | 171 | case 'character': |
172 | 172 | case 'character varying': |
173 | - $v['length'] = (int)$v['character_maximum_length']; |
|
173 | + $v['length'] = (int) $v['character_maximum_length']; |
|
174 | 174 | break; |
175 | 175 | } |
176 | 176 | return $v; |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | ->query( |
184 | 184 | "SELECT constraint_name FROM information_schema.table_constraints |
185 | 185 | WHERE table_name = ? AND constraint_type = ? AND table_schema = ?", |
186 | - [ $table, 'PRIMARY KEY', $this->connection['opts']['schema'] ?? $this->connection['name'] ] |
|
186 | + [$table, 'PRIMARY KEY', $this->connection['opts']['schema'] ?? $this->connection['name']] |
|
187 | 187 | )) |
188 | 188 | ->pluck('constraint_name') |
189 | 189 | ->value(); |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | ->query( |
194 | 194 | "SELECT column_name FROM information_schema.constraint_column_usage |
195 | 195 | WHERE table_name = ? AND constraint_name = ? AND table_schema = ?", |
196 | - [ $table, $pkname, $this->connection['opts']['schema'] ?? $this->connection['name'] ] |
|
196 | + [$table, $pkname, $this->connection['opts']['schema'] ?? $this->connection['name']] |
|
197 | 197 | )) |
198 | 198 | ->pluck('column_name') |
199 | 199 | ->toArray(); |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | $usedcol = []; |
225 | 225 | if (count($columns)) { |
226 | 226 | foreach (Collection::from($relationsT[$data['table']] ?? []) |
227 | - ->filter(function ($v) use ($columns) { |
|
227 | + ->filter(function($v) use ($columns) { |
|
228 | 228 | return in_array($v['column_name'], $columns); |
229 | 229 | }) as $relation |
230 | 230 | ) { |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | $relname = $foreign['table']; |
239 | 239 | $cntr = 1; |
240 | 240 | while ($definition->hasRelation($relname) || $definition->getName() == $relname) { |
241 | - $relname = $foreign['table'] . '_' . (++ $cntr); |
|
241 | + $relname = $foreign['table'].'_'.(++$cntr); |
|
242 | 242 | } |
243 | 243 | $definition->addRelation( |
244 | 244 | new TableRelation( |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | $relname = $data['table']; |
255 | 255 | $cntr = 1; |
256 | 256 | while ($definition->hasRelation($relname) || $definition->getName() == $relname) { |
257 | - $relname = $data['table'] . '_' . (++ $cntr); |
|
257 | + $relname = $data['table'].'_'.(++$cntr); |
|
258 | 258 | } |
259 | 259 | $definition->addRelation( |
260 | 260 | new TableRelation( |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | $relname = $data['table']; |
279 | 279 | $cntr = 1; |
280 | 280 | while ($definition->hasRelation($relname) || $definition->getName() == $relname) { |
281 | - $relname = $data['table'] . '_' . (++ $cntr); |
|
281 | + $relname = $data['table'].'_'.(++$cntr); |
|
282 | 282 | } |
283 | 283 | $definition->addRelation( |
284 | 284 | new TableRelation( |
@@ -297,10 +297,10 @@ discard block |
||
297 | 297 | return Collection::from($this |
298 | 298 | ->query( |
299 | 299 | "SELECT table_name FROM information_schema.tables where table_schema = ?", |
300 | - [ $this->connection['opts']['schema'] ?? $this->connection['name'] ] |
|
300 | + [$this->connection['opts']['schema'] ?? $this->connection['name']] |
|
301 | 301 | )) |
302 | 302 | ->pluck('table_name') |
303 | - ->map(function ($v) { |
|
303 | + ->map(function($v) { |
|
304 | 304 | return $this->table($v); |
305 | 305 | }) |
306 | 306 | ->toArray(); |