Conditions | 5 |
Paths | 4 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
44 | public function toArray() |
||
45 | { |
||
46 | $data = ['encoders' => [], 'decoders' => []]; |
||
47 | |||
48 | if (null !== $this->decoders) { |
||
49 | foreach ($this->decoders as $decoder) { |
||
50 | $data['decoders'][$this->getMediaType($decoder)] = $decoder->decoder; |
||
51 | } |
||
52 | } |
||
53 | |||
54 | if (null !== $this->encoders) { |
||
55 | foreach ($this->encoders as $encoder) { |
||
56 | $data['encoders'][$this->getMediaType($encoder)] = $encoder->encoder; |
||
57 | } |
||
58 | } |
||
59 | |||
60 | return $data; |
||
61 | } |
||
62 | |||
71 | } |