Conditions | 4 |
Paths | 2 |
Total Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
13 | 3 | public function __invoke(string $relativeUrl = null, array $parameters = [], string $argSeparator = '&'): string |
|
14 | { |
||
15 | 3 | if (!$this->view || !($request = $this->view->getRequest())) { |
|
16 | 1 | throw new \LogicException('View request is required for this view helper'); |
|
17 | } |
||
18 | |||
19 | 2 | $url = new \Starlit\Utils\Url($relativeUrl ?: $request->getRequestUri()); |
|
20 | 2 | $url->addQueryParameters($parameters, true, $argSeparator); |
|
21 | |||
22 | 2 | return (string) $url; |
|
23 | } |
||
24 | } |
||
25 |