-
-
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.
fix: add failing test and fix for repeated numeric strings (#1591)
Signed-off-by: Gary Lockett <gary@creativecow.uk>
- Loading branch information
Gary Lockett
committed
Dec 30, 2021
1 parent
322e5b6
commit 068369e
Showing
2 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
...zation/Rector/Class_/RepeatedLiteralToClassConstantRector/Fixture/numeric_strings.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,35 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Privatization\Rector\Class_\RepeatedLiteralToClassConstantRector\Fixture; | ||
|
||
class NumericStrings | ||
{ | ||
public function run() | ||
{ | ||
$fieldA = '1000'; | ||
$fieldB = '1000'; | ||
$fieldC = '1000'; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Privatization\Rector\Class_\RepeatedLiteralToClassConstantRector\Fixture; | ||
|
||
class NumericStrings | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
private const CONST_1000 = '1000'; | ||
public function run() | ||
{ | ||
$fieldA = self::CONST_1000; | ||
$fieldB = self::CONST_1000; | ||
$fieldC = self::CONST_1000; | ||
} | ||
} | ||
|
||
?> |
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