Bug Report
| Subject |
Details |
| Rector version |
last dev-main |
| Installed as |
composer dependency |
Minimal PHP Code Causing Issue
See https://getrector.org/demo/1fcc02fc-52f3-4ca2-bc4a-6117e00362b7
<?php
class SomeClass
{
public function run(ReflectionClass $reflectionClass)
{
if ($reflectionClass->getAttributes()) {
return true;
}
return false;
}
}
Responsible rules
DowngradeParameterTypeWideningRector
Expected Behavior
When applying set DowngradeLevelSetList::DOWN_TO_PHP_71, rule DowngradeReflectionGetAttributesRector should also be applied (in addition to DowngradeParameterTypeWideningRector), but it is not.
Check the same code but running the rule instead of the set, then that rule is applied:
https://getrector.org/demo/417e38a1-b75f-42e3-8998-b178bc5bf55f
Similarly, running DowngradeLevelSetList::DOWN_TO_PHP_71 twice, the second time on the output from the first run, then DowngradeReflectionGetAttributesRector is applied:
https://getrector.org/demo/d849d04d-e35c-448d-aa49-c23a7423ceef
This may be the same issue as here? #7452
Bug Report
Minimal PHP Code Causing Issue
See https://getrector.org/demo/1fcc02fc-52f3-4ca2-bc4a-6117e00362b7
Responsible rules
DowngradeParameterTypeWideningRectorExpected Behavior
When applying set
DowngradeLevelSetList::DOWN_TO_PHP_71, ruleDowngradeReflectionGetAttributesRectorshould also be applied (in addition toDowngradeParameterTypeWideningRector), but it is not.Check the same code but running the rule instead of the set, then that rule is applied:
https://getrector.org/demo/417e38a1-b75f-42e3-8998-b178bc5bf55f
Similarly, running
DowngradeLevelSetList::DOWN_TO_PHP_71twice, the second time on the output from the first run, thenDowngradeReflectionGetAttributesRectoris applied:https://getrector.org/demo/d849d04d-e35c-448d-aa49-c23a7423ceef
This may be the same issue as here? #7452