|
29 | 29 | * @param array|string $relativePath URI string or array of URI segments. |
30 | 30 | * May include queries or fragments. |
31 | 31 | * @param App|null $config Alternative Config to use |
32 | | - * @param bool $indexPage Whether to add the $indexPage value |
33 | 32 | * |
34 | 33 | * @throws HTTPException For invalid paths. |
35 | 34 | * @throws InvalidArgumentException For invalid config. |
36 | 35 | */ |
37 | | - function _get_uri($relativePath = '', ?App $config = null, bool $indexPage = false): URI |
| 36 | + function _get_uri($relativePath = '', ?App $config = null): URI |
38 | 37 | { |
39 | 38 | $appConfig = null; |
40 | 39 | if ($config === null) { |
| 40 | + /** @var App $appConfig */ |
41 | 41 | $appConfig = config('App'); |
42 | 42 | } |
43 | 43 |
|
@@ -74,7 +74,7 @@ function _get_uri($relativePath = '', ?App $config = null, bool $indexPage = fal |
74 | 74 | } |
75 | 75 |
|
76 | 76 | // Check for an index page |
77 | | - if ($indexPage && $config->indexPage !== '') { |
| 77 | + if ($config->indexPage !== '') { |
78 | 78 | $url .= $config->indexPage; |
79 | 79 |
|
80 | 80 | // Check if we need a separator |
@@ -106,10 +106,11 @@ function site_url($relativePath = '', ?string $scheme = null, ?App $config = nul |
106 | 106 | { |
107 | 107 | $appConfig = null; |
108 | 108 | if ($config === null) { |
| 109 | + /** @var App $appConfig */ |
109 | 110 | $appConfig = config('App'); |
110 | 111 | } |
111 | 112 |
|
112 | | - $uri = _get_uri($relativePath, $config, true); |
| 113 | + $uri = _get_uri($relativePath, $config); |
113 | 114 |
|
114 | 115 | if ($config === null) { |
115 | 116 | $config = $appConfig; |
@@ -178,7 +179,7 @@ function current_url(bool $returnObject = false, ?IncomingRequest $request = nul |
178 | 179 | $relativePath .= '#' . $fragment; |
179 | 180 | } |
180 | 181 |
|
181 | | - $uri = _get_uri($relativePath, null, true); |
| 182 | + $uri = _get_uri($relativePath, null); |
182 | 183 |
|
183 | 184 | return $returnObject ? $uri : URI::createURIString($uri->getScheme(), $uri->getAuthority(), $uri->getPath()); |
184 | 185 | } |
|
0 commit comments