The GenderCache class is a service and calling the deprecated User::isValidUserName. The replacement is the UserNameUtils service.
But the UserNameUtils indirectly used the GenderCache and than a circular dependency is given and exception thrown.
The way is: UserNameUtils -> TitleParser -> _MediaWikiTitleCodec -> GenderCache -> UserNameUtils
From my understanding of the code, the GenderCache in class MediaWikiTitleCodec is only used for the TitleFormatter part (Used in getNamespaceName) and UserNameUtils needs only a TitleParser.
So MediaWikiTitleCodec needs a split or how to resolve this situation?
Creating own MediaWikiTitleCodec as TitleParser for the UserNameUtils without GenderCache because the function should not be called?