Conditions | 5 |
Paths | 16 |
Total Lines | 21 |
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 | |||
43 | if (count($httpDoc)) { |
||
44 | $normalizedDoc['http'] = $httpDoc; |
||
45 | } |
||
46 | |||
47 | return $normalizedDoc; |
||
48 | } |
||
50 |