Skip to content

Commit 9f39bd6

Browse files
Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
1 parent 8b5cd56 commit 9f39bd6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+81
-81
lines changed

CacheWarmer/AnnotationsCacheWarmer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class AnnotationsCacheWarmer extends AbstractPhpFileCacheWarmer
3232
/**
3333
* @param string $phpArrayFile The PHP file where annotations are cached
3434
*/
35-
public function __construct(Reader $annotationReader, string $phpArrayFile, string $excludeRegexp = null, bool $debug = false)
35+
public function __construct(Reader $annotationReader, string $phpArrayFile, ?string $excludeRegexp = null, bool $debug = false)
3636
{
3737
parent::__construct($phpArrayFile);
3838
$this->annotationReader = $annotationReader;

CacheWarmer/ConfigBuilderCacheWarmer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ConfigBuilderCacheWarmer implements CacheWarmerInterface
3131
private $kernel;
3232
private $logger;
3333

34-
public function __construct(KernelInterface $kernel, LoggerInterface $logger = null)
34+
public function __construct(KernelInterface $kernel, ?LoggerInterface $logger = null)
3535
{
3636
$this->kernel = $kernel;
3737
$this->logger = $logger;

Command/CacheClearCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class CacheClearCommand extends Command
4141
private $cacheClearer;
4242
private $filesystem;
4343

44-
public function __construct(CacheClearerInterface $cacheClearer, Filesystem $filesystem = null)
44+
public function __construct(CacheClearerInterface $cacheClearer, ?Filesystem $filesystem = null)
4545
{
4646
parent::__construct();
4747

Command/CachePoolClearCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ final class CachePoolClearCommand extends Command
3838
/**
3939
* @param string[]|null $poolNames
4040
*/
41-
public function __construct(Psr6CacheClearer $poolClearer, array $poolNames = null)
41+
public function __construct(Psr6CacheClearer $poolClearer, ?array $poolNames = null)
4242
{
4343
parent::__construct();
4444

Command/CachePoolDeleteCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ final class CachePoolDeleteCommand extends Command
3636
/**
3737
* @param string[]|null $poolNames
3838
*/
39-
public function __construct(Psr6CacheClearer $poolClearer, array $poolNames = null)
39+
public function __construct(Psr6CacheClearer $poolClearer, ?array $poolNames = null)
4040
{
4141
parent::__construct();
4242

Command/DebugAutowiringCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class DebugAutowiringCommand extends ContainerDebugCommand
3737
private $supportsHref;
3838
private $fileLinkFormatter;
3939

40-
public function __construct(string $name = null, FileLinkFormatter $fileLinkFormatter = null)
40+
public function __construct(?string $name = null, ?FileLinkFormatter $fileLinkFormatter = null)
4141
{
4242
$this->supportsHref = method_exists(OutputFormatterStyle::class, 'setHref');
4343
$this->fileLinkFormatter = $fileLinkFormatter;

Command/RouterDebugCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class RouterDebugCommand extends Command
4242
private $router;
4343
private $fileLinkFormatter;
4444

45-
public function __construct(RouterInterface $router, FileLinkFormatter $fileLinkFormatter = null)
45+
public function __construct(RouterInterface $router, ?FileLinkFormatter $fileLinkFormatter = null)
4646
{
4747
parent::__construct();
4848

Command/SecretsDecryptToLocalCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ final class SecretsDecryptToLocalCommand extends Command
3232
private $vault;
3333
private $localVault;
3434

35-
public function __construct(AbstractVault $vault, AbstractVault $localVault = null)
35+
public function __construct(AbstractVault $vault, ?AbstractVault $localVault = null)
3636
{
3737
$this->vault = $vault;
3838
$this->localVault = $localVault;

Command/SecretsEncryptFromLocalCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ final class SecretsEncryptFromLocalCommand extends Command
3131
private $vault;
3232
private $localVault;
3333

34-
public function __construct(AbstractVault $vault, AbstractVault $localVault = null)
34+
public function __construct(AbstractVault $vault, ?AbstractVault $localVault = null)
3535
{
3636
$this->vault = $vault;
3737
$this->localVault = $localVault;

Command/SecretsGenerateKeysCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ final class SecretsGenerateKeysCommand extends Command
3434
private $vault;
3535
private $localVault;
3636

37-
public function __construct(AbstractVault $vault, AbstractVault $localVault = null)
37+
public function __construct(AbstractVault $vault, ?AbstractVault $localVault = null)
3838
{
3939
$this->vault = $vault;
4040
$this->localVault = $localVault;

Command/SecretsListCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ final class SecretsListCommand extends Command
3535
private $vault;
3636
private $localVault;
3737

38-
public function __construct(AbstractVault $vault, AbstractVault $localVault = null)
38+
public function __construct(AbstractVault $vault, ?AbstractVault $localVault = null)
3939
{
4040
$this->vault = $vault;
4141
$this->localVault = $localVault;

Command/SecretsRemoveCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ final class SecretsRemoveCommand extends Command
3636
private $vault;
3737
private $localVault;
3838

39-
public function __construct(AbstractVault $vault, AbstractVault $localVault = null)
39+
public function __construct(AbstractVault $vault, ?AbstractVault $localVault = null)
4040
{
4141
$this->vault = $vault;
4242
$this->localVault = $localVault;

Command/SecretsSetCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ final class SecretsSetCommand extends Command
3737
private $vault;
3838
private $localVault;
3939

40-
public function __construct(AbstractVault $vault, AbstractVault $localVault = null)
40+
public function __construct(AbstractVault $vault, ?AbstractVault $localVault = null)
4141
{
4242
$this->vault = $vault;
4343
$this->localVault = $localVault;

Command/TranslationDebugCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class TranslationDebugCommand extends Command
6060
private $codePaths;
6161
private $enabledLocales;
6262

63-
public function __construct(TranslatorInterface $translator, TranslationReaderInterface $reader, ExtractorInterface $extractor, string $defaultTransPath = null, string $defaultViewsPath = null, array $transPaths = [], array $codePaths = [], array $enabledLocales = [])
63+
public function __construct(TranslatorInterface $translator, TranslationReaderInterface $reader, ExtractorInterface $extractor, ?string $defaultTransPath = null, ?string $defaultViewsPath = null, array $transPaths = [], array $codePaths = [], array $enabledLocales = [])
6464
{
6565
parent::__construct();
6666

Command/TranslationUpdateCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class TranslationUpdateCommand extends Command
6161
private $codePaths;
6262
private $enabledLocales;
6363

64-
public function __construct(TranslationWriterInterface $writer, TranslationReaderInterface $reader, ExtractorInterface $extractor, string $defaultLocale, string $defaultTransPath = null, string $defaultViewsPath = null, array $transPaths = [], array $codePaths = [], array $enabledLocales = [])
64+
public function __construct(TranslationWriterInterface $writer, TranslationReaderInterface $reader, ExtractorInterface $extractor, string $defaultLocale, ?string $defaultTransPath = null, ?string $defaultViewsPath = null, array $transPaths = [], array $codePaths = [], array $enabledLocales = [])
6565
{
6666
parent::__construct();
6767

Console/Application.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function get(string $name)
135135
/**
136136
* {@inheritdoc}
137137
*/
138-
public function all(string $namespace = null)
138+
public function all(?string $namespace = null)
139139
{
140140
$this->registerCommands();
141141

Console/Descriptor/Descriptor.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ abstract protected function describeContainerTags(ContainerBuilder $builder, arr
113113
*
114114
* @param Definition|Alias|object $service
115115
*/
116-
abstract protected function describeContainerService(object $service, array $options = [], ContainerBuilder $builder = null);
116+
abstract protected function describeContainerService(object $service, array $options = [], ?ContainerBuilder $builder = null);
117117

118118
/**
119119
* Describes container services.
@@ -127,7 +127,7 @@ abstract protected function describeContainerDeprecations(ContainerBuilder $buil
127127

128128
abstract protected function describeContainerDefinition(Definition $definition, array $options = []);
129129

130-
abstract protected function describeContainerAlias(Alias $alias, array $options = [], ContainerBuilder $builder = null);
130+
abstract protected function describeContainerAlias(Alias $alias, array $options = [], ?ContainerBuilder $builder = null);
131131

132132
abstract protected function describeContainerParameter($parameter, array $options = []);
133133

@@ -304,7 +304,7 @@ protected function sortByPriority(array $tag): array
304304
return $tag;
305305
}
306306

307-
public static function getClassDescription(string $class, string &$resolvedClass = null): string
307+
public static function getClassDescription(string $class, ?string &$resolvedClass = null): string
308308
{
309309
$resolvedClass = $class;
310310
try {

Console/Descriptor/JsonDescriptor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ protected function describeContainerTags(ContainerBuilder $builder, array $optio
6767
$this->writeData($data, $options);
6868
}
6969

70-
protected function describeContainerService(object $service, array $options = [], ContainerBuilder $builder = null)
70+
protected function describeContainerService(object $service, array $options = [], ?ContainerBuilder $builder = null)
7171
{
7272
if (!isset($options['id'])) {
7373
throw new \InvalidArgumentException('An "id" option must be provided.');
@@ -120,7 +120,7 @@ protected function describeContainerDefinition(Definition $definition, array $op
120120
$this->writeData($this->getContainerDefinitionData($definition, isset($options['omit_tags']) && $options['omit_tags'], isset($options['show_arguments']) && $options['show_arguments']), $options);
121121
}
122122

123-
protected function describeContainerAlias(Alias $alias, array $options = [], ContainerBuilder $builder = null)
123+
protected function describeContainerAlias(Alias $alias, array $options = [], ?ContainerBuilder $builder = null)
124124
{
125125
if (!$builder) {
126126
$this->writeData($this->getContainerAliasData($alias), $options);

Console/Descriptor/MarkdownDescriptor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ protected function describeContainerTags(ContainerBuilder $builder, array $optio
8888
}
8989
}
9090

91-
protected function describeContainerService(object $service, array $options = [], ContainerBuilder $builder = null)
91+
protected function describeContainerService(object $service, array $options = [], ?ContainerBuilder $builder = null)
9292
{
9393
if (!isset($options['id'])) {
9494
throw new \InvalidArgumentException('An "id" option must be provided.');
@@ -253,7 +253,7 @@ protected function describeContainerDefinition(Definition $definition, array $op
253253
$this->write(isset($options['id']) ? sprintf("### %s\n\n%s\n", $options['id'], $output) : $output);
254254
}
255255

256-
protected function describeContainerAlias(Alias $alias, array $options = [], ContainerBuilder $builder = null)
256+
protected function describeContainerAlias(Alias $alias, array $options = [], ?ContainerBuilder $builder = null)
257257
{
258258
$output = '- Service: `'.$alias.'`'
259259
."\n".'- Public: '.($alias->isPublic() && !$alias->isPrivate() ? 'yes' : 'no');

Console/Descriptor/TextDescriptor.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class TextDescriptor extends Descriptor
3939
{
4040
private $fileLinkFormatter;
4141

42-
public function __construct(FileLinkFormatter $fileLinkFormatter = null)
42+
public function __construct(?FileLinkFormatter $fileLinkFormatter = null)
4343
{
4444
$this->fileLinkFormatter = $fileLinkFormatter;
4545
}
@@ -141,7 +141,7 @@ protected function describeContainerTags(ContainerBuilder $builder, array $optio
141141
}
142142
}
143143

144-
protected function describeContainerService(object $service, array $options = [], ContainerBuilder $builder = null)
144+
protected function describeContainerService(object $service, array $options = [], ?ContainerBuilder $builder = null)
145145
{
146146
if (!isset($options['id'])) {
147147
throw new \InvalidArgumentException('An "id" option must be provided.');
@@ -389,7 +389,7 @@ protected function describeContainerDeprecations(ContainerBuilder $builder, arra
389389
$options['output']->listing($formattedLogs);
390390
}
391391

392-
protected function describeContainerAlias(Alias $alias, array $options = [], ContainerBuilder $builder = null)
392+
protected function describeContainerAlias(Alias $alias, array $options = [], ?ContainerBuilder $builder = null)
393393
{
394394
if ($alias->isPublic() && !$alias->isPrivate()) {
395395
$options['output']->comment(sprintf('This service is a <info>public</info> alias for the service <info>%s</info>', (string) $alias));
@@ -541,7 +541,7 @@ private function formatRouterConfig(array $config): string
541541
return trim($configAsString);
542542
}
543543

544-
private function formatControllerLink($controller, string $anchorText, callable $getContainer = null): string
544+
private function formatControllerLink($controller, string $anchorText, ?callable $getContainer = null): string
545545
{
546546
if (null === $this->fileLinkFormatter) {
547547
return $anchorText;

Console/Descriptor/XmlDescriptor.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ protected function describeContainerTags(ContainerBuilder $builder, array $optio
5353
$this->writeDocument($this->getContainerTagsDocument($builder, isset($options['show_hidden']) && $options['show_hidden']));
5454
}
5555

56-
protected function describeContainerService(object $service, array $options = [], ContainerBuilder $builder = null)
56+
protected function describeContainerService(object $service, array $options = [], ?ContainerBuilder $builder = null)
5757
{
5858
if (!isset($options['id'])) {
5959
throw new \InvalidArgumentException('An "id" option must be provided.');
@@ -72,7 +72,7 @@ protected function describeContainerDefinition(Definition $definition, array $op
7272
$this->writeDocument($this->getContainerDefinitionDocument($definition, $options['id'] ?? null, isset($options['omit_tags']) && $options['omit_tags'], isset($options['show_arguments']) && $options['show_arguments']));
7373
}
7474

75-
protected function describeContainerAlias(Alias $alias, array $options = [], ContainerBuilder $builder = null)
75+
protected function describeContainerAlias(Alias $alias, array $options = [], ?ContainerBuilder $builder = null)
7676
{
7777
$dom = new \DOMDocument('1.0', 'UTF-8');
7878
$dom->appendChild($dom->importNode($this->getContainerAliasDocument($alias, $options['id'] ?? null)->childNodes->item(0), true));
@@ -155,7 +155,7 @@ private function getRouteCollectionDocument(RouteCollection $routes): \DOMDocume
155155
return $dom;
156156
}
157157

158-
private function getRouteDocument(Route $route, string $name = null): \DOMDocument
158+
private function getRouteDocument(Route $route, ?string $name = null): \DOMDocument
159159
{
160160
$dom = new \DOMDocument('1.0', 'UTF-8');
161161
$dom->appendChild($routeXML = $dom->createElement('route'));
@@ -255,7 +255,7 @@ private function getContainerTagsDocument(ContainerBuilder $builder, bool $showH
255255
return $dom;
256256
}
257257

258-
private function getContainerServiceDocument(object $service, string $id, ContainerBuilder $builder = null, bool $showArguments = false): \DOMDocument
258+
private function getContainerServiceDocument(object $service, string $id, ?ContainerBuilder $builder = null, bool $showArguments = false): \DOMDocument
259259
{
260260
$dom = new \DOMDocument('1.0', 'UTF-8');
261261

@@ -275,7 +275,7 @@ private function getContainerServiceDocument(object $service, string $id, Contai
275275
return $dom;
276276
}
277277

278-
private function getContainerServicesDocument(ContainerBuilder $builder, string $tag = null, bool $showHidden = false, bool $showArguments = false, callable $filter = null): \DOMDocument
278+
private function getContainerServicesDocument(ContainerBuilder $builder, ?string $tag = null, bool $showHidden = false, bool $showArguments = false, ?callable $filter = null): \DOMDocument
279279
{
280280
$dom = new \DOMDocument('1.0', 'UTF-8');
281281
$dom->appendChild($containerXML = $dom->createElement('container'));
@@ -301,7 +301,7 @@ private function getContainerServicesDocument(ContainerBuilder $builder, string
301301
return $dom;
302302
}
303303

304-
private function getContainerDefinitionDocument(Definition $definition, string $id = null, bool $omitTags = false, bool $showArguments = false): \DOMDocument
304+
private function getContainerDefinitionDocument(Definition $definition, ?string $id = null, bool $omitTags = false, bool $showArguments = false): \DOMDocument
305305
{
306306
$dom = new \DOMDocument('1.0', 'UTF-8');
307307
$dom->appendChild($serviceXML = $dom->createElement('definition'));
@@ -432,7 +432,7 @@ private function getArgumentNodes(array $arguments, \DOMDocument $dom): array
432432
return $nodes;
433433
}
434434

435-
private function getContainerAliasDocument(Alias $alias, string $id = null): \DOMDocument
435+
private function getContainerAliasDocument(Alias $alias, ?string $id = null): \DOMDocument
436436
{
437437
$dom = new \DOMDocument('1.0', 'UTF-8');
438438
$dom->appendChild($aliasXML = $dom->createElement('alias'));

Console/Helper/DescriptorHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
*/
2626
class DescriptorHelper extends BaseDescriptorHelper
2727
{
28-
public function __construct(FileLinkFormatter $fileLinkFormatter = null)
28+
public function __construct(?FileLinkFormatter $fileLinkFormatter = null)
2929
{
3030
$this
3131
->register('txt', new TextDescriptor($fileLinkFormatter))

Controller/AbstractController.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ protected function json($data, int $status = 200, array $headers = [], array $co
193193
*
194194
* @param \SplFileInfo|string $file File object or path to file to be sent as response
195195
*/
196-
protected function file($file, string $fileName = null, string $disposition = ResponseHeaderBag::DISPOSITION_ATTACHMENT): BinaryFileResponse
196+
protected function file($file, ?string $fileName = null, string $disposition = ResponseHeaderBag::DISPOSITION_ATTACHMENT): BinaryFileResponse
197197
{
198198
$response = new BinaryFileResponse($file);
199199
$response->setContentDisposition($disposition, null === $fileName ? $response->getFile()->getFilename() : $fileName);
@@ -261,7 +261,7 @@ protected function renderView(string $view, array $parameters = []): string
261261
/**
262262
* Renders a view.
263263
*/
264-
protected function render(string $view, array $parameters = [], Response $response = null): Response
264+
protected function render(string $view, array $parameters = [], ?Response $response = null): Response
265265
{
266266
$content = $this->renderView($view, $parameters);
267267

@@ -279,7 +279,7 @@ protected function render(string $view, array $parameters = [], Response $respon
279279
*
280280
* If an invalid form is found in the list of parameters, a 422 status code is returned.
281281
*/
282-
protected function renderForm(string $view, array $parameters = [], Response $response = null): Response
282+
protected function renderForm(string $view, array $parameters = [], ?Response $response = null): Response
283283
{
284284
if (null === $response) {
285285
$response = new Response();
@@ -307,7 +307,7 @@ protected function renderForm(string $view, array $parameters = [], Response $re
307307
/**
308308
* Streams a view.
309309
*/
310-
protected function stream(string $view, array $parameters = [], StreamedResponse $response = null): StreamedResponse
310+
protected function stream(string $view, array $parameters = [], ?StreamedResponse $response = null): StreamedResponse
311311
{
312312
if (!$this->container->has('twig')) {
313313
throw new \LogicException('You cannot use the "stream" method if the Twig Bundle is not available. Try running "composer require symfony/twig-bundle".');
@@ -335,7 +335,7 @@ protected function stream(string $view, array $parameters = [], StreamedResponse
335335
*
336336
* throw $this->createNotFoundException('Page not found!');
337337
*/
338-
protected function createNotFoundException(string $message = 'Not Found', \Throwable $previous = null): NotFoundHttpException
338+
protected function createNotFoundException(string $message = 'Not Found', ?\Throwable $previous = null): NotFoundHttpException
339339
{
340340
return new NotFoundHttpException($message, $previous);
341341
}
@@ -349,7 +349,7 @@ protected function createNotFoundException(string $message = 'Not Found', \Throw
349349
*
350350
* @throws \LogicException If the Security component is not available
351351
*/
352-
protected function createAccessDeniedException(string $message = 'Access Denied.', \Throwable $previous = null): AccessDeniedException
352+
protected function createAccessDeniedException(string $message = 'Access Denied.', ?\Throwable $previous = null): AccessDeniedException
353353
{
354354
if (!class_exists(AccessDeniedException::class)) {
355355
throw new \LogicException('You cannot use the "createAccessDeniedException" method if the Security component is not available. Try running "composer require symfony/security-bundle".');

0 commit comments

Comments
 (0)