Skip to content

Commit e1c20b8

Browse files
Add ? to nullable non-mixed properties
1 parent 063b687 commit e1c20b8

13 files changed

+15
-13
lines changed

webapp/src/Command/CheckDatabaseConfigurationDefaultValuesCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
)]
1616
class CheckDatabaseConfigurationDefaultValuesCommand extends Command
1717
{
18-
public function __construct(protected readonly ConfigurationService $config, string $name = null)
18+
public function __construct(protected readonly ConfigurationService $config, ?string $name = null)
1919
{
2020
parent::__construct($name);
2121
}

webapp/src/Command/ImportEventFeedCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct(
4343
protected readonly TokenStorageInterface $tokenStorage,
4444
protected readonly ?Profiler $profiler,
4545
protected readonly ExternalContestSourceService $sourceService,
46-
string $name = null
46+
?string $name = null
4747
) {
4848
parent::__construct($name);
4949
}

webapp/src/Command/ScoreboardMergeCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function __construct(
5252
protected readonly RouterInterface $router,
5353
#[Autowire('%kernel.project_dir%')]
5454
protected readonly string $projectDir,
55-
string $name = null
55+
?string $name = null
5656
) {
5757
parent::__construct($name);
5858
}

webapp/src/Config/Loader/YamlConfigLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ class YamlConfigLoader extends FileLoader
1515
/**
1616
* @return mixed
1717
*/
18-
public function load(mixed $resource, string $type = null)
18+
public function load(mixed $resource, ?string $type = null)
1919
{
2020
return Yaml::parse(file_get_contents($resource));
2121
}
2222

23-
public function supports($resource, string $type = null): bool
23+
public function supports($resource, ?string $type = null): bool
2424
{
2525
return is_string($resource) &&
2626
pathinfo($resource, PATHINFO_EXTENSION) === 'yaml';

webapp/src/Controller/API/JudgementTypeController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function singleAction(Request $request, string $id): JudgementType
8383
*
8484
* @return JudgementType[]
8585
*/
86-
protected function getJudgementTypes(array $filteredOn = null): array
86+
protected function getJudgementTypes(?array $filteredOn = null): array
8787
{
8888
$verdicts = $this->dj->getVerdicts(mergeExternal: true);
8989

webapp/src/Controller/API/ProblemController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ public function addProblemsAction(Request $request): array
102102
// Note: we read the JSON as YAML, since any JSON is also YAML and this allows us
103103
// to import files with YAML inside them that match the JSON format
104104
$data = Yaml::parseFile($file->getRealPath(), Yaml::PARSE_DATETIME);
105+
$messages = [];
105106
if ($this->importExportService->importProblemsData($contest, $data, $ids, $messages)) {
106107
return $ids;
107108
}

webapp/src/Controller/Jury/ImportExportController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ public function indexAction(Request $request): Response
245245
$this->addFlash('danger', "Parse error in YAML/JSON file (" . $file->getClientOriginalName() . "): " . $e->getMessage());
246246
return $this->redirectToRoute('jury_import_export');
247247
}
248+
$messages = [];
248249
if ($this->importExportService->importProblemsData($problemsImportForm->get('contest')->getData(), $data, $ids, $messages)) {
249250
$this->addFlash('success',
250251
sprintf('The file %s is successfully imported.', $file->getClientOriginalName()));

webapp/src/Entity/Balloon.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function getDone(): bool
6060
return $this->done;
6161
}
6262

63-
public function setSubmission(Submission $submission = null): Balloon
63+
public function setSubmission(?Submission $submission = null): Balloon
6464
{
6565
$this->submission = $submission;
6666
return $this;

webapp/src/Entity/ExecutableFile.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function getRank(): int
8989
return $this->rank;
9090
}
9191

92-
public function setImmutableExecutable(ImmutableExecutable $immutableExecutable = null): ExecutableFile
92+
public function setImmutableExecutable(?ImmutableExecutable $immutableExecutable = null): ExecutableFile
9393
{
9494
$this->immutableExecutable = $immutableExecutable;
9595
return $this;

webapp/src/Entity/Team.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ public function setClearPhoto(bool $clearPhoto): Team
417417
return $this;
418418
}
419419

420-
public function setAffiliation(TeamAffiliation $affiliation = null): Team
420+
public function setAffiliation(?TeamAffiliation $affiliation = null): Team
421421
{
422422
$this->affiliation = $affiliation;
423423
return $this;

0 commit comments

Comments
 (0)