We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Total Complexity | 9 |
Total Lines | 71 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
5 | final class Table |
||
6 | { |
||
7 | private string $name; |
||
8 | private array $columns = []; |
||
9 | |||
10 | public function __construct(string $name, array $columns = []) |
||
11 | { |
||
12 | $this->name = $name; |
||
13 | foreach ($columns as $column) { |
||
14 | $this->columns[$column['name']] = new class($column) |
||
15 | { |
||
16 | public function __construct(private array $column) |
||
17 | { |
||
18 | } |
||
19 | |||
20 | public function getName() |
||
21 | { |
||
22 | return $this->column['name']; |
||
23 | } |
||
24 | |||
25 | public function getNotnull() |
||
26 | { |
||
27 | return ! $this->column['nullable']; |
||
28 | } |
||
29 | |||
30 | public function getDefault() |
||
31 | { |
||
32 | return $this->column['default']; |
||
33 | } |
||
34 | |||
35 | public function getUnsigned() |
||
36 | { |
||
37 | return in_array('unsigned', explode(' ', $this->column['type'])); |
||
38 | } |
||
39 | |||
40 | public function getType() |
||
51 | } |
||
52 | }; |
||
53 | } |
||
54 | }; |
||
55 | } |
||
56 | } |
||
57 | |||
58 | public function getName(): string |
||
59 | { |
||
60 | return $this->name; |
||
61 | } |
||
62 | |||
63 | public function getColumns() |
||
64 | { |
||
65 | return $this->columns; |
||
66 | } |
||
67 | |||
68 | public function hasColumn(string $columnName) |
||
71 | } |
||
72 | |||
73 | public function getColumn(string $columnName) |
||
76 | } |
||
77 | } |
||
78 |