When a method signature defines a return type, than that type must be the only one in the PHPDoc return annotation (if any of course)
For example:
/**
* @return Foo|null
*/
function A(): Foo
{
}
null must be removed by the fixer
IMO this should be covered by a more general fixer that removes useless PHPDocs. In your example, beside being wrong, the annotation does not add any information so it can be removed altogether.
yep, I would expect to drop whole annotation as well
Most helpful comment
IMO this should be covered by a more general fixer that removes useless PHPDocs. In your example, beside being wrong, the annotation does not add any information so it can be removed altogether.