Skip to content

Commit 9c6189b

Browse files
committed
Fix PHPStan issues for /src/Utils/Scoreboard/*
All bundled in one commit to not flood the history, all of these should be trivial on itself but help PHPStan to detect more issues.
1 parent ad08538 commit 9c6189b

File tree

3 files changed

+12
-25
lines changed

3 files changed

+12
-25
lines changed

phpstan-baseline.neon

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,28 +1069,3 @@ parameters:
10691069
message: "#^Method App\\\\Twig\\\\TwigExtension\\:\\:runDiff\\(\\) has parameter \\$runOutput with no value type specified in iterable type array\\.$#"
10701070
count: 1
10711071
path: webapp/src/Twig/TwigExtension.php
1072-
1073-
-
1074-
message: "#^Method App\\\\Utils\\\\Scoreboard\\\\Scoreboard\\:\\:getUsedCategories\\(\\) has parameter \\$limitToTeamIds with no value type specified in iterable type array\\.$#"
1075-
count: 1
1076-
path: webapp/src/Utils/Scoreboard/Scoreboard.php
1077-
1078-
-
1079-
message: "#^Method App\\\\Utils\\\\Scoreboard\\\\Scoreboard\\:\\:hasCategoryColors\\(\\) has parameter \\$limitToTeamIds with no value type specified in iterable type array\\.$#"
1080-
count: 1
1081-
path: webapp/src/Utils/Scoreboard/Scoreboard.php
1082-
1083-
-
1084-
message: "#^Method App\\\\Utils\\\\Scoreboard\\\\Scoreboard\\:\\:isBestInCategory\\(\\) has parameter \\$limitToTeamIds with no value type specified in iterable type array\\.$#"
1085-
count: 1
1086-
path: webapp/src/Utils/Scoreboard/Scoreboard.php
1087-
1088-
-
1089-
message: "#^Property App\\\\Utils\\\\Scoreboard\\\\Scoreboard\\:\\:\\$bestInCategoryData type has no value type specified in iterable type array\\.$#"
1090-
count: 1
1091-
path: webapp/src/Utils/Scoreboard/Scoreboard.php
1092-
1093-
-
1094-
message: "#^Method App\\\\Utils\\\\Scoreboard\\\\Summary\\:\\:__construct\\(\\) has parameter \\$problems with no value type specified in iterable type array\\.$#"
1095-
count: 1
1096-
path: webapp/src/Utils/Scoreboard/Summary.php

webapp/src/Utils/Scoreboard/Scoreboard.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class Scoreboard
2222

2323
/** @var TeamScore[] */
2424
protected array $scores = [];
25+
/** @var int[]|null */
2526
protected ?array $bestInCategoryData = null;
2627

2728
/**
@@ -334,6 +335,8 @@ public function showPoints(): bool
334335

335336
/**
336337
* Return the used team categories for this scoreboard.
338+
*
339+
* @param int[] $limitToTeamIds
337340
* @return TeamCategory[]
338341
*/
339342
public function getUsedCategories(?array $limitToTeamIds = null): array
@@ -357,6 +360,8 @@ public function getUsedCategories(?array $limitToTeamIds = null): array
357360

358361
/**
359362
* Return whether this scoreboard has multiple category colors.
363+
*
364+
* @param int[] $limitToTeamIds
360365
*/
361366
public function hasCategoryColors(?array $limitToTeamIds = null): bool
362367
{
@@ -381,6 +386,8 @@ public function hasCategoryColors(?array $limitToTeamIds = null): bool
381386

382387
/**
383388
* Determine whether this team is the best in the given category
389+
*
390+
* @param int[] $limitToTeamIds
384391
*/
385392
public function isBestInCategory(Team $team, ?array $limitToTeamIds = null): bool
386393
{

webapp/src/Utils/Scoreboard/Summary.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace App\Utils\Scoreboard;
44

5+
use App\Entity\ContestProblem;
6+
57
class Summary
68
{
79
/** @var int[] */
@@ -16,6 +18,9 @@ class Summary
1618
/** @var ProblemSummary[] */
1719
protected array $problems = [];
1820

21+
/**
22+
* @param ContestProblem[] $problems
23+
*/
1924
public function __construct(array $problems)
2025
{
2126
foreach (array_keys($problems) as $problemId) {

0 commit comments

Comments
 (0)