Skip to content

Commit 334a44c

Browse files
committed
refactor: remove unneeded parameter $indexPage
1 parent f3f216c commit 334a44c

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

system/Helpers/url_helper.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@
2929
* @param array|string $relativePath URI string or array of URI segments.
3030
* May include queries or fragments.
3131
* @param App|null $config Alternative Config to use
32-
* @param bool $indexPage Whether to add the $indexPage value
3332
*
3433
* @throws HTTPException For invalid paths.
3534
* @throws InvalidArgumentException For invalid config.
3635
*/
37-
function _get_uri($relativePath = '', ?App $config = null, bool $indexPage = false): URI
36+
function _get_uri($relativePath = '', ?App $config = null): URI
3837
{
3938
$appConfig = null;
4039
if ($config === null) {
40+
/** @var App $appConfig */
4141
$appConfig = config('App');
4242
}
4343

@@ -74,7 +74,7 @@ function _get_uri($relativePath = '', ?App $config = null, bool $indexPage = fal
7474
}
7575

7676
// Check for an index page
77-
if ($indexPage && $config->indexPage !== '') {
77+
if ($config->indexPage !== '') {
7878
$url .= $config->indexPage;
7979

8080
// Check if we need a separator
@@ -106,10 +106,11 @@ function site_url($relativePath = '', ?string $scheme = null, ?App $config = nul
106106
{
107107
$appConfig = null;
108108
if ($config === null) {
109+
/** @var App $appConfig */
109110
$appConfig = config('App');
110111
}
111112

112-
$uri = _get_uri($relativePath, $config, true);
113+
$uri = _get_uri($relativePath, $config);
113114

114115
if ($config === null) {
115116
$config = $appConfig;
@@ -178,7 +179,7 @@ function current_url(bool $returnObject = false, ?IncomingRequest $request = nul
178179
$relativePath .= '#' . $fragment;
179180
}
180181

181-
$uri = _get_uri($relativePath, null, true);
182+
$uri = _get_uri($relativePath, null);
182183

183184
return $returnObject ? $uri : URI::createURIString($uri->getScheme(), $uri->getAuthority(), $uri->getPath());
184185
}

0 commit comments

Comments
 (0)