Total Complexity | 5 |
Total Lines | 23 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
12 | class Wrap implements Constraint |
||
13 | { |
||
14 | private array $constraints; |
||
15 | |||
16 | public function __construct(array $constraints) |
||
19 | } |
||
20 | |||
21 | public function condition(Builder $builder): Builder |
||
22 | { |
||
23 | return $builder->where($this->apply($this->constraints)); |
||
24 | } |
||
25 | |||
26 | private function apply(array $constraints): Closure |
||
27 | { |
||
28 | return fn(Builder $builder) => $this->bind($builder, $constraints); |
||
29 | } |
||
30 | |||
31 | private function bind(Builder $builder, array $constraints): void |
||
35 | } |
||
36 | } |
||
37 | } |
||
38 |