Total Complexity | 5 |
Total Lines | 41 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | final class MusicFoldersResponder implements FormattedResponderInterface |
||
12 | { |
||
13 | /** |
||
14 | * @param Traversable<array{ |
||
15 | * name: string, |
||
16 | * id: string |
||
17 | * }> $musicFolders |
||
18 | */ |
||
19 | 4 | public function __construct( |
|
20 | private readonly Traversable $musicFolders |
||
21 | ) { |
||
22 | } |
||
23 | |||
24 | 1 | public function writeXml(XMLArray $XMLArray): void |
|
37 | ] |
||
38 | ); |
||
39 | } |
||
40 | } |
||
41 | ); |
||
42 | } |
||
43 | |||
44 | 1 | public function writeJson(array &$root): void |
|
45 | { |
||
46 | 1 | $root['musicFolders'] = ['musicFolder' => iterator_to_array($this->musicFolders)]; |
|
47 | } |
||
48 | |||
49 | 1 | public function isBinaryResponder(): bool |
|
52 | } |
||
53 | } |
||
54 |