Skip to content

Commit de9a8d9

Browse files
Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
1 parent 0aff198 commit de9a8d9

40 files changed

+69
-69
lines changed

Application.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public function setSignalsToDispatchEvent(int ...$signalsToDispatchEvent)
134134
*
135135
* @throws \Exception When running fails. Bypass this when {@link setCatchExceptions()}.
136136
*/
137-
public function run(InputInterface $input = null, OutputInterface $output = null)
137+
public function run(?InputInterface $input = null, ?OutputInterface $output = null)
138138
{
139139
if (\function_exists('putenv')) {
140140
@putenv('LINES='.$this->terminal->getHeight());
@@ -778,7 +778,7 @@ public function find(string $name)
778778
*
779779
* @return Command[]
780780
*/
781-
public function all(string $namespace = null)
781+
public function all(?string $namespace = null)
782782
{
783783
$this->init();
784784

@@ -1147,7 +1147,7 @@ private function getAbbreviationSuggestions(array $abbrevs): string
11471147
*
11481148
* @return string
11491149
*/
1150-
public function extractNamespace(string $name, int $limit = null)
1150+
public function extractNamespace(string $name, ?int $limit = null)
11511151
{
11521152
$parts = explode(':', $name, -1);
11531153

CI/GithubActionReporter.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public static function isGithubActionEnvironment(): bool
5757
*
5858
* @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-error-message
5959
*/
60-
public function error(string $message, string $file = null, int $line = null, int $col = null): void
60+
public function error(string $message, ?string $file = null, ?int $line = null, ?int $col = null): void
6161
{
6262
$this->log('error', $message, $file, $line, $col);
6363
}
@@ -67,7 +67,7 @@ public function error(string $message, string $file = null, int $line = null, in
6767
*
6868
* @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-a-warning-message
6969
*/
70-
public function warning(string $message, string $file = null, int $line = null, int $col = null): void
70+
public function warning(string $message, ?string $file = null, ?int $line = null, ?int $col = null): void
7171
{
7272
$this->log('warning', $message, $file, $line, $col);
7373
}
@@ -77,12 +77,12 @@ public function warning(string $message, string $file = null, int $line = null,
7777
*
7878
* @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-a-debug-message
7979
*/
80-
public function debug(string $message, string $file = null, int $line = null, int $col = null): void
80+
public function debug(string $message, ?string $file = null, ?int $line = null, ?int $col = null): void
8181
{
8282
$this->log('debug', $message, $file, $line, $col);
8383
}
8484

85-
private function log(string $type, string $message, string $file = null, int $line = null, int $col = null): void
85+
private function log(string $type, string $message, ?string $file = null, ?int $line = null, ?int $col = null): void
8686
{
8787
// Some values must be encoded.
8888
$message = strtr($message, self::ESCAPED_DATA);

Command/Command.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public static function getDefaultDescription(): ?string
9696
*
9797
* @throws LogicException When the command name is empty
9898
*/
99-
public function __construct(string $name = null)
99+
public function __construct(?string $name = null)
100100
{
101101
$this->definition = new InputDefinition();
102102

@@ -132,7 +132,7 @@ public function ignoreValidationErrors()
132132
$this->ignoreValidationErrors = true;
133133
}
134134

135-
public function setApplication(Application $application = null)
135+
public function setApplication(?Application $application = null)
136136
{
137137
$this->application = $application;
138138
if ($application) {
@@ -433,7 +433,7 @@ public function getNativeDefinition()
433433
*
434434
* @throws InvalidArgumentException When argument mode is not valid
435435
*/
436-
public function addArgument(string $name, int $mode = null, string $description = '', $default = null)
436+
public function addArgument(string $name, ?int $mode = null, string $description = '', $default = null)
437437
{
438438
$this->definition->addArgument(new InputArgument($name, $mode, $description, $default));
439439
if (null !== $this->fullDefinition) {
@@ -454,7 +454,7 @@ public function addArgument(string $name, int $mode = null, string $description
454454
*
455455
* @throws InvalidArgumentException If option mode is invalid or incompatible
456456
*/
457-
public function addOption(string $name, $shortcut = null, int $mode = null, string $description = '', $default = null)
457+
public function addOption(string $name, $shortcut = null, ?int $mode = null, string $description = '', $default = null)
458458
{
459459
$this->definition->addOption(new InputOption($name, $shortcut, $mode, $description, $default));
460460
if (null !== $this->fullDefinition) {

Command/LazyCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function ignoreValidationErrors(): void
4343
$this->getCommand()->ignoreValidationErrors();
4444
}
4545

46-
public function setApplication(Application $application = null): void
46+
public function setApplication(?Application $application = null): void
4747
{
4848
if ($this->command instanceof parent) {
4949
$this->command->setApplication($application);
@@ -117,7 +117,7 @@ public function getNativeDefinition(): InputDefinition
117117
/**
118118
* @return $this
119119
*/
120-
public function addArgument(string $name, int $mode = null, string $description = '', $default = null): self
120+
public function addArgument(string $name, ?int $mode = null, string $description = '', $default = null): self
121121
{
122122
$this->getCommand()->addArgument($name, $mode, $description, $default);
123123

@@ -127,7 +127,7 @@ public function addArgument(string $name, int $mode = null, string $description
127127
/**
128128
* @return $this
129129
*/
130-
public function addOption(string $name, $shortcut = null, int $mode = null, string $description = '', $default = null): self
130+
public function addOption(string $name, $shortcut = null, ?int $mode = null, string $description = '', $default = null): self
131131
{
132132
$this->getCommand()->addOption($name, $shortcut, $mode, $description, $default);
133133

Command/LockableTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ trait LockableTrait
3030
/**
3131
* Locks a command.
3232
*/
33-
private function lock(string $name = null, bool $blocking = false): bool
33+
private function lock(?string $name = null, bool $blocking = false): bool
3434
{
3535
if (!class_exists(SemaphoreStore::class)) {
3636
throw new LogicException('To enable the locking feature you must install the symfony/lock component.');

Descriptor/ApplicationDescription.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class ApplicationDescription
4343
*/
4444
private $aliases;
4545

46-
public function __construct(Application $application, string $namespace = null, bool $showHidden = false)
46+
public function __construct(Application $application, ?string $namespace = null, bool $showHidden = false)
4747
{
4848
$this->application = $application;
4949
$this->namespace = $namespace;

Descriptor/XmlDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function getCommandDocument(Command $command, bool $short = false): \DOMD
7979
return $dom;
8080
}
8181

82-
public function getApplicationDocument(Application $application, string $namespace = null, bool $short = false): \DOMDocument
82+
public function getApplicationDocument(Application $application, ?string $namespace = null, bool $short = false): \DOMDocument
8383
{
8484
$dom = new \DOMDocument('1.0', 'UTF-8');
8585
$dom->appendChild($rootXml = $dom->createElement('symfony'));

Event/ConsoleErrorEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ final class ConsoleErrorEvent extends ConsoleEvent
2525
private $error;
2626
private $exitCode;
2727

28-
public function __construct(InputInterface $input, OutputInterface $output, \Throwable $error, Command $command = null)
28+
public function __construct(InputInterface $input, OutputInterface $output, \Throwable $error, ?Command $command = null)
2929
{
3030
parent::__construct($command, $input, $output);
3131

EventListener/ErrorListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class ErrorListener implements EventSubscriberInterface
2626
{
2727
private $logger;
2828

29-
public function __construct(LoggerInterface $logger = null)
29+
public function __construct(?LoggerInterface $logger = null)
3030
{
3131
$this->logger = $logger;
3232
}

Exception/CommandNotFoundException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class CommandNotFoundException extends \InvalidArgumentException implements Exce
2626
* @param int $code Exception code
2727
* @param \Throwable|null $previous Previous exception used for the exception chaining
2828
*/
29-
public function __construct(string $message, array $alternatives = [], int $code = 0, \Throwable $previous = null)
29+
public function __construct(string $message, array $alternatives = [], int $code = 0, ?\Throwable $previous = null)
3030
{
3131
parent::__construct($message, $code, $previous);
3232

0 commit comments

Comments
 (0)