Skip to content

Commit 56904ae

Browse files
Add ? to nullable non-mixed properties
1 parent 564ceb7 commit 56904ae

File tree

11 files changed

+13
-13
lines changed

11 files changed

+13
-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/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;

webapp/src/Security/DOMJudgeIPAuthenticator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public function onAuthenticationFailure(Request $request, AuthenticationExceptio
139139
return null;
140140
}
141141

142-
public function start(Request $request, AuthenticationException $authException = null): Response
142+
public function start(Request $request, ?AuthenticationException $authException = null): Response
143143
{
144144
// If this is the guard that fails/is configured to allow access as the entry_point
145145
// send the user a basic auth dialog, as that's probably what they're expecting.

webapp/src/Service/ImportExportService.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ protected function convertImportedTime(array $fields, array $data, ?string &$err
151151
return $time instanceof DateTime ? DateTimeImmutable::createFromMutable($time) : $time;
152152
}
153153

154-
public function importContestData(mixed $data, ?string &$errorMessage = null, string &$cid = null): bool
154+
public function importContestData(mixed $data, ?string &$errorMessage = null, ?string &$cid = null): bool
155155
{
156156
if (empty($data) || !is_array($data)) {
157157
$errorMessage = 'Error parsing YAML file.';
@@ -327,7 +327,7 @@ public function importContestData(mixed $data, ?string &$errorMessage = null, st
327327
* @param string[]|null $ids
328328
* @param array<string, string[]> $messages
329329
*/
330-
public function importProblemsData(Contest $contest, array $problems, array &$ids = null, ?array &$messages = []): bool
330+
public function importProblemsData(Contest $contest, array $problems, ?array &$ids = null, array &$messages = []): bool
331331
{
332332
// For problemset.yaml the root key is called `problems`, so handle that case
333333
// TODO: Move this check away to make the $problems array shape easier

0 commit comments

Comments
 (0)