Skip to content

Commit 666fbfc

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

File tree

2 files changed

+4
-17
lines changed

2 files changed

+4
-17
lines changed

phpstan-baseline.php

Lines changed: 0 additions & 15 deletions
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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ function force_https(
481481
int $duration = 31_536_000,
482482
?RequestInterface $request = null,
483483
?ResponseInterface $response = null
484-
) {
484+
): void {
485485
$request ??= Services::request();
486486

487487
if (! $request instanceof IncomingRequest) {
@@ -590,7 +590,7 @@ function function_usable(string $functionName): bool
590590
*
591591
* @throws FileNotFoundException
592592
*/
593-
function helper($filenames)
593+
function helper($filenames): void
594594
{
595595
static $loaded = [];
596596

@@ -1139,6 +1139,8 @@ function stringify_attributes($attributes, bool $js = false): string
11391139
* returns its return value if any.
11401140
* Otherwise will start or stop the timer intelligently.
11411141
*
1142+
* @phpstan-param (callable(): mixed)|null $callable
1143+
*
11421144
* @return Timer
11431145
*/
11441146
function timer(?string $name = null, ?callable $callable = null)

0 commit comments

Comments
 (0)