Total Complexity | 5 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
14 | final class ChannelAdapter implements AdapterInterface |
||
15 | { |
||
16 | /** |
||
17 | * @param string $content |
||
18 | * @return Channel |
||
19 | */ |
||
20 | public function convertJson(string $content): Channel |
||
21 | { |
||
22 | $channel = json_decode($content); |
||
23 | |||
24 | return $this->stdClassToChannel($channel); |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * @param string $content |
||
29 | * @return array|Channel[] |
||
30 | */ |
||
31 | public function convertJsonArray(string $content): array |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * @param stdClass $channel |
||
48 | * @return Channel |
||
49 | */ |
||
50 | private function stdClassToChannel(stdClass $channel): Channel |
||
61 |