Skip to content

Commit 39225b1

Browse files
Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
1 parent de2ff4c commit 39225b1

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

DebugClassLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ public function loadClass(string $class): void
301301
$this->checkClass($class, $file);
302302
}
303303

304-
private function checkClass(string $class, string $file = null): void
304+
private function checkClass(string $class, ?string $file = null): void
305305
{
306306
$exists = null === $file || class_exists($class, false) || interface_exists($class, false) || trait_exists($class, false);
307307

@@ -763,7 +763,7 @@ private function getOwnInterfaces(string $class, ?string $parent): array
763763
return $ownInterfaces;
764764
}
765765

766-
private function setReturnType(string $types, string $class, string $method, string $filename, ?string $parent, \ReflectionType $returnType = null): void
766+
private function setReturnType(string $types, string $class, string $method, string $filename, ?string $parent, ?\ReflectionType $returnType = null): void
767767
{
768768
if ('__construct' === $method) {
769769
return;

Error/FatalError.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class FatalError extends \Error
2020
*
2121
* @param array $error An array as returned by error_get_last()
2222
*/
23-
public function __construct(string $message, int $code, array $error, int $traceOffset = null, bool $traceArgs = true, array $trace = null)
23+
public function __construct(string $message, int $code, array $error, ?int $traceOffset = null, bool $traceArgs = true, ?array $trace = null)
2424
{
2525
parent::__construct($message, $code);
2626

ErrorHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class ErrorHandler
108108
/**
109109
* Registers the error handler.
110110
*/
111-
public static function register(self $handler = null, bool $replace = true): self
111+
public static function register(?self $handler = null, bool $replace = true): self
112112
{
113113
if (null === self::$reservedMemory) {
114114
self::$reservedMemory = str_repeat('x', 32768);
@@ -181,7 +181,7 @@ public static function call(callable $function, ...$arguments)
181181
}
182182
}
183183

184-
public function __construct(BufferingLogger $bootstrappingLogger = null, bool $debug = false)
184+
public function __construct(?BufferingLogger $bootstrappingLogger = null, bool $debug = false)
185185
{
186186
if ($bootstrappingLogger) {
187187
$this->bootstrappingLogger = $bootstrappingLogger;
@@ -633,7 +633,7 @@ public function handleException(\Throwable $exception)
633633
*
634634
* @internal
635635
*/
636-
public static function handleFatalError(array $error = null): void
636+
public static function handleFatalError(?array $error = null): void
637637
{
638638
if (null === self::$reservedMemory) {
639639
return;

ErrorRenderer/HtmlErrorRenderer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class HtmlErrorRenderer implements ErrorRendererInterface
4747
* @param string|FileLinkFormatter|null $fileLinkFormat
4848
* @param bool|callable $outputBuffer The output buffer as a string or a callable that should return it
4949
*/
50-
public function __construct($debug = false, string $charset = null, $fileLinkFormat = null, string $projectDir = null, $outputBuffer = '', LoggerInterface $logger = null)
50+
public function __construct($debug = false, ?string $charset = null, $fileLinkFormat = null, ?string $projectDir = null, $outputBuffer = '', ?LoggerInterface $logger = null)
5151
{
5252
if (!\is_bool($debug) && !\is_callable($debug)) {
5353
throw new \TypeError(sprintf('Argument 1 passed to "%s()" must be a boolean or a callable, "%s" given.', __METHOD__, \gettype($debug)));
@@ -235,7 +235,7 @@ private function getFileLink(string $file, int $line)
235235
* @param int $line The line number
236236
* @param string $text Use this text for the link rather than the file path
237237
*/
238-
private function formatFile(string $file, int $line, string $text = null): string
238+
private function formatFile(string $file, int $line, ?string $text = null): string
239239
{
240240
$file = trim($file);
241241

ErrorRenderer/SerializerErrorRenderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class SerializerErrorRenderer implements ErrorRendererInterface
3434
* formats not supported by Request::getMimeTypes() should be given as mime types
3535
* @param bool|callable $debug The debugging mode as a boolean or a callable that should return it
3636
*/
37-
public function __construct(SerializerInterface $serializer, $format, ErrorRendererInterface $fallbackErrorRenderer = null, $debug = false)
37+
public function __construct(SerializerInterface $serializer, $format, ?ErrorRendererInterface $fallbackErrorRenderer = null, $debug = false)
3838
{
3939
if (!\is_string($format) && !\is_callable($format)) {
4040
throw new \TypeError(sprintf('Argument 2 passed to "%s()" must be a string or a callable, "%s" given.', __METHOD__, \gettype($format)));

Exception/FlattenException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ class FlattenException
6363
/**
6464
* @return static
6565
*/
66-
public static function create(\Exception $exception, int $statusCode = null, array $headers = []): self
66+
public static function create(\Exception $exception, ?int $statusCode = null, array $headers = []): self
6767
{
6868
return static::createFromThrowable($exception, $statusCode, $headers);
6969
}
7070

7171
/**
7272
* @return static
7373
*/
74-
public static function createFromThrowable(\Throwable $exception, int $statusCode = null, array $headers = []): self
74+
public static function createFromThrowable(\Throwable $exception, ?int $statusCode = null, array $headers = []): self
7575
{
7676
$e = new static();
7777
$e->setMessage($exception->getMessage());

0 commit comments

Comments
 (0)