Skip to content

Commit

Permalink
Fix type issues in seriesreport.php
Browse files Browse the repository at this point in the history
  • Loading branch information
bakert committed Oct 8, 2024
1 parent 7b1ab3d commit 3cdab50
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
11 changes: 7 additions & 4 deletions gatherling/seriesreport.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@

use Gatherling\Views\Pages\SeriesReport;

use function Gatherling\Views\get;
use function Gatherling\Views\server;

require_once 'lib.php';

function main(): void
{
$seriesName = $_GET['series'] ?? null;
$season = $_GET['season'] ?? null;
$page = new SeriesReport($seriesName, (int) $season);
$seriesName = get()->optionalString('series');
$season = get()->int('season', 0);
$page = new SeriesReport($seriesName, $season);
$page->send();
}

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

-
message: "#^Cannot cast mixed to int\\.$#"
count: 1
path: gatherling/seriesreport.php

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

-
message: "#^Parameter \\#1 \\$seriesName of class Gatherling\\\\Views\\\\Pages\\\\SeriesReport constructor expects string\\|null, mixed given\\.$#"
count: 1
path: gatherling/seriesreport.php

-
message: "#^Parameter \\#3 \\$value of function curl_setopt expects array\\|string, string\\|false given\\.$#"
count: 1
Expand Down

0 comments on commit 3cdab50

Please sign in to comment.