Total Complexity | 4 |
Total Lines | 41 |
Duplicated Lines | 0 % |
Coverage | 80% |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | 94 | final class IndexConstraint extends Constraint |
|
16 | { |
||
17 | 94 | private bool $isUnique = false; |
|
18 | private bool $isPrimary = false; |
||
19 | |||
20 | /** |
||
21 | * @return bool Whether the index is unique. |
||
22 | */ |
||
23 | public function isUnique(): bool |
||
24 | { |
||
25 | return $this->isUnique; |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * @return bool Whether the index was created for a primary key. |
||
30 | 147 | */ |
|
31 | public function isPrimary(): bool |
||
34 | 147 | } |
|
35 | |||
36 | /** |
||
37 | * Set whether the index is unique. |
||
38 | * |
||
39 | * @param bool $value Whether the index is unique. |
||
40 | */ |
||
41 | public function unique(bool $value): self |
||
45 | } |
||
46 | 147 | ||
47 | /** |
||
48 | * Set whether the index was created for a primary key. |
||
49 | * |
||
50 | * @param bool $value whether the index was created for a primary key. |
||
51 | */ |
||
52 | public function primary(bool $value): self |
||
58 |