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