Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DeadCode] RemoveDeadZeroAndOneOperationRector should not remove Cons…
…tants (#4910)
- Loading branch information
1 parent
95e1147
commit 3ffd995
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
...s/DeadCode/Rector/Plus/RemoveDeadZeroAndOneOperationRector/Fixture/skip_constants.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,37 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\DeadCode\Rector\Plus\RemoveDeadZeroAndOneOperationRector\Fixture; | ||
|
||
class SkipConstants | ||
{ | ||
public const ONE = 1; | ||
|
||
public function run() | ||
{ | ||
$value = 5 * self::ONE; | ||
$value = 5 / self::ONE; | ||
$value = self::ONE * 5; | ||
$value = self::ONE / 5; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\DeadCode\Rector\Plus\RemoveDeadZeroAndOneOperationRector\Fixture; | ||
|
||
class SkipConstants | ||
{ | ||
public const ONE = 1; | ||
|
||
public function run() | ||
{ | ||
$value = 5 * self::ONE; | ||
$value = 5 / self::ONE; | ||
$value = self::ONE * 5; | ||
$value = self::ONE / 5; | ||
} | ||
} | ||
|
||
?> |
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