Skip to content

Commit baa4f0f

Browse files
committed
add test to SortNamedParamRector
1 parent 30c3eee commit baa4f0f

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace Rector\Tests\CodeQuality\Rector\FuncCall\SortNamedParamRector\Fixture;
4+
5+
$items = [1, 2, 3];
6+
$result = array_map(array: $items, callback: fn ($item) => $item * 2);
7+
8+
?>
9+
-----
10+
<?php
11+
12+
namespace Rector\Tests\CodeQuality\Rector\FuncCall\SortNamedParamRector\Fixture;
13+
14+
$items = [1, 2, 3];
15+
$result = array_map(callback: fn ($item) => $item * 2, array: $items);
16+
17+
?>

rules-tests/CodeQuality/Rector/FuncCall/SortNamedParamRector/Fixture/fixture.php.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ function run($foo = null, $bar = null, $baz = null) {}
1818

1919
run(foo: $foo, bar: $bar);
2020

21-
run($foo, bar: $bar, baz: $baz);
21+
run($foo, baz: $baz, bar: $bar);
2222

2323
?>

0 commit comments

Comments
 (0)