James Williams commented on merge request !12 at project / language_hierarchy

James Williams
2025-09-22T15:32:20Z

Ah no, that's potentially just a typehinting issue? The Language Hierarchy module depends on core's language module being enabled, which overrides the language_manager service to use the Drupal\language\ConfigurableLanguageManager class, which will return languages that implement Drupal\language\ConfigurableLanguageInterface - which does have getThirdPartySetting(). And if any don't, then they would fail to be loaded using ConfigurableLanguage::load() anyway.

I don't mind correct typehinting comments if they would help your IDE, e.g. /** @var Drupal\language\ConfigurableLanguageInterface $language */ ?

If there's really a scenario where any of the languages do not implement ConfigurableLanguageInterface, an extra instanceof check could be added?