Skip to content

Commit

Permalink
fix: types for common functions
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbalandan committed Sep 11, 2023
1 parent cc28c41 commit 7d3db2c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
15 changes: 0 additions & 15 deletions phpstan-baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 4 additions & 2 deletions system/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -590,7 +590,7 @@ function function_usable(string $functionName): bool
*
* @throws FileNotFoundException
*/
function helper($filenames)
function helper($filenames): void
{
static $loaded = [];

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 7d3db2c

Please sign in to comment.