The expression return s($this->slugger-...y($string, $separator)) could return the type Symfony\Component\String\ByteString which is incompatible with the type-hinted return Symfony\Component\String\AbstractUnicodeString. Consider adding an additional type-check to rule them out.