Skip to content

Commit bd72265

Browse files
committed
fix: types for common functions
1 parent bdbb775 commit bd72265

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

phpstan-baseline.php

-15
Original file line numberDiff line numberDiff line change
@@ -226,21 +226,6 @@
226226
'count' => 1,
227227
'path' => __DIR__ . '/system/Commands/Utilities/Routes/AutoRouterImproved/AutoRouteCollector.php',
228228
];
229-
$ignoreErrors[] = [
230-
'message' => '#^Function force_https\\(\\) has no return type specified\\.$#',
231-
'count' => 1,
232-
'path' => __DIR__ . '/system/Common.php',
233-
];
234-
$ignoreErrors[] = [
235-
'message' => '#^Function helper\\(\\) has no return type specified\\.$#',
236-
'count' => 1,
237-
'path' => __DIR__ . '/system/Common.php',
238-
];
239-
$ignoreErrors[] = [
240-
'message' => '#^Function timer\\(\\) has parameter \\$callable with no signature specified for callable\\.$#',
241-
'count' => 1,
242-
'path' => __DIR__ . '/system/Common.php',
243-
];
244229
$ignoreErrors[] = [
245230
'message' => '#^Method CodeIgniter\\\\ComposerScripts\\:\\:postUpdate\\(\\) has no return type specified\\.$#',
246231
'count' => 1,

system/Common.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,8 @@ function esc($data, string $context = 'html', ?string $encoding = null)
474474
* @param int $duration How long should the SSL header be set for? (in seconds)
475475
* Defaults to 1 year.
476476
*
477+
* @return never|void
478+
*
477479
* @throws HTTPException
478480
* @throws RedirectException
479481
*/
@@ -590,7 +592,7 @@ function function_usable(string $functionName): bool
590592
*
591593
* @throws FileNotFoundException
592594
*/
593-
function helper($filenames)
595+
function helper($filenames): void
594596
{
595597
static $loaded = [];
596598

@@ -1139,6 +1141,8 @@ function stringify_attributes($attributes, bool $js = false): string
11391141
* returns its return value if any.
11401142
* Otherwise will start or stop the timer intelligently.
11411143
*
1144+
* @phpstan-param (callable(): mixed)|null $callable
1145+
*
11421146
* @return Timer
11431147
*/
11441148
function timer(?string $name = null, ?callable $callable = null)

0 commit comments

Comments
 (0)