Total Complexity | 9 |
Total Lines | 79 |
Duplicated Lines | 0 % |
Coverage | 81.25% |
Changes | 0 |
1 | <?php |
||
9 | class CollectionKernelBuilder |
||
10 | { |
||
11 | protected array $items = []; |
||
12 | |||
13 | protected Closure $generator; |
||
14 | |||
15 | protected array $accessors = []; |
||
16 | |||
17 | protected ?string $identifier = null; |
||
18 | |||
19 | protected bool $isMap = false; |
||
20 | |||
21 | protected ?JsonSerializerInterface $jsonSerializer = null; |
||
22 | |||
23 | 168 | public function withItems(array $items): self |
|
28 | } |
||
29 | |||
30 | 168 | public function withGenerator(Closure $generator): self |
|
31 | { |
||
32 | 168 | $this->generator = $generator; |
|
33 | |||
34 | 168 | return $this; |
|
35 | } |
||
36 | |||
37 | public function withAccessors(array $accessors): self |
||
42 | } |
||
43 | |||
44 | 168 | public function withIdentifier(?string $identifier): self |
|
45 | { |
||
46 | 168 | $this->identifier = $identifier; |
|
47 | |||
48 | 168 | return $this; |
|
49 | } |
||
50 | |||
51 | 24 | public function thatIsMapped(): self |
|
52 | { |
||
53 | 24 | $this->isMap = true; |
|
54 | |||
55 | 24 | return $this; |
|
56 | } |
||
57 | |||
58 | 144 | public function thatIsNotMapped(): self |
|
59 | { |
||
60 | 144 | $this->isMap = false; |
|
61 | |||
62 | 144 | return $this; |
|
63 | } |
||
64 | |||
65 | 120 | public function withMapped(bool $isMap): self |
|
70 | } |
||
71 | |||
72 | public function withJsonSerializer(JsonSerializerInterface $jsonSerializer): self |
||
77 | } |
||
78 | |||
79 | 168 | public function build(): CollectionKernel |
|
88 | ); |
||
89 | } |
||
90 | } |
||
91 |