Total Complexity | 4 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | abstract class AbstractCollection implements ShellInterface |
||
15 | { |
||
16 | /** @var CollectionTuple|null */ |
||
17 | protected $tuple; |
||
18 | |||
19 | /** |
||
20 | * @param string|ShellInterface $command |
||
21 | * @param string $join |
||
22 | * @return CollectionTuple |
||
23 | * @throws ShellBuilderException |
||
24 | */ |
||
25 | protected function toTuple($command, string $join): CollectionTuple |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * @return array<string|ShellInterface|array<mixed>> |
||
32 | * @throws ShellBuilderException |
||
33 | */ |
||
34 | public function __toArray(): array |
||
35 | { |
||
36 | if ($this->tuple === null) { |
||
37 | throw new ShellBuilderException('Tuple has not been set yet - collection cannot be parsed to array'); |
||
38 | } |
||
39 | return $this->tuple->__toArray(); |
||
40 | } |
||
41 | |||
42 | public function __toString(): string |
||
45 | } |
||
46 | } |
||
47 |