Bug Report
| Subject |
Details |
| Rector version |
2.0.16 |
RemoveUnusedPrivateClassConstantRector rule has false positives
Minimal PHP Code Causing Issue
<?php declare(strict_types=1);
final readonly class Test
{
private const string SOME_CONST = '1';
public function hello(): string
{
return $this::SOME_CONST;
}
}
becomes
final readonly class Test
{
- private const string SOME_CONST = '1';
-
public function hello(): string
{
return $this::SOME_CONST;
Applied rules:
- RemoveUnusedPrivateClassConstantRector
Expected Behaviour
Should be skipped by this rule
Bug Report
RemoveUnusedPrivateClassConstantRectorrule has false positivesMinimal PHP Code Causing Issue
becomes
final readonly class Test { - private const string SOME_CONST = '1'; - public function hello(): string { return $this::SOME_CONST;Applied rules:
Expected Behaviour
Should be skipped by this rule