@@ -60,9 +60,9 @@ public function __construct(
60
60
public function importZippedProblem (
61
61
ZipArchive $ zip ,
62
62
string $ clientName ,
63
- ?Problem $ problem = null ,
64
- ?Contest $ contest = null ,
65
- ? array &$ messages = []
63
+ ?Problem $ problem ,
64
+ ?Contest $ contest ,
65
+ array &$ messages
66
66
): ?Problem {
67
67
// This might take a while.
68
68
Utils::extendMaxExecutionTime (300 );
@@ -923,6 +923,7 @@ public function importProblemFromRequest(Request $request, ?int $contestId = nul
923
923
try {
924
924
$ zip = $ this ->dj ->openZipFile ($ file ->getRealPath ());
925
925
$ clientName = $ file ->getClientOriginalName ();
926
+ /** @var array<string, string[]> $messages */
926
927
$ messages = [];
927
928
$ newProblem = $ this ->importZippedProblem (
928
929
$ zip , $ clientName , $ problem , $ contest , $ messages
@@ -949,7 +950,7 @@ public function importProblemFromRequest(Request $request, ?int $contestId = nul
949
950
}
950
951
951
952
/**
952
- * @param array{danger?: string[], info?: string[]} $messages
953
+ * @param array< string, string[]> $messages
953
954
*/
954
955
private function searchAndAddValidator (ZipArchive $ zip , ?array &$ messages , string $ externalId , string $ validationMode , ?Problem $ problem ): bool
955
956
{
@@ -1055,6 +1056,9 @@ private function searchAndAddValidator(ZipArchive $zip, ?array &$messages, strin
1055
1056
return true ;
1056
1057
}
1057
1058
1059
+ /**
1060
+ * @param array<string, string[]> $messages
1061
+ */
1058
1062
public function parseTestCaseGroupMeta (string $ fileContent , string $ name , array &$ messages ): ?TestcaseGroup
1059
1063
{
1060
1064
$ yamlData = Yaml::parse ($ fileContent );
0 commit comments