Skip to content

Commit

Permalink
Fix PHP84 nullable types
Browse files Browse the repository at this point in the history
  • Loading branch information
veewee committed Apr 5, 2024
1 parent a8685b2 commit 1ade4f1
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions config/.php_cs.dist.php
Expand Up @@ -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,
])
;
2 changes: 1 addition & 1 deletion src/Psl/Vec/range.php
Expand Up @@ -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];
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/Dict/SliceTest.php
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/Regex/EveryMatchTest.php
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/Regex/FirstMatchTest.php
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/Vec/SliceTest.php
Expand Up @@ -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);

Expand Down

0 comments on commit 1ade4f1

Please sign in to comment.