Skip to content

Commit

Permalink
Fix type error in updateDefaultFormats
Browse files Browse the repository at this point in the history
Here endeth the superglobal typesafing.
  • Loading branch information
bakert committed Oct 8, 2024
1 parent 61a0e5c commit 7160ffc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 3 additions & 1 deletion gatherling/util/updateDefaultFormats.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
use Gatherling\Models\Formats;
use Gatherling\Exceptions\SetMissingException;

use function Gatherling\Views\server;

set_time_limit(0);

require_once __DIR__ . '/../lib.php';
Expand All @@ -30,6 +32,6 @@ function main(): void
}
}

if (basename(__FILE__) == basename($_SERVER['PHP_SELF'])) {
if (basename(__FILE__) == basename(server()->string('PHP_SELF'))) {
main();
}
5 changes: 0 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -3985,11 +3985,6 @@ parameters:
count: 1
path: gatherling/util/updateDefaultFormats.php

-
message: "#^Parameter \\#1 \\$path of function basename expects string, mixed given\\.$#"
count: 1
path: gatherling/util/updateDefaultFormats.php

-
message: "#^Offset 'name' might not exist on array\\<string, mixed\\>\\|null\\.$#"
count: 1
Expand Down

0 comments on commit 7160ffc

Please sign in to comment.