Skip to content

Commit 32b1cc8

Browse files
committed
add fixture with nullable setter
1 parent 18998ca commit 32b1cc8

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
namespace Rector\PHPUnit\Tests\CodeQuality\Rector\MethodCall\ScalarArgumentToExpectedParamTypeRector\Fixture;
4+
5+
use PHPUnit\Framework\TestCase;
6+
use Rector\PHPUnit\Tests\CodeQuality\Rector\MethodCall\ScalarArgumentToExpectedParamTypeRector\Source\NullableSetter;
7+
8+
final class PassToNullableInt extends TestCase
9+
{
10+
public function test()
11+
{
12+
$nullableSetter = new NullableSetter();
13+
$nullableSetter->setValue('123456');
14+
}
15+
}
16+
17+
?>
18+
-----
19+
<?php
20+
21+
namespace Rector\PHPUnit\Tests\CodeQuality\Rector\MethodCall\ScalarArgumentToExpectedParamTypeRector\Fixture;
22+
23+
use PHPUnit\Framework\TestCase;
24+
use Rector\PHPUnit\Tests\CodeQuality\Rector\MethodCall\ScalarArgumentToExpectedParamTypeRector\Source\NullableSetter;
25+
26+
final class PassToNullableInt extends TestCase
27+
{
28+
public function test()
29+
{
30+
$nullableSetter = new NullableSetter();
31+
$nullableSetter->setValue(123456);
32+
}
33+
}
34+
35+
?>

rules-tests/CodeQuality/Rector/MethodCall/ScalarArgumentToExpectedParamTypeRector/Source/NullableSetter.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,8 @@ final class NullableSetter
99
public function setMaybe(?string $status)
1010
{
1111
}
12+
13+
public function setValue(?int $number)
14+
{
15+
}
1216
}

0 commit comments

Comments
 (0)