| Conditions | 3 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | 3 | public function normalize(ErrorDoc $errorDoc) : array |
|
| 28 | { |
||
| 29 | 3 | $properties = ['code' => $errorDoc->getCode()]; |
|
| 30 | 3 | if (null !== $errorDoc->getDataDoc()) { |
|
| 31 | 1 | $properties['data'] = $this->typeDocNormalizer->normalize($errorDoc->getDataDoc()); |
|
| 32 | } |
||
| 33 | 3 | if (null !== $errorDoc->getMessage()) { |
|
| 34 | 1 | $properties['message'] = $errorDoc->getMessage(); |
|
| 35 | } |
||
| 36 | |||
| 37 | return [ |
||
| 38 | 3 | 'id' => $errorDoc->getIdentifier(), |
|
| 39 | 3 | 'title' => $errorDoc->getTitle(), |
|
| 40 | 3 | 'type' => 'object', |
|
| 41 | 3 | 'properties' => $properties, |
|
| 42 | ]; |
||
| 45 |