Skip to content

Commit 810e418

Browse files
committed
[Renaming] Allow self/static on RenamePropertyRector
1 parent 6a6047c commit 810e418

2 files changed

Lines changed: 36 additions & 0 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
namespace Rector\Tests\Renaming\Rector\PropertyFetch\RenamePropertyRector\Fixture;
4+
5+
class MyClass
6+
{
7+
protected static array $_config = ['tmp'];
8+
9+
public static function test() {
10+
$tmp = self::$_config;
11+
return static::$_config;
12+
}
13+
}
14+
15+
?>
16+
-----
17+
<?php
18+
19+
namespace Rector\Tests\Renaming\Rector\PropertyFetch\RenamePropertyRector\Fixture;
20+
21+
class MyClass
22+
{
23+
protected static array $config = ['tmp'];
24+
25+
public static function test() {
26+
$tmp = self::$config;
27+
return static::$config;
28+
}
29+
}
30+
31+
?>

rules-tests/Renaming/Rector/PropertyFetch/RenamePropertyRector/config/configured_rule.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,10 @@
3434
'oldProperty',
3535
'newProperty'
3636
),
37+
new RenameProperty(
38+
'Rector\Tests\Renaming\Rector\PropertyFetch\RenamePropertyRector\Fixture\MyClass',
39+
'_config',
40+
'config'
41+
),
3742
]);
3843
};

0 commit comments

Comments
 (0)