Bug Report
| Subject |
Details |
| Rector version |
last dev-main |
| Installed as |
composer dependency |
Minimal PHP Code Causing Issue
See https://getrector.com/demo/e83ea115-35d4-4945-ba71-c5a66af05ce2
<?php declare(strict_types = 1);
class HelloWorld {
public function getValue(): int|false|null {
/** @var int|false|null */
return filter_input(INPUT_GET, 'value', FILTER_VALIDATE_INT);
}
}
Responsible rules
RemoveNonExistingVarAnnotationRector
Expected Behavior
The @var annotation should not be removed, it is used to annotate the value being returned.
This syntax is understood by PHPStan, Psalm and PhpStorm.