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