-
-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix renaming attributed class members (#2627)
* Fix renaming attributed methods * Add separate test * Change visibility * Remove left `continue` * Clear the logic * Fix also renaming (not promoted) properties * Fix use explicit types * format * Add test for promoted properties * Fix for class constants * Support enum cases * Use `getFileContents()` for node * Only tokens * Simplify * Remove unused import * Simplify * Simplify * Simplify * Compare strictly * Reformat ReflectionMethod to version from master --------- Co-authored-by: __ <__@__>
- Loading branch information
1 parent
ef18b10
commit 6478aa0
Showing
13 changed files
with
221 additions
and
5 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
lib/Rename/Tests/Cases/member_renamer/constant_declaration_public/ClassOne.ph
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
<?php | ||
|
||
use JetBrains\PhpStorm\Deprecated; | ||
|
||
class ClassOne | ||
{ | ||
public const FOO = 'bar'; | ||
|
||
#[Deprecated] | ||
public const MOO = 'bar', ZOO = 'bar'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
lib/Rename/Tests/Cases/member_renamer/enum_case_declaration_private/ClassOne.ph
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
<?php | ||
|
||
use JetBrains\PhpStorm\Deprecated; | ||
|
||
enum ClassOne | ||
{ | ||
case BAR; | ||
#[Deprecated] | ||
case BAZ; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,10 @@ class ClassOne | |
{ | ||
return 'foobar'; | ||
} | ||
|
||
#[\ReturnTypeWillChange] | ||
public function złom(): string | ||
{ | ||
return 'f'; | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
lib/Rename/Tests/Cases/member_renamer/property_declaration_public/ClassOne.ph
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters