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