diff --git a/phpstan-baseline.php b/phpstan-baseline.php index 471a422ea745..4d1cde2372b4 100644 --- a/phpstan-baseline.php +++ b/phpstan-baseline.php @@ -521,21 +521,6 @@ 'count' => 8, 'path' => __DIR__ . '/system/Common.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Function force_https\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Common.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Function helper\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Common.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Function timer\\(\\) has parameter \\$callable with no signature specified for callable\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Common.php', -]; $ignoreErrors[] = [ 'message' => '#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#', 'count' => 2, diff --git a/system/Common.php b/system/Common.php index c964e10ea899..49c0f05af251 100644 --- a/system/Common.php +++ b/system/Common.php @@ -481,7 +481,7 @@ function force_https( int $duration = 31_536_000, ?RequestInterface $request = null, ?ResponseInterface $response = null - ) { + ): void { $request ??= Services::request(); if (! $request instanceof IncomingRequest) { @@ -590,7 +590,7 @@ function function_usable(string $functionName): bool * * @throws FileNotFoundException */ - function helper($filenames) + function helper($filenames): void { static $loaded = []; @@ -1139,6 +1139,8 @@ function stringify_attributes($attributes, bool $js = false): string * returns its return value if any. * Otherwise will start or stop the timer intelligently. * + * @phpstan-param (callable(): mixed)|null $callable + * * @return Timer */ function timer(?string $name = null, ?callable $callable = null)