diff --git a/config/.php_cs.dist.php b/config/.php_cs.dist.php index e6b74160..778a2352 100644 --- a/config/.php_cs.dist.php +++ b/config/.php_cs.dist.php @@ -76,5 +76,6 @@ 'phpdoc_trim_consecutive_blank_line_separation' => true, 'no_empty_statement' => true, 'semicolon_after_instruction' => true, + 'nullable_type_declaration_for_default_null_value' => true, ]) ; diff --git a/src/Psl/Vec/range.php b/src/Psl/Vec/range.php index 6c937db8..59b1e79a 100644 --- a/src/Psl/Vec/range.php +++ b/src/Psl/Vec/range.php @@ -45,7 +45,7 @@ * * @see https://github.com/vimeo/psalm/issues/2152#issuecomment-533363310 */ -function range(int|float $start, int|float $end, int|float $step = null): array +function range(int|float $start, int|float $end, int|float|null $step = null): array { if ((float) $start === (float) $end) { return [$start]; diff --git a/tests/unit/Dict/SliceTest.php b/tests/unit/Dict/SliceTest.php index 46665de9..bdbe2fd3 100644 --- a/tests/unit/Dict/SliceTest.php +++ b/tests/unit/Dict/SliceTest.php @@ -12,7 +12,7 @@ final class SliceTest extends TestCase /** * @dataProvider provideData */ - public function testSlice(array $expected, array $array, int $n, int $l = null): void + public function testSlice(array $expected, array $array, int $n, ?int $l = null): void { $result = Dict\slice($array, $n, $l); diff --git a/tests/unit/Regex/EveryMatchTest.php b/tests/unit/Regex/EveryMatchTest.php index f0db03ad..f8559cf9 100644 --- a/tests/unit/Regex/EveryMatchTest.php +++ b/tests/unit/Regex/EveryMatchTest.php @@ -19,7 +19,7 @@ public function testMatching( array $expected, string $subject, string $pattern, - TypeInterface $shape = null, + ?TypeInterface $shape = null, int $offset = 0 ): void { static::assertSame($expected, Regex\every_match($subject, $pattern, $shape, $offset)); diff --git a/tests/unit/Regex/FirstMatchTest.php b/tests/unit/Regex/FirstMatchTest.php index 79d35d6d..b0bca838 100644 --- a/tests/unit/Regex/FirstMatchTest.php +++ b/tests/unit/Regex/FirstMatchTest.php @@ -19,7 +19,7 @@ public function testMatching( array $expected, string $subject, string $pattern, - TypeInterface $shape = null, + ?TypeInterface $shape = null, int $offset = 0 ): void { static::assertSame($expected, Regex\first_match($subject, $pattern, $shape, $offset)); diff --git a/tests/unit/Vec/SliceTest.php b/tests/unit/Vec/SliceTest.php index eef39c9b..d0d0090a 100644 --- a/tests/unit/Vec/SliceTest.php +++ b/tests/unit/Vec/SliceTest.php @@ -12,7 +12,7 @@ final class SliceTest extends TestCase /** * @dataProvider provideData */ - public function testSlice(array $expected, array $array, int $n, int $l = null): void + public function testSlice(array $expected, array $array, int $n, ?int $l = null): void { $result = Vec\slice($array, $n, $l);