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