Skip to content

Commit 23e7060

Browse files
Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
1 parent 028f9fb commit 23e7060

25 files changed

+43
-43
lines changed

Command/DebugCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class DebugCommand extends Command
4444
private $filesystemLoaders;
4545
private $fileLinkFormatter;
4646

47-
public function __construct(Environment $twig, string $projectDir = null, array $bundlesMetadata = [], string $twigDefaultPath = null, FileLinkFormatter $fileLinkFormatter = null)
47+
public function __construct(Environment $twig, ?string $projectDir = null, array $bundlesMetadata = [], ?string $twigDefaultPath = null, ?FileLinkFormatter $fileLinkFormatter = null)
4848
{
4949
parent::__construct();
5050

@@ -218,7 +218,7 @@ private function displayPathsJson(SymfonyStyle $io, string $name)
218218
$io->writeln(json_encode($data));
219219
}
220220

221-
private function displayGeneralText(SymfonyStyle $io, string $filter = null)
221+
private function displayGeneralText(SymfonyStyle $io, ?string $filter = null)
222222
{
223223
$decorated = $io->isDecorated();
224224
$types = ['functions', 'filters', 'tests', 'globals'];
@@ -280,7 +280,7 @@ private function displayGeneralJson(SymfonyStyle $io, ?string $filter)
280280
$io->writeln($decorated ? OutputFormatter::escape($data) : $data);
281281
}
282282

283-
private function getLoaderPaths(string $name = null): array
283+
private function getLoaderPaths(?string $name = null): array
284284
{
285285
$loaderPaths = [];
286286
foreach ($this->getFilesystemLoaders() as $loader) {

Command/LintCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ private function displayJson(OutputInterface $output, array $filesInfo)
236236
return min($errors, 1);
237237
}
238238

239-
private function renderException(SymfonyStyle $output, string $template, Error $exception, string $file = null, GithubActionReporter $githubReporter = null)
239+
private function renderException(SymfonyStyle $output, string $template, Error $exception, ?string $file = null, ?GithubActionReporter $githubReporter = null)
240240
{
241241
$line = $exception->getTemplateLine();
242242

DataCollector/TwigDataCollector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class TwigDataCollector extends DataCollector implements LateDataCollectorInterf
3232
private $twig;
3333
private $computed;
3434

35-
public function __construct(Profile $profile, Environment $twig = null)
35+
public function __construct(Profile $profile, ?Environment $twig = null)
3636
{
3737
$this->profile = $profile;
3838
$this->twig = $twig;
@@ -41,7 +41,7 @@ public function __construct(Profile $profile, Environment $twig = null)
4141
/**
4242
* {@inheritdoc}
4343
*/
44-
public function collect(Request $request, Response $response, \Throwable $exception = null)
44+
public function collect(Request $request, Response $response, ?\Throwable $exception = null)
4545
{
4646
}
4747

ErrorRenderer/TwigErrorRenderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class TwigErrorRenderer implements ErrorRendererInterface
3232
/**
3333
* @param bool|callable $debug The debugging mode as a boolean or a callable that should return it
3434
*/
35-
public function __construct(Environment $twig, HtmlErrorRenderer $fallbackErrorRenderer = null, $debug = false)
35+
public function __construct(Environment $twig, ?HtmlErrorRenderer $fallbackErrorRenderer = null, $debug = false)
3636
{
3737
if (!\is_bool($debug) && !\is_callable($debug)) {
3838
throw new \TypeError(sprintf('Argument 3 passed to "%s()" must be a boolean or a callable, "%s" given.', __METHOD__, get_debug_type($debug)));

Extension/AssetExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ public function getFunctions(): array
4646
* If the package used to generate the path is an instance of
4747
* UrlPackage, you will always get a URL and not a path.
4848
*/
49-
public function getAssetUrl(string $path, string $packageName = null): string
49+
public function getAssetUrl(string $path, ?string $packageName = null): string
5050
{
5151
return $this->packages->getUrl($path, $packageName);
5252
}
5353

5454
/**
5555
* Returns the version of an asset.
5656
*/
57-
public function getAssetVersion(string $path, string $packageName = null): string
57+
public function getAssetVersion(string $path, ?string $packageName = null): string
5858
{
5959
return $this->packages->getVersion($path, $packageName);
6060
}

Extension/CodeExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public function fileExcerpt(string $file, int $line, int $srcContext = 3): ?stri
164164
/**
165165
* Formats a file path.
166166
*/
167-
public function formatFile(string $file, int $line, string $text = null): string
167+
public function formatFile(string $file, int $line, ?string $text = null): string
168168
{
169169
$file = trim($file);
170170

Extension/DumpExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ final class DumpExtension extends AbstractExtension
2929
private $cloner;
3030
private $dumper;
3131

32-
public function __construct(ClonerInterface $cloner, HtmlDumper $dumper = null)
32+
public function __construct(ClonerInterface $cloner, ?HtmlDumper $dumper = null)
3333
{
3434
$this->cloner = $cloner;
3535
$this->dumper = $dumper;

Extension/FormExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ final class FormExtension extends AbstractExtension
3232
{
3333
private $translator;
3434

35-
public function __construct(TranslatorInterface $translator = null)
35+
public function __construct(?TranslatorInterface $translator = null)
3636
{
3737
$this->translator = $translator;
3838
}

Extension/HttpKernelRuntime.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ final class HttpKernelRuntime
2525
private $handler;
2626
private $fragmentUriGenerator;
2727

28-
public function __construct(FragmentHandler $handler, FragmentUriGeneratorInterface $fragmentUriGenerator = null)
28+
public function __construct(FragmentHandler $handler, ?FragmentUriGeneratorInterface $fragmentUriGenerator = null)
2929
{
3030
$this->handler = $handler;
3131
$this->fragmentUriGenerator = $fragmentUriGenerator;

Extension/LogoutUrlExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function getFunctions(): array
4545
*
4646
* @param string|null $key The firewall key or null to use the current firewall key
4747
*/
48-
public function getLogoutPath(string $key = null): string
48+
public function getLogoutPath(?string $key = null): string
4949
{
5050
return $this->generator->getLogoutPath($key);
5151
}
@@ -55,7 +55,7 @@ public function getLogoutPath(string $key = null): string
5555
*
5656
* @param string|null $key The firewall key or null to use the current firewall key
5757
*/
58-
public function getLogoutUrl(string $key = null): string
58+
public function getLogoutUrl(?string $key = null): string
5959
{
6060
return $this->generator->getLogoutUrl($key);
6161
}

0 commit comments

Comments
 (0)