Skip to content

Commit f5e3662

Browse files
authored
Add fixture to ensure unique types on AddMethodCallBasedStrictParamTypeRector (#7343)
1 parent e49f085 commit f5e3662

File tree

1 file changed

+39
-0
lines changed
  • rules-tests/TypeDeclaration/Rector/ClassMethod/AddMethodCallBasedStrictParamTypeRector/Fixture

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector\Fixture;
4+
5+
final class UniqueTypes
6+
{
7+
public function run()
8+
{
9+
$this->getById(5);
10+
$this->getById(null);
11+
$this->getById(5);
12+
}
13+
14+
private function getById($id)
15+
{
16+
}
17+
}
18+
19+
?>
20+
-----
21+
<?php
22+
23+
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector\Fixture;
24+
25+
final class UniqueTypes
26+
{
27+
public function run()
28+
{
29+
$this->getById(5);
30+
$this->getById(null);
31+
$this->getById(5);
32+
}
33+
34+
private function getById(?int $id)
35+
{
36+
}
37+
}
38+
39+
?>

0 commit comments

Comments
 (0)