Skip to content

Commit d4f8c86

Browse files
vmcjnickygerritsen
authored andcommitted
Add PHPStan types to more entities, mostly service files.
1 parent aed804f commit d4f8c86

17 files changed

+162
-292
lines changed

phpstan-baseline.neon

Lines changed: 0 additions & 270 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,6 @@ parameters:
135135
count: 1
136136
path: webapp/src/Controller/API/JudgehostController.php
137137

138-
-
139-
message: "#^PHPDoc tag @var for variable \\$judgings has no value type specified in iterable type array\\.$#"
140-
count: 1
141-
path: webapp/src/Controller/API/JudgehostController.php
142-
143138
-
144139
message: "#^Method App\\\\Controller\\\\API\\\\JudgementTypeController\\:\\:getJudgementTypes\\(\\) has parameter \\$filteredOn with no value type specified in iterable type array\\.$#"
145140
count: 1
@@ -285,11 +280,6 @@ parameters:
285280
count: 1
286281
path: webapp/src/Controller/Jury/RejudgingController.php
287282

288-
-
289-
message: "#^PHPDoc tag @var for variable \\$judgings has no value type specified in iterable type array\\.$#"
290-
count: 2
291-
path: webapp/src/Controller/Jury/RejudgingController.php
292-
293283
-
294284
message: "#^Method App\\\\Controller\\\\Jury\\\\SubmissionController\\:\\:determineFileChanged\\(\\) has parameter \\$files with no value type specified in iterable type array\\.$#"
295285
count: 1
@@ -405,161 +395,11 @@ parameters:
405395
count: 1
406396
path: webapp/src/Service/BalloonService.php
407397

408-
-
409-
message: "#^Method App\\\\Service\\\\CheckConfigService\\:\\:checkAdminPass\\(\\) return type has no value type specified in iterable type array\\.$#"
410-
count: 1
411-
path: webapp/src/Service/CheckConfigService.php
412-
413-
-
414-
message: "#^Method App\\\\Service\\\\CheckConfigService\\:\\:checkAffiliations\\(\\) return type has no value type specified in iterable type array\\.$#"
415-
count: 1
416-
path: webapp/src/Service/CheckConfigService.php
417-
418398
-
419399
message: "#^Method App\\\\Service\\\\CheckConfigService\\:\\:checkAllExternalIdentifiers\\(\\) return type has no value type specified in iterable type array\\.$#"
420400
count: 1
421401
path: webapp/src/Service/CheckConfigService.php
422402

423-
-
424-
message: "#^Method App\\\\Service\\\\CheckConfigService\\:\\:checkContestActive\\(\\) return type has no value type specified in iterable type array\\.$#"
425-
count: 1
426-
path: webapp/src/Service/CheckConfigService.php
427-
428-
-
429-
message: "#^Method App\\\\Service\\\\CheckConfigService\\:\\:checkContestBanners\\(\\) return type has no value type specified in iterable type array\\.$#"
430-
count: 1
431-
path: webapp/src/Service/CheckConfigService.php
432-
433-
-
434-
message: "#^Method App\\\\Service\\\\CheckConfigService\\:\\:checkContestsValidate\\(\\) return type has no value type specified in iterable type array\\.$#"
435-
count: 1
436-
path: webapp/src/Service/CheckConfigService.php
437-
438-
-
439-
message: "#^Method App\\\\Service\\\\CheckConfigService\\:\\:checkDebugDisabled\\(\\) return type has no value type specified in iterable type array\\.$#"
440-
count: 1
441-
path: webapp/src/Service/CheckConfigService.php
442-
443-
-
444-
message: "#^Method App\\\\Service\\\\CheckConfigService\\:\\:checkDefaultCompareRunExist\\(\\) return type has no value type specified in iterable type array\\.$#"
445-
count: 1
446-
path: webapp/src/Service/CheckConfigService.php
447-
448-
-
449-
message: "#^Method App\\\\Service\\\\CheckConfigService\\:\\:checkExternalIdentifiers\\(\\) return type has no value type specified in iterable type array\\.$#"
450-
count: 1
451-
path: webapp/src/Service/CheckConfigService.php
452-
453-
-
454-
message: "#^Method App\\\\Service\\\\CheckConfigService\\:\\:checkHashTime\\(\\) return type has no value type specified in iterable type array\\.$#"
455-
count: 1
456-
path: webapp/src/Service/CheckConfigService.php
457-
458-
-
459-
message: "#^Method App\\\\Service\\\\CheckConfigService\\:\\:checkLanguagesValidate\\(\\) return type has no value type specified in iterable type array\\.$#"
460-
count: 1
461-
path: webapp/src/Service/CheckConfigService.php
462-
463-
-
464-
message: "#^Method App\\\\Service\\\\CheckConfigService\\:\\:checkMysqlSettings\\(\\) return type has no value type specified in iterable type array\\.$#"
465-
count: 1
466-
path: webapp/src/Service/CheckConfigService.php
467-
468-
-
469-
message: "#^Method App\\\\Service\\\\CheckConfigService\\:\\:checkPhpExtensions\\(\\) return type has no value type specified in iterable type array\\.$#"
470-
count: 1
471-
path: webapp/src/Service/CheckConfigService.php
472-
473-
-
474-
message: "#^Method App\\\\Service\\\\CheckConfigService\\:\\:checkPhpSettings\\(\\) return type has no value type specified in iterable type array\\.$#"
475-
count: 1
476-
path: webapp/src/Service/CheckConfigService.php
477-
478-
-
479-
message: "#^Method App\\\\Service\\\\CheckConfigService\\:\\:checkPhpVersion\\(\\) return type has no value type specified in iterable type array\\.$#"
480-
count: 1
481-
path: webapp/src/Service/CheckConfigService.php
482-
483-
-
484-
message: "#^Method App\\\\Service\\\\CheckConfigService\\:\\:checkProblemsValidate\\(\\) return type has no value type specified in iterable type array\\.$#"
485-
count: 1
486-
path: webapp/src/Service/CheckConfigService.php
487-
488-
-
489-
message: "#^Method App\\\\Service\\\\CheckConfigService\\:\\:checkScriptFilesizevsMemoryLimit\\(\\) return type has no value type specified in iterable type array\\.$#"
490-
count: 1
491-
path: webapp/src/Service/CheckConfigService.php
492-
493-
-
494-
message: "#^Method App\\\\Service\\\\CheckConfigService\\:\\:checkSelfRegistration\\(\\) return type has no value type specified in iterable type array\\.$#"
495-
count: 1
496-
path: webapp/src/Service/CheckConfigService.php
497-
498-
-
499-
message: "#^Method App\\\\Service\\\\CheckConfigService\\:\\:checkTeamDuplicateNames\\(\\) return type has no value type specified in iterable type array\\.$#"
500-
count: 1
501-
path: webapp/src/Service/CheckConfigService.php
502-
503-
-
504-
message: "#^Method App\\\\Service\\\\CheckConfigService\\:\\:checkTeamPhotos\\(\\) return type has no value type specified in iterable type array\\.$#"
505-
count: 1
506-
path: webapp/src/Service/CheckConfigService.php
507-
508-
-
509-
message: "#^Method App\\\\Service\\\\CheckConfigService\\:\\:checkTmpdirWritable\\(\\) return type has no value type specified in iterable type array\\.$#"
510-
count: 1
511-
path: webapp/src/Service/CheckConfigService.php
512-
513-
-
514-
message: "#^Method App\\\\Service\\\\CheckConfigService\\:\\:runAll\\(\\) return type has no value type specified in iterable type array\\.$#"
515-
count: 1
516-
path: webapp/src/Service/CheckConfigService.php
517-
518-
-
519-
message: "#^PHPDoc tag @var for variable \\$tcs_size has no value type specified in iterable type array\\.$#"
520-
count: 1
521-
path: webapp/src/Service/CheckConfigService.php
522-
523-
-
524-
message: "#^Method App\\\\Service\\\\ConfigurationService\\:\\:addOptions\\(\\) has parameter \\$item with no value type specified in iterable type array\\.$#"
525-
count: 1
526-
path: webapp/src/Service/ConfigurationService.php
527-
528-
-
529-
message: "#^Method App\\\\Service\\\\ConfigurationService\\:\\:addOptions\\(\\) return type has no value type specified in iterable type array\\.$#"
530-
count: 1
531-
path: webapp/src/Service/ConfigurationService.php
532-
533-
-
534-
message: "#^Method App\\\\Service\\\\ConfigurationService\\:\\:all\\(\\) return type has no value type specified in iterable type array\\.$#"
535-
count: 1
536-
path: webapp/src/Service/ConfigurationService.php
537-
538-
-
539-
message: "#^Method App\\\\Service\\\\ConfigurationService\\:\\:findExecutableOptions\\(\\) return type has no value type specified in iterable type array\\.$#"
540-
count: 1
541-
path: webapp/src/Service/ConfigurationService.php
542-
543-
-
544-
message: "#^Method App\\\\Service\\\\ConfigurationService\\:\\:getConfigSpecification\\(\\) return type has no value type specified in iterable type array\\.$#"
545-
count: 1
546-
path: webapp/src/Service/ConfigurationService.php
547-
548-
-
549-
message: "#^Method App\\\\Service\\\\ConfigurationService\\:\\:getDbValues\\(\\) return type has no value type specified in iterable type array\\.$#"
550-
count: 1
551-
path: webapp/src/Service/ConfigurationService.php
552-
553-
-
554-
message: "#^Method App\\\\Service\\\\ConfigurationService\\:\\:saveChanges\\(\\) has parameter \\$dataToSet with no value type specified in iterable type array\\.$#"
555-
count: 1
556-
path: webapp/src/Service/ConfigurationService.php
557-
558-
-
559-
message: "#^Property App\\\\Service\\\\ConfigurationService\\:\\:\\$dbConfigCache type has no value type specified in iterable type array\\.$#"
560-
count: 1
561-
path: webapp/src/Service/ConfigurationService.php
562-
563403
-
564404
message: "#^Method App\\\\Service\\\\DOMJudgeService\\:\\:apiRelativeUrl\\(\\) has parameter \\$params with no value type specified in iterable type array\\.$#"
565405
count: 1
@@ -595,11 +435,6 @@ parameters:
595435
count: 1
596436
path: webapp/src/Service/DOMJudgeService.php
597437

598-
-
599-
message: "#^Method App\\\\Service\\\\DOMJudgeService\\:\\:getVerdicts\\(\\) return type has no value type specified in iterable type array\\.$#"
600-
count: 1
601-
path: webapp/src/Service/DOMJudgeService.php
602-
603438
-
604439
message: "#^Method App\\\\Service\\\\DOMJudgeService\\:\\:internalApiRequest\\(\\) has parameter \\$queryOrPostData with no value type specified in iterable type array\\.$#"
605440
count: 1
@@ -620,16 +455,6 @@ parameters:
620455
count: 1
621456
path: webapp/src/Service/DOMJudgeService.php
622457

623-
-
624-
message: "#^Method App\\\\Service\\\\EventLogService\\:\\:getExternalIds\\(\\) has parameter \\$ids with no value type specified in iterable type array\\.$#"
625-
count: 1
626-
path: webapp/src/Service/EventLogService.php
627-
628-
-
629-
message: "#^Method App\\\\Service\\\\EventLogService\\:\\:getExternalIds\\(\\) return type has no value type specified in iterable type array\\.$#"
630-
count: 1
631-
path: webapp/src/Service/EventLogService.php
632-
633458
-
634459
message: "#^Method App\\\\Service\\\\EventLogService\\:\\:hasAllDependentObjectEvents\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#"
635460
count: 1
@@ -760,11 +585,6 @@ parameters:
760585
count: 1
761586
path: webapp/src/Service/ExternalContestSourceService.php
762587

763-
-
764-
message: "#^Method App\\\\Service\\\\ExternalContestSourceService\\:\\:warningIfUnsupported\\(\\) has parameter \\$supportedActions with no value type specified in iterable type array\\.$#"
765-
count: 1
766-
path: webapp/src/Service/ExternalContestSourceService.php
767-
768588
-
769589
message: "#^Property App\\\\Service\\\\ExternalContestSourceService\\:\\:\\$cachedApiInfoData type has no value type specified in iterable type array\\.$#"
770590
count: 1
@@ -780,21 +600,6 @@ parameters:
780600
count: 1
781601
path: webapp/src/Service/ExternalContestSourceService.php
782602

783-
-
784-
message: "#^Property App\\\\Service\\\\ExternalContestSourceService\\:\\:\\$verdicts type has no value type specified in iterable type array\\.$#"
785-
count: 1
786-
path: webapp/src/Service/ExternalContestSourceService.php
787-
788-
-
789-
message: "#^Method App\\\\Service\\\\ImportExportService\\:\\:convertImportedTime\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#"
790-
count: 1
791-
path: webapp/src/Service/ImportExportService.php
792-
793-
-
794-
message: "#^Method App\\\\Service\\\\ImportExportService\\:\\:convertImportedTime\\(\\) has parameter \\$fields with no value type specified in iterable type array\\.$#"
795-
count: 1
796-
path: webapp/src/Service/ImportExportService.php
797-
798603
-
799604
message: "#^Method App\\\\Service\\\\ImportExportService\\:\\:getContestYamlData\\(\\) return type has no value type specified in iterable type array\\.$#"
800605
count: 1
@@ -885,46 +690,6 @@ parameters:
885690
count: 1
886691
path: webapp/src/Service/ImportExportService.php
887692

888-
-
889-
message: "#^Method App\\\\Service\\\\ImportProblemService\\:\\:importProblemFromRequest\\(\\) return type has no value type specified in iterable type array\\.$#"
890-
count: 1
891-
path: webapp/src/Service/ImportProblemService.php
892-
893-
-
894-
message: "#^Method App\\\\Service\\\\ImportProblemService\\:\\:importZippedProblem\\(\\) has parameter \\$messages with no value type specified in iterable type array\\.$#"
895-
count: 1
896-
path: webapp/src/Service/ImportProblemService.php
897-
898-
-
899-
message: "#^Method App\\\\Service\\\\ImportProblemService\\:\\:searchAndAddValidator\\(\\) has parameter \\$messages with no value type specified in iterable type array\\.$#"
900-
count: 1
901-
path: webapp/src/Service/ImportProblemService.php
902-
903-
-
904-
message: "#^Method App\\\\Service\\\\RejudgingService\\:\\:calculateTodo\\(\\) return type has no value type specified in iterable type array\\.$#"
905-
count: 1
906-
path: webapp/src/Service/RejudgingService.php
907-
908-
-
909-
message: "#^Method App\\\\Service\\\\RejudgingService\\:\\:createRejudging\\(\\) has parameter \\$judgings with no value type specified in iterable type array\\.$#"
910-
count: 1
911-
path: webapp/src/Service/RejudgingService.php
912-
913-
-
914-
message: "#^Method App\\\\Service\\\\RejudgingService\\:\\:createRejudging\\(\\) has parameter \\$skipped with no value type specified in iterable type array\\.$#"
915-
count: 1
916-
path: webapp/src/Service/RejudgingService.php
917-
918-
-
919-
message: "#^PHPDoc tag @var for variable \\$submissions has no value type specified in iterable type array\\.$#"
920-
count: 1
921-
path: webapp/src/Service/RejudgingService.php
922-
923-
-
924-
message: "#^Method App\\\\Service\\\\ScoreboardService\\:\\:getFilterValues\\(\\) return type has no value type specified in iterable type array\\.$#"
925-
count: 1
926-
path: webapp/src/Service/ScoreboardService.php
927-
928693
-
929694
message: "#^Method App\\\\Service\\\\ScoreboardService\\:\\:getGroupedAffiliations\\(\\) return type has no value type specified in iterable type array\\.$#"
930695
count: 1
@@ -950,11 +715,6 @@ parameters:
950715
count: 1
951716
path: webapp/src/Service/StatisticsService.php
952717

953-
-
954-
message: "#^Method App\\\\Service\\\\StatisticsService\\:\\:getTeamNumSubmissions\\(\\) return type has no value type specified in iterable type array\\.$#"
955-
count: 1
956-
path: webapp/src/Service/StatisticsService.php
957-
958718
-
959719
message: "#^Method App\\\\Service\\\\StatisticsService\\:\\:getTeamStats\\(\\) return type has no value type specified in iterable type array\\.$#"
960720
count: 1
@@ -964,33 +724,3 @@ parameters:
964724
message: "#^Method App\\\\Service\\\\StatisticsService\\:\\:setOrIncrement\\(\\) has parameter \\$array with no value type specified in iterable type array\\.$#"
965725
count: 1
966726
path: webapp/src/Service/StatisticsService.php
967-
968-
-
969-
message: "#^Method App\\\\Service\\\\SubmissionService\\:\\:getExpectedResults\\(\\) has parameter \\$resultsRemap with no value type specified in iterable type array\\.$#"
970-
count: 1
971-
path: webapp/src/Service/SubmissionService.php
972-
973-
-
974-
message: "#^Method App\\\\Service\\\\SubmissionService\\:\\:getFinalResult\\(\\) has parameter \\$resultsPrio with no value type specified in iterable type array\\.$#"
975-
count: 1
976-
path: webapp/src/Service/SubmissionService.php
977-
978-
-
979-
message: "#^Method App\\\\Service\\\\SubmissionService\\:\\:getSourceFilename\\(\\) has parameter \\$fileData with no value type specified in iterable type array\\.$#"
980-
count: 1
981-
path: webapp/src/Service/SubmissionService.php
982-
983-
-
984-
message: "#^Method App\\\\Service\\\\SubmissionService\\:\\:getSubmissionList\\(\\) has parameter \\$contests with no value type specified in iterable type array\\.$#"
985-
count: 1
986-
path: webapp/src/Service/SubmissionService.php
987-
988-
-
989-
message: "#^Method App\\\\Service\\\\SubmissionService\\:\\:getSubmissionList\\(\\) has parameter \\$restrictions with no value type specified in iterable type array\\.$#"
990-
count: 1
991-
path: webapp/src/Service/SubmissionService.php
992-
993-
-
994-
message: "#^Method App\\\\Service\\\\SubmissionService\\:\\:getSubmissionList\\(\\) return type has no value type specified in iterable type array\\.$#"
995-
count: 1
996-
path: webapp/src/Service/SubmissionService.php

webapp/src/Controller/API/JudgehostController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,7 @@ private function maybeUpdateActiveJudging(Judging $judging): void
11291129
$this->em->flush();
11301130

11311131
$skipped = [];
1132-
/** @var array[] $judgings */
1132+
/** @var Judging[] $judgings */
11331133
$judgings = $this->em->createQueryBuilder()
11341134
->from(Judging::class, 'j')
11351135
->leftJoin('j.submission', 's')

webapp/src/Controller/Jury/RejudgingController.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -324,13 +324,13 @@ public function viewAction(
324324

325325
$restrictions = ['rejudgingid' => $rejudgingId];
326326
if ($viewTypes[$view] == 'unverified') {
327-
$restrictions['verified'] = 0;
327+
$restrictions['verified'] = false;
328328
}
329329
if ($viewTypes[$view] == 'unjudged') {
330-
$restrictions['judged'] = 0;
330+
$restrictions['judged'] = false;
331331
}
332332
if ($viewTypes[$view] == 'diff') {
333-
$restrictions['rejudgingdiff'] = 1;
333+
$restrictions['rejudgingdiff'] = true;
334334
}
335335
if ($oldverdict !== 'all') {
336336
$restrictions['old_result'] = $oldverdict;
@@ -604,7 +604,7 @@ public function addAction(Request $request, FormFactoryInterface $formFactory):
604604
}
605605
}
606606

607-
/** @var array[] $judgings */
607+
/** @var Judging[] $judgings */
608608
$judgings = $queryBuilder
609609
->getQuery()
610610
->getResult();
@@ -733,7 +733,7 @@ public function createAction(Request $request): Response
733733
->setParameter('correct', 'correct');
734734
}
735735

736-
/** @var array[] $judgings */
736+
/** @var Judging[] $judgings */
737737
$judgings = $queryBuilder
738738
->getQuery()
739739
->getResult();

0 commit comments

Comments
 (0)