Conditions | 4 |
Paths | 8 |
Total Lines | 22 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
60 | public function toArray() : array |
||
61 | { |
||
62 | $result = [ |
||
63 | 'tags' => $this->tags, |
||
64 | 'summary' => $this->summary, |
||
65 | 'description' => $this->description, |
||
66 | 'deprecated' => $this->deprecated, |
||
67 | ]; |
||
68 | |||
69 | foreach ($this->parameters as $value) { |
||
70 | $result['parameters'][] = $value->toArray(); |
||
71 | } |
||
72 | |||
73 | if (isset($this->requestBody)) { |
||
74 | $result['requestBody'] = $this->requestBody->toArray(); |
||
75 | } |
||
76 | |||
77 | foreach ($this->responses as $value) { |
||
78 | $result['responses'][$value->code] = $value->toArray(); |
||
79 | } |
||
80 | |||
81 | return $result; |
||
82 | } |
||
84 |