| Total Complexity | 5 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 5 | final class ResultCollector implements ResultCollectorInterface |
||
| 6 | { |
||
| 7 | /** @var array<ResultInterface> */ |
||
| 8 | private $listResult; |
||
| 9 | |||
| 10 | /** |
||
| 11 | * @param array<ResultInterface> $result |
||
| 12 | */ |
||
| 13 | public function __construct(array $result = []) |
||
| 14 | { |
||
| 15 | $this->listResult = $result; |
||
| 16 | } |
||
| 17 | |||
| 18 | public function addResult(ResultInterface $result): void |
||
| 19 | { |
||
| 20 | $this->listResult[] = $result; |
||
| 21 | } |
||
| 22 | |||
| 23 | public function count(): int |
||
| 24 | { |
||
| 25 | return \count($this->listResult); |
||
| 26 | } |
||
| 27 | |||
| 28 | /** @return array<ResultInterface> */ |
||
| 29 | public function get(): array |
||
| 30 | { |
||
| 31 | return $this->listResult; |
||
| 32 | } |
||
| 33 | |||
| 34 | public function emptyResult(): void |
||
| 37 | } |
||
| 38 | } |
||
| 39 |