Skip to content

Commit c31bb92

Browse files
Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
1 parent 611c427 commit c31bb92

File tree

88 files changed

+109
-109
lines changed

Some content is hidden

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

88 files changed

+109
-109
lines changed

CacheWarmer/CacheWarmerAggregate.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class CacheWarmerAggregate implements CacheWarmerInterface
2929
/**
3030
* @param iterable<mixed, CacheWarmerInterface> $warmers
3131
*/
32-
public function __construct(iterable $warmers = [], bool $debug = false, string $deprecationLogsFilepath = null)
32+
public function __construct(iterable $warmers = [], bool $debug = false, ?string $deprecationLogsFilepath = null)
3333
{
3434
$this->warmers = $warmers;
3535
$this->debug = $debug;

Config/FileLocator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function __construct(KernelInterface $kernel)
3333
/**
3434
* {@inheritdoc}
3535
*/
36-
public function locate(string $file, string $currentPath = null, bool $first = true)
36+
public function locate(string $file, ?string $currentPath = null, bool $first = true)
3737
{
3838
if (isset($file[0]) && '@' === $file[0]) {
3939
$resource = $this->kernel->locateResource($file);

Controller/ArgumentResolver.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ final class ArgumentResolver implements ArgumentResolverInterface
3333
/**
3434
* @param iterable<mixed, ArgumentValueResolverInterface> $argumentValueResolvers
3535
*/
36-
public function __construct(ArgumentMetadataFactoryInterface $argumentMetadataFactory = null, iterable $argumentValueResolvers = [])
36+
public function __construct(?ArgumentMetadataFactoryInterface $argumentMetadataFactory = null, iterable $argumentValueResolvers = [])
3737
{
3838
$this->argumentMetadataFactory = $argumentMetadataFactory ?? new ArgumentMetadataFactory();
3939
$this->argumentValueResolvers = $argumentValueResolvers ?: self::getDefaultArgumentValueResolvers();

Controller/ContainerControllerResolver.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class ContainerControllerResolver extends ControllerResolver
2525
{
2626
protected $container;
2727

28-
public function __construct(ContainerInterface $container, LoggerInterface $logger = null)
28+
public function __construct(ContainerInterface $container, ?LoggerInterface $logger = null)
2929
{
3030
$this->container = $container;
3131

Controller/ControllerResolver.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class ControllerResolver implements ControllerResolverInterface
2525
{
2626
private $logger;
2727

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

ControllerMetadata/ArgumentMetadata.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public function getAttribute(): ?ArgumentInterface
137137
/**
138138
* @return object[]
139139
*/
140-
public function getAttributes(string $name = null, int $flags = 0): array
140+
public function getAttributes(?string $name = null, int $flags = 0): array
141141
{
142142
if (!$name) {
143143
return $this->attributes;

DataCollector/AjaxDataCollector.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*/
2222
class AjaxDataCollector extends DataCollector
2323
{
24-
public function collect(Request $request, Response $response, \Throwable $exception = null)
24+
public function collect(Request $request, Response $response, ?\Throwable $exception = null)
2525
{
2626
// all collecting is done client side
2727
}

DataCollector/ConfigDataCollector.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ class ConfigDataCollector extends DataCollector implements LateDataCollectorInte
3232
/**
3333
* Sets the Kernel associated with this Request.
3434
*/
35-
public function setKernel(KernelInterface $kernel = null)
35+
public function setKernel(?KernelInterface $kernel = null)
3636
{
3737
$this->kernel = $kernel;
3838
}
3939

4040
/**
4141
* {@inheritdoc}
4242
*/
43-
public function collect(Request $request, Response $response, \Throwable $exception = null)
43+
public function collect(Request $request, Response $response, ?\Throwable $exception = null)
4444
{
4545
$eom = \DateTime::createFromFormat('d/m/Y', '01/'.Kernel::END_OF_MAINTENANCE);
4646
$eol = \DateTime::createFromFormat('d/m/Y', '01/'.Kernel::END_OF_LIFE);

DataCollector/DataCollectorInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ interface DataCollectorInterface extends ResetInterface
2525
/**
2626
* Collects data for the given Request and Response.
2727
*/
28-
public function collect(Request $request, Response $response, \Throwable $exception = null);
28+
public function collect(Request $request, Response $response, ?\Throwable $exception = null);
2929

3030
/**
3131
* Returns the name of the collector.

DataCollector/DumpDataCollector.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
4747
* @param string|FileLinkFormatter|null $fileLinkFormat
4848
* @param DataDumperInterface|Connection|null $dumper
4949
*/
50-
public function __construct(Stopwatch $stopwatch = null, $fileLinkFormat = null, string $charset = null, RequestStack $requestStack = null, $dumper = null)
50+
public function __construct(?Stopwatch $stopwatch = null, $fileLinkFormat = null, ?string $charset = null, ?RequestStack $requestStack = null, $dumper = null)
5151
{
5252
$fileLinkFormat = $fileLinkFormat ?: \ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format');
5353
$this->stopwatch = $stopwatch;
@@ -101,7 +101,7 @@ public function dump(Data $data)
101101
}
102102
}
103103

104-
public function collect(Request $request, Response $response, \Throwable $exception = null)
104+
public function collect(Request $request, Response $response, ?\Throwable $exception = null)
105105
{
106106
if (!$this->dataCount) {
107107
$this->data = [];

DataCollector/EventDataCollector.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class EventDataCollector extends DataCollector implements LateDataCollectorInter
3030
private $requestStack;
3131
private $currentRequest;
3232

33-
public function __construct(EventDispatcherInterface $dispatcher = null, RequestStack $requestStack = null)
33+
public function __construct(?EventDispatcherInterface $dispatcher = null, ?RequestStack $requestStack = null)
3434
{
3535
$this->dispatcher = $dispatcher;
3636
$this->requestStack = $requestStack;
@@ -39,7 +39,7 @@ public function __construct(EventDispatcherInterface $dispatcher = null, Request
3939
/**
4040
* {@inheritdoc}
4141
*/
42-
public function collect(Request $request, Response $response, \Throwable $exception = null)
42+
public function collect(Request $request, Response $response, ?\Throwable $exception = null)
4343
{
4444
$this->currentRequest = $this->requestStack && $this->requestStack->getMainRequest() !== $request ? $request : null;
4545
$this->data = [

DataCollector/ExceptionDataCollector.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class ExceptionDataCollector extends DataCollector
2525
/**
2626
* {@inheritdoc}
2727
*/
28-
public function collect(Request $request, Response $response, \Throwable $exception = null)
28+
public function collect(Request $request, Response $response, ?\Throwable $exception = null)
2929
{
3030
if (null !== $exception) {
3131
$this->data = [

DataCollector/LoggerDataCollector.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class LoggerDataCollector extends DataCollector implements LateDataCollectorInte
3030
private $requestStack;
3131
private $processedLogs;
3232

33-
public function __construct(object $logger = null, string $containerPathPrefix = null, RequestStack $requestStack = null)
33+
public function __construct(?object $logger = null, ?string $containerPathPrefix = null, ?RequestStack $requestStack = null)
3434
{
3535
if (null !== $logger && $logger instanceof DebugLoggerInterface) {
3636
$this->logger = $logger;
@@ -43,7 +43,7 @@ public function __construct(object $logger = null, string $containerPathPrefix =
4343
/**
4444
* {@inheritdoc}
4545
*/
46-
public function collect(Request $request, Response $response, \Throwable $exception = null)
46+
public function collect(Request $request, Response $response, ?\Throwable $exception = null)
4747
{
4848
$this->currentRequest = $this->requestStack && $this->requestStack->getMainRequest() !== $request ? $request : null;
4949
}
@@ -222,7 +222,7 @@ private function getContainerDeprecationLogs(): array
222222
return $logs;
223223
}
224224

225-
private function getContainerCompilerLogs(string $compilerLogsFilepath = null): array
225+
private function getContainerCompilerLogs(?string $compilerLogsFilepath = null): array
226226
{
227227
if (!$compilerLogsFilepath || !is_file($compilerLogsFilepath)) {
228228
return [];

DataCollector/MemoryDataCollector.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function __construct()
2929
/**
3030
* {@inheritdoc}
3131
*/
32-
public function collect(Request $request, Response $response, \Throwable $exception = null)
32+
public function collect(Request $request, Response $response, ?\Throwable $exception = null)
3333
{
3434
$this->updateMemoryUsage();
3535
}

DataCollector/RequestDataCollector.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class RequestDataCollector extends DataCollector implements EventSubscriberInter
3838
private $sessionUsages = [];
3939
private $requestStack;
4040

41-
public function __construct(RequestStack $requestStack = null)
41+
public function __construct(?RequestStack $requestStack = null)
4242
{
4343
$this->controllers = new \SplObjectStorage();
4444
$this->requestStack = $requestStack;
@@ -47,7 +47,7 @@ public function __construct(RequestStack $requestStack = null)
4747
/**
4848
* {@inheritdoc}
4949
*/
50-
public function collect(Request $request, Response $response, \Throwable $exception = null)
50+
public function collect(Request $request, Response $response, ?\Throwable $exception = null)
5151
{
5252
// attributes are serialized and as they can be anything, they need to be converted to strings.
5353
$attributes = [];

DataCollector/RouterDataCollector.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function __construct()
3636
*
3737
* @final
3838
*/
39-
public function collect(Request $request, Response $response, \Throwable $exception = null)
39+
public function collect(Request $request, Response $response, ?\Throwable $exception = null)
4040
{
4141
if ($response instanceof RedirectResponse) {
4242
$this->data['redirect'] = true;

DataCollector/TimeDataCollector.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class TimeDataCollector extends DataCollector implements LateDataCollectorInterf
2727
private $kernel;
2828
private $stopwatch;
2929

30-
public function __construct(KernelInterface $kernel = null, Stopwatch $stopwatch = null)
30+
public function __construct(?KernelInterface $kernel = null, ?Stopwatch $stopwatch = null)
3131
{
3232
$this->kernel = $kernel;
3333
$this->stopwatch = $stopwatch;
@@ -37,7 +37,7 @@ public function __construct(KernelInterface $kernel = null, Stopwatch $stopwatch
3737
/**
3838
* {@inheritdoc}
3939
*/
40-
public function collect(Request $request, Response $response, \Throwable $exception = null)
40+
public function collect(Request $request, Response $response, ?\Throwable $exception = null)
4141
{
4242
if (null !== $this->kernel) {
4343
$startTime = $this->kernel->getStartTime();

Debug/FileLinkFormatter.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class FileLinkFormatter
4343
* @param string|array|null $fileLinkFormat
4444
* @param string|\Closure $urlFormat the URL format, or a closure that returns it on-demand
4545
*/
46-
public function __construct($fileLinkFormat = null, RequestStack $requestStack = null, string $baseDir = null, $urlFormat = null)
46+
public function __construct($fileLinkFormat = null, ?RequestStack $requestStack = null, ?string $baseDir = null, $urlFormat = null)
4747
{
4848
if (!\is_array($fileLinkFormat) && $fileLinkFormat = (self::FORMATS[$fileLinkFormat] ?? $fileLinkFormat) ?: \ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format')) {
4949
$i = strpos($f = $fileLinkFormat, '&', max(strrpos($f, '%f'), strrpos($f, '%l'))) ?: \strlen($f);

EventListener/AbstractSessionListener.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ abstract class AbstractSessionListener implements EventSubscriberInterface, Rese
5757
/**
5858
* @internal
5959
*/
60-
public function __construct(ContainerInterface $container = null, bool $debug = false, array $sessionOptions = [])
60+
public function __construct(?ContainerInterface $container = null, bool $debug = false, array $sessionOptions = [])
6161
{
6262
$this->container = $container;
6363
$this->debug = $debug;

EventListener/DebugHandlersListener.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class DebugHandlersListener implements EventSubscriberInterface
4949
* @param bool $scream Enables/disables screaming mode, where even silenced errors are logged
5050
* @param bool $scope Enables/disables scoping mode
5151
*/
52-
public function __construct(callable $exceptionHandler = null, LoggerInterface $logger = null, $levels = \E_ALL, ?int $throwAt = \E_ALL, bool $scream = true, $scope = true, $deprecationLogger = null, $fileLinkFormat = null)
52+
public function __construct(?callable $exceptionHandler = null, ?LoggerInterface $logger = null, $levels = \E_ALL, ?int $throwAt = \E_ALL, bool $scream = true, $scope = true, $deprecationLogger = null, $fileLinkFormat = null)
5353
{
5454
if (!\is_bool($scope)) {
5555
trigger_deprecation('symfony/http-kernel', '5.4', 'Passing a $fileLinkFormat is deprecated.');
@@ -73,7 +73,7 @@ public function __construct(callable $exceptionHandler = null, LoggerInterface $
7373
/**
7474
* Configures the error handler.
7575
*/
76-
public function configure(object $event = null)
76+
public function configure(?object $event = null)
7777
{
7878
if ($event instanceof ConsoleEvent && !\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true)) {
7979
return;

EventListener/DumpListener.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class DumpListener implements EventSubscriberInterface
2929
private $dumper;
3030
private $connection;
3131

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

EventListener/ErrorListener.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class ErrorListener implements EventSubscriberInterface
4141
/**
4242
* @param array<class-string, array{log_level: string|null, status_code: int<100,599>|null}> $exceptionsMapping
4343
*/
44-
public function __construct($controller, LoggerInterface $logger = null, bool $debug = false, array $exceptionsMapping = [])
44+
public function __construct($controller, ?LoggerInterface $logger = null, bool $debug = false, array $exceptionsMapping = [])
4545
{
4646
$this->controller = $controller;
4747
$this->logger = $logger;
@@ -155,7 +155,7 @@ public static function getSubscribedEvents(): array
155155
/**
156156
* Logs an exception.
157157
*/
158-
protected function logException(\Throwable $exception, string $message, string $logLevel = null): void
158+
protected function logException(\Throwable $exception, string $message, ?string $logLevel = null): void
159159
{
160160
if (null !== $this->logger) {
161161
if (null !== $logLevel) {

EventListener/LocaleListener.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class LocaleListener implements EventSubscriberInterface
3535
private $useAcceptLanguageHeader;
3636
private $enabledLocales;
3737

38-
public function __construct(RequestStack $requestStack, string $defaultLocale = 'en', RequestContextAwareInterface $router = null, bool $useAcceptLanguageHeader = false, array $enabledLocales = [])
38+
public function __construct(RequestStack $requestStack, string $defaultLocale = 'en', ?RequestContextAwareInterface $router = null, bool $useAcceptLanguageHeader = false, array $enabledLocales = [])
3939
{
4040
$this->defaultLocale = $defaultLocale;
4141
$this->requestStack = $requestStack;

EventListener/ProfilerListener.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class ProfilerListener implements EventSubscriberInterface
4848
* @param bool $onlyException True if the profiler only collects data when an exception occurs, false otherwise
4949
* @param bool $onlyMainRequests True if the profiler only collects data when the request is the main request, false otherwise
5050
*/
51-
public function __construct(Profiler $profiler, RequestStack $requestStack, RequestMatcherInterface $matcher = null, bool $onlyException = false, bool $onlyMainRequests = false, string $collectParameter = null)
51+
public function __construct(Profiler $profiler, RequestStack $requestStack, ?RequestMatcherInterface $matcher = null, bool $onlyException = false, bool $onlyMainRequests = false, ?string $collectParameter = null)
5252
{
5353
$this->profiler = $profiler;
5454
$this->matcher = $matcher;

EventListener/RouterListener.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class RouterListener implements EventSubscriberInterface
5555
*
5656
* @throws \InvalidArgumentException
5757
*/
58-
public function __construct($matcher, RequestStack $requestStack, RequestContext $context = null, LoggerInterface $logger = null, string $projectDir = null, bool $debug = true)
58+
public function __construct($matcher, RequestStack $requestStack, ?RequestContext $context = null, ?LoggerInterface $logger = null, ?string $projectDir = null, bool $debug = true)
5959
{
6060
if (!$matcher instanceof UrlMatcherInterface && !$matcher instanceof RequestMatcherInterface) {
6161
throw new \InvalidArgumentException('Matcher must either implement UrlMatcherInterface or RequestMatcherInterface.');
@@ -73,7 +73,7 @@ public function __construct($matcher, RequestStack $requestStack, RequestContext
7373
$this->debug = $debug;
7474
}
7575

76-
private function setCurrentRequest(Request $request = null)
76+
private function setCurrentRequest(?Request $request = null)
7777
{
7878
if (null !== $request) {
7979
try {

EventListener/SurrogateListener.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class SurrogateListener implements EventSubscriberInterface
2828
{
2929
private $surrogate;
3030

31-
public function __construct(SurrogateInterface $surrogate = null)
31+
public function __construct(?SurrogateInterface $surrogate = null)
3232
{
3333
$this->surrogate = $surrogate;
3434
}

Exception/AccessDeniedHttpException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class AccessDeniedHttpException extends HttpException
2222
* @param \Throwable|null $previous The previous exception
2323
* @param int $code The internal exception code
2424
*/
25-
public function __construct(?string $message = '', \Throwable $previous = null, int $code = 0, array $headers = [])
25+
public function __construct(?string $message = '', ?\Throwable $previous = null, int $code = 0, array $headers = [])
2626
{
2727
if (null === $message) {
2828
trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__);

Exception/BadRequestHttpException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class BadRequestHttpException extends HttpException
2121
* @param \Throwable|null $previous The previous exception
2222
* @param int $code The internal exception code
2323
*/
24-
public function __construct(?string $message = '', \Throwable $previous = null, int $code = 0, array $headers = [])
24+
public function __construct(?string $message = '', ?\Throwable $previous = null, int $code = 0, array $headers = [])
2525
{
2626
if (null === $message) {
2727
trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__);

Exception/ConflictHttpException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class ConflictHttpException extends HttpException
2121
* @param \Throwable|null $previous The previous exception
2222
* @param int $code The internal exception code
2323
*/
24-
public function __construct(?string $message = '', \Throwable $previous = null, int $code = 0, array $headers = [])
24+
public function __construct(?string $message = '', ?\Throwable $previous = null, int $code = 0, array $headers = [])
2525
{
2626
if (null === $message) {
2727
trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__);

Exception/GoneHttpException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class GoneHttpException extends HttpException
2121
* @param \Throwable|null $previous The previous exception
2222
* @param int $code The internal exception code
2323
*/
24-
public function __construct(?string $message = '', \Throwable $previous = null, int $code = 0, array $headers = [])
24+
public function __construct(?string $message = '', ?\Throwable $previous = null, int $code = 0, array $headers = [])
2525
{
2626
if (null === $message) {
2727
trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__);

Exception/HttpException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class HttpException extends \RuntimeException implements HttpExceptionInterface
2121
private $statusCode;
2222
private $headers;
2323

24-
public function __construct(int $statusCode, ?string $message = '', \Throwable $previous = null, array $headers = [], ?int $code = 0)
24+
public function __construct(int $statusCode, ?string $message = '', ?\Throwable $previous = null, array $headers = [], ?int $code = 0)
2525
{
2626
if (null === $message) {
2727
trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__);

0 commit comments

Comments
 (0)