Total Complexity | 9 |
Total Lines | 53 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
9 | trait KernelPoweredCollectionTrait |
||
10 | { |
||
11 | protected CollectionKernelInterface $kernel; |
||
12 | |||
13 | public function hasItems(): bool |
||
14 | { |
||
15 | return $this->kernel->hasItems(); |
||
16 | } |
||
17 | |||
18 | public function count(): int |
||
19 | { |
||
20 | return $this->kernel->count(); |
||
21 | } |
||
22 | |||
23 | public function values(): array |
||
24 | { |
||
25 | return $this->kernel->values(); |
||
26 | } |
||
27 | |||
28 | public function toArray(): array |
||
29 | { |
||
30 | return $this->kernel->toArray(); |
||
31 | } |
||
32 | |||
33 | public function toJson(): string |
||
34 | { |
||
35 | return $this->kernel->toJson(); |
||
36 | } |
||
37 | |||
38 | public function getIterator(): Traversable |
||
39 | { |
||
40 | return $this->kernel; |
||
41 | } |
||
42 | |||
43 | public function jsonSerialize(): array |
||
44 | { |
||
45 | return $this->kernel->jsonSerialize(); |
||
46 | } |
||
47 | |||
48 | protected function spawn(CollectionKernelInterface $kernel): ObjectCollectionInterface |
||
49 | { |
||
50 | $spawn = clone $this; |
||
51 | |||
52 | $spawn->kernel = $kernel; |
||
53 | |||
54 | return $spawn; |
||
|
|||
55 | } |
||
56 | |||
57 | protected function expose(ObjectCollectionInterface ...$collections): array |
||
62 | ); |
||
63 | } |
||
64 | } |
||
65 |