-
-
Notifications
You must be signed in to change notification settings - Fork 336
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Php81] Do not add final modifier on class constant that the class ha…
…s children on FinalizePublicClassConstantRector (#1739) * Add failing test fixture for FinalizePublicClassConstantRector # Failing Test for FinalizePublicClassConstantRector Based on https://getrector.org/demo/1ec7f537-6973-6358-8246-11db50a94ec6 * Rename parent_class.php.inc to class_inheritance.php.inc * Update rules-tests/Php81/Rector/ClassConst/FinalizePublicClassConstantRector/Fixture/class_inheritance.php.inc Co-authored-by: Abdul Malik Ikhsan <samsonasik@gmail.com> * Closes #1738 * final touch: clean up * plural fix * Update rules/Php81/Rector/ClassConst/FinalizePublicClassConstantRector.php Co-authored-by: Tomas Votruba <tomas.vot@gmail.com> Co-authored-by: Alexandre Bertrand <trandbert37@users.noreply.github.com> Co-authored-by: Tomas Votruba <tomas.vot@gmail.com>
- Loading branch information
1 parent
a734965
commit 79dd9bb
Showing
2 changed files
with
59 additions
and
4 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
...p81/Rector/ClassConst/FinalizePublicClassConstantRector/Fixture/class_inheritance.php.inc
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php81\Rector\ClassConst\FinalizePublicClassConstantRector\Fixture; | ||
|
||
abstract class ParentClass | ||
{ | ||
public const TEST_CONSTANT = 'value1'; | ||
} | ||
|
||
class ChildClass extends ParentClass | ||
{ | ||
public const TEST_CONSTANT = 'value2'; | ||
} | ||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Php81\Rector\ClassConst\FinalizePublicClassConstantRector\Fixture; | ||
|
||
abstract class ParentClass | ||
{ | ||
public const TEST_CONSTANT = 'value1'; | ||
} | ||
|
||
class ChildClass extends ParentClass | ||
{ | ||
public final const TEST_CONSTANT = 'value2'; | ||
} | ||
?> |
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