| Total Complexity | 11 |
| Total Lines | 70 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class Uri implements Uriable |
||
| 9 | { |
||
| 10 | private $url; |
||
| 11 | private $base; |
||
| 12 | |||
| 13 | protected $params; |
||
| 14 | protected $urlParams; |
||
| 15 | |||
| 16 | public function __construct(array $options, array $additional = []) |
||
| 17 | { |
||
| 18 | $this->base = rtrim($additional['base_uri'], '/').'/'; |
||
| 19 | unset($additional['base_uri']); |
||
| 20 | |||
| 21 | $this->params = !empty($options['params']) ? $options['params'] : []; |
||
| 22 | $this->urlParams = !empty($options['url_params']) ? array_merge($options['url_params'], $additional) : $additional; |
||
| 23 | } |
||
| 24 | |||
| 25 | public function redirect() |
||
| 26 | { |
||
| 27 | return new RedirectResponse($this->getUrl()); |
||
| 28 | } |
||
| 29 | |||
| 30 | private function buildUrl() |
||
| 31 | { |
||
| 32 | $url = $this->base; |
||
| 33 | if (!empty($this->params)) { |
||
| 34 | $url .= implode('/', $this->params); |
||
| 35 | } |
||
| 36 | if (!empty($this->urlParams)) { |
||
| 37 | $params = http_build_query($this->urlParams); |
||
| 38 | $url .= '?'.$params; |
||
| 39 | } |
||
| 40 | $url = urldecode($url); |
||
| 41 | $this->setUrl($url); |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * Get the value of Url |
||
| 46 | * |
||
| 47 | * @return mixed |
||
| 48 | */ |
||
| 49 | public function getUrl() |
||
| 50 | { |
||
| 51 | $this->buildUrl(); |
||
| 52 | |||
| 53 | return $this->url; |
||
| 54 | } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * Set the value of Url |
||
| 58 | * |
||
| 59 | * @param mixed url |
||
|
|
|||
| 60 | * |
||
| 61 | * @return self |
||
| 62 | */ |
||
| 63 | public function setUrl($url) |
||
| 64 | { |
||
| 65 | $this->url = $url; |
||
| 66 | |||
| 67 | return $this; |
||
| 68 | } |
||
| 69 | |||
| 70 | public function addParam($value) |
||
| 73 | } |
||
| 74 | |||
| 75 | public function addUrlParam($name, $value) |
||
| 78 | } |
||
| 79 | } |
||
| 80 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths