Total Complexity | 8 |
Total Lines | 54 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | class Column |
||
8 | { |
||
9 | protected string $type; |
||
10 | protected ?int $length = null; |
||
11 | protected bool $isUnique = false; |
||
12 | protected ?string $default = null; |
||
13 | protected bool $isNotNull = false; |
||
14 | protected ?string $check = null; |
||
15 | protected ?string $comment = null; |
||
16 | |||
17 | public function __construct(string $type, ?int $length = null) |
||
21 | } |
||
22 | |||
23 | public function notNull(): self |
||
24 | { |
||
25 | $this->isNotNull = true; |
||
26 | return $this; |
||
27 | } |
||
28 | |||
29 | public function null(): self |
||
33 | } |
||
34 | |||
35 | public function unique(): self |
||
36 | { |
||
37 | $this->isUnique = true; |
||
38 | return $this; |
||
39 | } |
||
40 | |||
41 | public function check($check): self |
||
45 | } |
||
46 | |||
47 | public function defaultValue(?string $default): self |
||
55 | } |
||
56 | |||
57 | public function comment(?string $comment): self |
||
61 | } |
||
62 | } |
||
63 |