Skip to content

Commit 8a03fd7

Browse files
Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
1 parent f1d08ed commit 8a03fd7

38 files changed

+65
-65
lines changed

Annotation/Route.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,20 @@ class Route
4949
public function __construct(
5050
$data = [],
5151
$path = null,
52-
string $name = null,
52+
?string $name = null,
5353
array $requirements = [],
5454
array $options = [],
5555
array $defaults = [],
56-
string $host = null,
56+
?string $host = null,
5757
$methods = [],
5858
$schemes = [],
59-
string $condition = null,
60-
int $priority = null,
61-
string $locale = null,
62-
string $format = null,
63-
bool $utf8 = null,
64-
bool $stateless = null,
65-
string $env = null
59+
?string $condition = null,
60+
?int $priority = null,
61+
?string $locale = null,
62+
?string $format = null,
63+
?bool $utf8 = null,
64+
?bool $stateless = null,
65+
?string $env = null
6666
) {
6767
if (\is_string($data)) {
6868
$data = ['path' => $data];

CompiledRoute.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class CompiledRoute implements \Serializable
3737
* @param array $hostVariables An array of host variables
3838
* @param array $variables An array of variables (variables defined in the path and in the host patterns)
3939
*/
40-
public function __construct(string $staticPrefix, string $regex, array $tokens, array $pathVariables, string $hostRegex = null, array $hostTokens = [], array $hostVariables = [], array $variables = [])
40+
public function __construct(string $staticPrefix, string $regex, array $tokens, array $pathVariables, ?string $hostRegex = null, array $hostTokens = [], array $hostVariables = [], array $variables = [])
4141
{
4242
$this->staticPrefix = $staticPrefix;
4343
$this->regex = $regex;

Exception/MethodNotAllowedException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class MethodNotAllowedException extends \RuntimeException implements ExceptionIn
2525
/**
2626
* @param string[] $allowedMethods
2727
*/
28-
public function __construct(array $allowedMethods, ?string $message = '', int $code = 0, \Throwable $previous = null)
28+
public function __construct(array $allowedMethods, ?string $message = '', int $code = 0, ?\Throwable $previous = null)
2929
{
3030
if (null === $message) {
3131
trigger_deprecation('symfony/routing', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__);

Generator/CompiledUrlGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class CompiledUrlGenerator extends UrlGenerator
2323
private $compiledRoutes = [];
2424
private $defaultLocale;
2525

26-
public function __construct(array $compiledRoutes, RequestContext $context, LoggerInterface $logger = null, string $defaultLocale = null)
26+
public function __construct(array $compiledRoutes, RequestContext $context, ?LoggerInterface $logger = null, ?string $defaultLocale = null)
2727
{
2828
$this->compiledRoutes = $compiledRoutes;
2929
$this->context = $context;

Generator/UrlGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class UrlGenerator implements UrlGeneratorInterface, ConfigurableRequirementsInt
8282
'%7C' => '|',
8383
];
8484

85-
public function __construct(RouteCollection $routes, RequestContext $context, LoggerInterface $logger = null, string $defaultLocale = null)
85+
public function __construct(RouteCollection $routes, RequestContext $context, ?LoggerInterface $logger = null, ?string $defaultLocale = null)
8686
{
8787
$this->routes = $routes;
8888
$this->context = $context;

Loader/AnnotationClassLoader.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ abstract class AnnotationClassLoader implements LoaderInterface
8585
*/
8686
protected $defaultRouteIndex = 0;
8787

88-
public function __construct(Reader $reader = null, string $env = null)
88+
public function __construct(?Reader $reader = null, ?string $env = null)
8989
{
9090
$this->reader = $reader;
9191
$this->env = $env;
@@ -108,7 +108,7 @@ public function setRouteAnnotationClass(string $class)
108108
*
109109
* @throws \InvalidArgumentException When route can't be parsed
110110
*/
111-
public function load($class, string $type = null)
111+
public function load($class, ?string $type = null)
112112
{
113113
if (!class_exists($class)) {
114114
throw new \InvalidArgumentException(sprintf('Class "%s" does not exist.', $class));
@@ -239,7 +239,7 @@ protected function addRoute(RouteCollection $collection, object $annot, array $g
239239
/**
240240
* {@inheritdoc}
241241
*/
242-
public function supports($resource, string $type = null)
242+
public function supports($resource, ?string $type = null)
243243
{
244244
return \is_string($resource) && preg_match('/^(?:\\\\?[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)+$/', $resource) && (!$type || 'annotation' === $type);
245245
}

Loader/AnnotationDirectoryLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class AnnotationDirectoryLoader extends AnnotationFileLoader
3232
*
3333
* @throws \InvalidArgumentException When the directory does not exist or its routes cannot be parsed
3434
*/
35-
public function load($path, string $type = null)
35+
public function load($path, ?string $type = null)
3636
{
3737
if (!is_dir($dir = $this->locator->locate($path))) {
3838
return parent::supports($path, $type) ? parent::load($path, $type) : new RouteCollection();
@@ -74,7 +74,7 @@ function (\SplFileInfo $current) {
7474
/**
7575
* {@inheritdoc}
7676
*/
77-
public function supports($resource, string $type = null)
77+
public function supports($resource, ?string $type = null)
7878
{
7979
if ('annotation' === $type) {
8080
return true;

Loader/AnnotationFileLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function __construct(FileLocatorInterface $locator, AnnotationClassLoader
4747
*
4848
* @throws \InvalidArgumentException When the file does not exist or its routes cannot be parsed
4949
*/
50-
public function load($file, string $type = null)
50+
public function load($file, ?string $type = null)
5151
{
5252
$path = $this->locator->locate($file);
5353

@@ -70,7 +70,7 @@ public function load($file, string $type = null)
7070
/**
7171
* {@inheritdoc}
7272
*/
73-
public function supports($resource, string $type = null)
73+
public function supports($resource, ?string $type = null)
7474
{
7575
return \is_string($resource) && 'php' === pathinfo($resource, \PATHINFO_EXTENSION) && (!$type || 'annotation' === $type);
7676
}

Loader/ClosureLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ class ClosureLoader extends Loader
3131
*
3232
* @return RouteCollection
3333
*/
34-
public function load($closure, string $type = null)
34+
public function load($closure, ?string $type = null)
3535
{
3636
return $closure($this->env);
3737
}
3838

3939
/**
4040
* {@inheritdoc}
4141
*/
42-
public function supports($resource, string $type = null)
42+
public function supports($resource, ?string $type = null)
4343
{
4444
return $resource instanceof \Closure && (!$type || 'closure' === $type);
4545
}

Loader/Configurator/CollectionConfigurator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class CollectionConfigurator
2828
private $parentPrefixes;
2929
private $host;
3030

31-
public function __construct(RouteCollection $parent, string $name, self $parentConfigurator = null, array $parentPrefixes = null)
31+
public function __construct(RouteCollection $parent, string $name, ?self $parentConfigurator = null, ?array $parentPrefixes = null)
3232
{
3333
$this->parent = $parent;
3434
$this->name = $name;

0 commit comments

Comments
 (0)