Conditions | 4 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
42 | 18 | public function resolve($wc_url, $url_to_resolve) |
|
43 | { |
||
44 | 18 | if ( strpos($url_to_resolve, '/') === false && $url_to_resolve !== 'trunk' ) { |
|
45 | 2 | return dirname($wc_url) . '/' . $url_to_resolve; |
|
46 | } |
||
47 | |||
48 | 16 | if ( preg_match('#^(/|\^/)(.*)$#', $url_to_resolve, $regs) ) { |
|
49 | 2 | return str_replace(parse_url($wc_url, PHP_URL_PATH), '/' . $regs[2], $wc_url); |
|
50 | } |
||
51 | |||
52 | 14 | return $this->repositoryConnector->getProjectUrl($wc_url) . '/' . $url_to_resolve; |
|
53 | } |
||
56 |