The expression return $this->headers->f...eader::X_FRAME_OPTIONS) could return the type nicoSWD\SecHeaderCheck\D...lt\AbstractParsedHeader which includes types incompatible with the type-hinted return nicoSWD\SecHeaderCheck\D...ptionsHeaderResult|null. Consider adding an additional type-check to rule them out.