| Conditions | 4 |
| Paths | 8 |
| Total Lines | 17 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 40 | public function toArray() : array |
||
| 41 | { |
||
| 42 | $result = []; |
||
| 43 | |||
| 44 | if (isset($this->ref)) { |
||
| 45 | $result['$ref'] = $this->ref; |
||
| 46 | } |
||
| 47 | |||
| 48 | if (isset($this->type)) { |
||
| 49 | $result['type'] = $this->type; |
||
| 50 | } |
||
| 51 | |||
| 52 | foreach ($this->properties as $value) { |
||
| 53 | $result['properties'][$value->name] = $value->toArray(); |
||
| 54 | } |
||
| 55 | |||
| 56 | return $result; |
||
| 57 | } |
||
| 59 |