Skip to content

Commit f209d77

Browse files
committed
[CodeQuality] Skip closure use by ref on InlineArrayReturnAssignRector
1 parent 3f23985 commit f209d77

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
namespace Rector\Tests\CodeQuality\Rector\ClassMethod\InlineArrayReturnAssignRector\Fixture;
4+
5+
final class SkipUseClosureUseByRef
6+
{
7+
public static function getData(): array
8+
{
9+
$closure = function () use (&$person)
10+
{
11+
$person['name'] = 'Timmy';
12+
$person['surname'] = 'Back';
13+
14+
return $person;
15+
};
16+
17+
$person = ['test'];
18+
var_dump($closure());
19+
}
20+
}

0 commit comments

Comments
 (0)