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