| Conditions | 1 |
| Paths | 1 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 33 | 4 | public function transform($url, $section) |
|
| 34 | { |
||
| 35 | 4 | $http = $this->request->getHttp(); |
|
| 36 | 4 | $httpSubdomain = $http->getSubdomain(); |
|
| 37 | 4 | $rootDomain = $http->getRootDomain(); |
|
| 38 | |||
| 39 | 4 | $replace = '://' . $section->getSubdomain() . '.' . $rootDomain; |
|
| 40 | $transform = [ |
||
| 41 | 4 | '://' . $httpSubdomain . '.' . $rootDomain => $replace, |
|
| 42 | 4 | '://' . $rootDomain => $replace, |
|
| 43 | ]; |
||
| 44 | |||
| 45 | 4 | $url = strtr($url, $transform); |
|
| 46 | 4 | return $url; |
|
| 47 | } |
||
| 57 | } |