Skip to content

Commit dd343cc

Browse files
committed
Fix downgrade throw on ArrowFunction return
1 parent ccb48e6 commit dd343cc

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
namespace Rector\Tests\DowngradePhp80\Rector\Expression\DowngradeThrowExprRector\Fixture;
4+
5+
class FnReturnThrow
6+
{
7+
public function run()
8+
{
9+
$line = Callback::invokeSafe('fgets', [$f], fn($error) => throw new Nette\IOException(\sprintf("Unable to read file '%s'. %s", self::normalizePath($file), $error)));
10+
}
11+
}
12+
13+
?>
14+
-----
15+
<?php
16+
17+
namespace Rector\Tests\DowngradePhp80\Rector\Expression\DowngradeThrowExprRector\Fixture;
18+
19+
class FnReturnThrow
20+
{
21+
public function run()
22+
{
23+
$line = Callback::invokeSafe('fgets', [$f], function ($error) use ($file) {
24+
throw new Nette\IOException(\sprintf("Unable to read file '%s'. %s", self::normalizePath($file), $error));
25+
});
26+
}
27+
}
28+
29+
?>

0 commit comments

Comments
 (0)