Skip to content

Commit bc4ac03

Browse files
committed
add arrow function node
1 parent 681f6f4 commit bc4ac03

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\ParamTypeByMethodCallTypeRector\Fixture;
4+
5+
use Rector\Tests\TypeDeclaration\Rector\ClassMethod\ParamTypeByMethodCallTypeRector\Source\SomeTypedService;
6+
7+
final class AlsoArrowFunction
8+
{
9+
public function __construct(
10+
private SomeTypedService $someTypedService
11+
) {
12+
}
13+
14+
public function go()
15+
{
16+
$closure = fn ($value) => $this->someTypedService->run($value);
17+
}
18+
}
19+
20+
?>
21+
-----
22+
<?php
23+
24+
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\ParamTypeByMethodCallTypeRector\Fixture;
25+
26+
use Rector\Tests\TypeDeclaration\Rector\ClassMethod\ParamTypeByMethodCallTypeRector\Source\SomeTypedService;
27+
28+
final class AlsoArrowFunction
29+
{
30+
public function __construct(
31+
private SomeTypedService $someTypedService
32+
) {
33+
}
34+
35+
public function go()
36+
{
37+
$closure = fn (string $value) => $this->someTypedService->run($value);
38+
}
39+
}
40+
41+
?>

0 commit comments

Comments
 (0)