| Conditions | 5 |
| Paths | 16 |
| Total Lines | 20 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 5 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | 10 | public function normalize(HttpServerDoc $doc) : array |
|
| 28 | { |
||
| 29 | 10 | $normalizedDoc = $this->serverDocNormalizer->normalize($doc); |
|
| 30 | |||
| 31 | // Append http infos |
||
| 32 | 10 | $httpDoc = []; |
|
| 33 | 10 | if (null !== $doc->getHost()) { |
|
| 34 | 2 | $httpDoc['host'] = $doc->getHost(); |
|
| 35 | } |
||
| 36 | 10 | if (null !== $doc->getBasePath()) { |
|
| 37 | 2 | $httpDoc['base-path'] = $doc->getBasePath(); |
|
| 38 | } |
||
| 39 | 10 | if (count($doc->getSchemeList())) { |
|
| 40 | 2 | $httpDoc['schemes'] = $doc->getSchemeList(); |
|
| 41 | } |
||
| 42 | 10 | if (count($httpDoc)) { |
|
| 43 | 4 | $normalizedDoc['http'] = $httpDoc; |
|
| 44 | } |
||
| 45 | |||
| 46 | 10 | return $normalizedDoc; |
|
| 47 | } |
||
| 49 |