It seems like $reader can also be of type Spiral\Attributes\ReaderInterface; however, parameter $reader of Spiral\Attributes\AnnotationReader::__construct() does only seem to accept Doctrine\Common\Annotations\Reader|null, maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-type annotation
19
$reader instanceof DoctrineReader => new AnnotationReader(/** @scrutinizer ignore-type */ $reader),