Skip to content

Commit 77d7d1e

Browse files
Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
1 parent 6bcdf3a commit 77d7d1e

24 files changed

+34
-34
lines changed

Command/XliffLintCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class XliffLintCommand extends Command
4242
private $isReadableProvider;
4343
private $requireStrictFileNames;
4444

45-
public function __construct(string $name = null, callable $directoryIteratorProvider = null, callable $isReadableProvider = null, bool $requireStrictFileNames = true)
45+
public function __construct(?string $name = null, ?callable $directoryIteratorProvider = null, ?callable $isReadableProvider = null, bool $requireStrictFileNames = true)
4646
{
4747
parent::__construct($name);
4848

@@ -111,7 +111,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
111111
return $this->display($io, $filesInfo);
112112
}
113113

114-
private function validate(string $content, string $file = null): array
114+
private function validate(string $content, ?string $file = null): array
115115
{
116116
$errors = [];
117117

DataCollector/TranslationDataCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function lateCollect()
4848
/**
4949
* {@inheritdoc}
5050
*/
51-
public function collect(Request $request, Response $response, \Throwable $exception = null)
51+
public function collect(Request $request, Response $response, ?\Throwable $exception = null)
5252
{
5353
$this->data['locale'] = $this->translator->getLocale();
5454
$this->data['fallback_locales'] = $this->translator->getFallbackLocales();

DataCollectorTranslator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct(TranslatorInterface $translator)
4343
/**
4444
* {@inheritdoc}
4545
*/
46-
public function trans(?string $id, array $parameters = [], string $domain = null, string $locale = null)
46+
public function trans(?string $id, array $parameters = [], ?string $domain = null, ?string $locale = null)
4747
{
4848
$trans = $this->translator->trans($id = (string) $id, $parameters, $domain, $locale);
4949
$this->collectMessage($locale, $domain, $id, $trans, $parameters);
@@ -70,7 +70,7 @@ public function getLocale()
7070
/**
7171
* {@inheritdoc}
7272
*/
73-
public function getCatalogue(string $locale = null)
73+
public function getCatalogue(?string $locale = null)
7474
{
7575
return $this->translator->getCatalogue($locale);
7676
}

Dumper/XliffFileDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ private function dumpXliff2(string $defaultLocale, MessageCatalogue $messages, ?
196196
return $dom->saveXML();
197197
}
198198

199-
private function hasMetadataArrayInfo(string $key, array $metadata = null): bool
199+
private function hasMetadataArrayInfo(string $key, ?array $metadata = null): bool
200200
{
201201
return is_iterable($metadata[$key] ?? null);
202202
}

Exception/IncompleteDsnException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
class IncompleteDsnException extends InvalidArgumentException
1515
{
16-
public function __construct(string $message, string $dsn = null, \Throwable $previous = null)
16+
public function __construct(string $message, ?string $dsn = null, ?\Throwable $previous = null)
1717
{
1818
if ($dsn) {
1919
$message = sprintf('Invalid "%s" provider DSN: ', $dsn).$message;

Exception/MissingRequiredOptionException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717
class MissingRequiredOptionException extends IncompleteDsnException
1818
{
19-
public function __construct(string $option, string $dsn = null, \Throwable $previous = null)
19+
public function __construct(string $option, ?string $dsn = null, ?\Throwable $previous = null)
2020
{
2121
$message = sprintf('The option "%s" is required but missing.', $option);
2222

Exception/ProviderException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class ProviderException extends RuntimeException implements ProviderExceptionInt
2121
private $response;
2222
private $debug;
2323

24-
public function __construct(string $message, ResponseInterface $response, int $code = 0, \Exception $previous = null)
24+
public function __construct(string $message, ResponseInterface $response, int $code = 0, ?\Exception $previous = null)
2525
{
2626
$this->response = $response;
2727
$this->debug = $response->getInfo('debug') ?? '';

Exception/UnsupportedSchemeException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class UnsupportedSchemeException extends LogicException
3131
],
3232
];
3333

34-
public function __construct(Dsn $dsn, string $name = null, array $supported = [])
34+
public function __construct(Dsn $dsn, ?string $name = null, array $supported = [])
3535
{
3636
$provider = $dsn->getScheme();
3737
if (false !== $pos = strpos($provider, '+')) {

Extractor/PhpStringTokenParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public static function parse(string $str)
9393
*
9494
* @return string
9595
*/
96-
public static function parseEscapeSequences(string $str, string $quote = null)
96+
public static function parseEscapeSequences(string $str, ?string $quote = null)
9797
{
9898
if (null !== $quote) {
9999
$str = str_replace('\\'.$quote, $quote, $str);

Formatter/MessageFormatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class MessageFormatter implements MessageFormatterInterface, IntlFormatterInterf
2828
/**
2929
* @param TranslatorInterface|null $translator An identity translator to use as selector for pluralization
3030
*/
31-
public function __construct(TranslatorInterface $translator = null, IntlFormatterInterface $intlFormatter = null)
31+
public function __construct(?TranslatorInterface $translator = null, ?IntlFormatterInterface $intlFormatter = null)
3232
{
3333
$this->translator = $translator ?? new IdentityTranslator();
3434
$this->intlFormatter = $intlFormatter ?? new IntlFormatter();

0 commit comments

Comments
 (0)