- Issue created by @murz
- πΊπΈUnited States nicxvan
That's a lot of constants, many ides should already have auto completion.
Maybe there is another way to do this?
- π¦π²Armenia murz Yerevan, Armenia
many ides should already have auto completion.
Hmm, interesting, where then do IDEs get the information about those hook names to autocomplete? Just gathered them somehow and hardcoded them in the IDE plugin configuration? Okay, we can parse the Drupal Core code to gather all the hook names, but not additional hooks from contrib modules...
- πΊπΈUnited States nicxvan
From the *.api.php files, if contrib has documented them then it should work there too.
- πΊπΈUnited States moshe weitzman Boston, MA
Totally agree with this. I am not worried about a couple hundred constant definitions in a large codebase. *.api.php files are a Drupalism that should be on its way out IMO.
- π¬π§United Kingdom catch
Maybe this would be OK inside attributes, but we had serious problems with event constants in the past with modules being installed/uninstalled and should not repeat that π Event class constants for event names can cause fatal errors when a module is installed Active .
- πΊπΈUnited States moshe weitzman Boston, MA
Ugh. When an Attribute is read (via reflection), it throws a fatal when the constant is undefined This is why we cant have nice things.
- πΊπΈUnited States nicxvan
Yeah, we ran into that same issue with the order parameter.
If we get rid of the *.api.php files where would we document the hooks?
- πΊπΈUnited States moshe weitzman Boston, MA
Answering the question with a question: Where do we document events that modules can subscribe to? Service tags that modules can implement? Plugins that modules can implement?