Skip to content

Commit cbc295a

Browse files
authored
[Php81] Skip by ref param on ReadOnlyPropertyRector (#6532)
1 parent 6b63879 commit cbc295a

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace Rector\Tests\Php81\Rector\Property\ReadOnlyPropertyRector\Fixture;
4+
5+
final class SkipByRefParam
6+
{
7+
public function __construct(private array &$idx)
8+
{
9+
}
10+
}

rules/Php81/Rector/Property/ReadOnlyPropertyRector.php

+4
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,10 @@ private function refactorParam(Class_ $class, ClassMethod $classMethod, Param $p
222222
return null;
223223
}
224224

225+
if ($param->byRef) {
226+
return null;
227+
}
228+
225229
if ($this->paramAnalyzer->isParamReassign($classMethod, $param)) {
226230
return null;
227231
}

0 commit comments

Comments
 (0)