| Total Complexity | 8 |
| Total Lines | 77 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class CollectionKernelBuilder |
||
| 9 | { |
||
| 10 | protected array $items = []; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @var callable |
||
| 14 | */ |
||
| 15 | protected $factory; |
||
| 16 | |||
| 17 | protected ?string $identifier = null; |
||
| 18 | |||
| 19 | protected bool $map = false; |
||
| 20 | |||
| 21 | protected JsonSerializerInterface $jsonSerializer; |
||
| 22 | |||
| 23 | protected PropertyResolver $propertyResolver; |
||
| 24 | |||
| 25 | protected array $accessors = []; |
||
| 26 | |||
| 27 | public function withItems(array $items): self |
||
| 28 | { |
||
| 29 | $this->items = $items; |
||
| 30 | |||
| 31 | return $this; |
||
| 32 | } |
||
| 33 | |||
| 34 | public function withFactory(callable $factory): self |
||
| 35 | { |
||
| 36 | $this->factory = $factory; |
||
| 37 | |||
| 38 | return $this; |
||
| 39 | } |
||
| 40 | |||
| 41 | public function withAccessors(array $accessors): self |
||
| 42 | { |
||
| 43 | $this->accessors = $accessors; |
||
| 44 | |||
| 45 | return $this; |
||
| 46 | } |
||
| 47 | |||
| 48 | public function withIdentifier(string $identifier): self |
||
| 53 | } |
||
| 54 | |||
| 55 | public function withMapped(bool $map): self |
||
| 60 | } |
||
| 61 | |||
| 62 | public function withJsonSerializer(JsonSerializerInterface $jsonSerializer): self |
||
| 63 | { |
||
| 64 | $this->jsonSerializer = $jsonSerializer; |
||
| 65 | |||
| 66 | return $this; |
||
| 67 | } |
||
| 68 | |||
| 69 | public function withPropertyResolver(PropertyResolver $propertyResolver): self |
||
| 74 | } |
||
| 75 | |||
| 76 | public function build(): CollectionKernel |
||
| 88 |