Skip to content

Commit 62e8d06

Browse files
authored
[CodingStyle] Mirror comment on SplitDoubleAssignRector (#7977)
1 parent db56ff5 commit 62e8d06

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
namespace Rector\Tests\CodingStyle\Rector\Assign\SplitDoubleAssignRector\Fixture;
4+
5+
class MirrorComment
6+
{
7+
public function run()
8+
{
9+
// some comment
10+
$one = $two = 1;
11+
}
12+
}
13+
14+
?>
15+
-----
16+
<?php
17+
18+
namespace Rector\Tests\CodingStyle\Rector\Assign\SplitDoubleAssignRector\Fixture;
19+
20+
class MirrorComment
21+
{
22+
public function run()
23+
{
24+
// some comment
25+
$one = 1;
26+
$two = 1;
27+
}
28+
}
29+
30+
?>

rules/CodingStyle/Rector/Assign/SplitDoubleAssignRector.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ public function refactor(Node $node): ?array
8080
return null;
8181
}
8282

83+
$this->mirrorComments($collectExpressions[0], $node);
8384
return $collectExpressions;
8485
}
8586

0 commit comments

Comments
 (0)