Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
PluginFormInterface contains documentation that is specific to \Drupal\Component\Plugin\PluginBase and that has nothing to do with the interface itself.
Comment | File | Size | Author |
---|---|---|---|
#7 | drupal_2252081_7.patch | 1.63 KB | Xano |
Comments
Comment #1
XanoComment #2
jhodgdonDo you think that documentation should be moved elsewhere, such as a base class method that people might actually be overriding? And... yeah it's an implementation-specific doc, but it's really just a suggestion for people who are implementing the method. It seems helpful... We should have it somewhere.
Comment #3
XanoFirst thought, and second: no. The reason we have interfaces is that we do not care about implementations at all. If someone works with PluginBase and they want to implement PluginFormInterface without knowing how PluginBase stores its confirmation, then that is not our problem. We cannot-and should not-add suggestions to our interface, because 1) we can keep doing that until the end of time and still not be done and 2) this has brought us more bad than good in the past, where we kept coding until only suggested usages were supported.
Comment #4
jhodgdonFine, then can we move this suggestion to the base class then, assuming it's a hint for module developers?
Comment #5
XanoWe could. Do you have a clear way of doing this in mind? There are a number of interfaces that deal with configuration (ConfigurablePluginInterface being another), and PluginBase already has an in-line code comment about $this->configuration. If you don't, no wories. I'll work something out and post a patch for review.
Comment #6
jhodgdonPeople aren't probably going to read in-line comments as likely as doc blocks. So probably this belongs on the PluginBase in a doc block somewhere... or else maybe we can just get rid of it. It just seemed like it was useful information that a plugin developer might need to have?
Comment #7
XanoWhat about this? PluginFormInterface is in Core, so we shouldn't really be referencing that from Component.
Comment #8
jhodgdonThat looks reasonable to me. I'll mark it RTBC and let it sit for a few days for others to review/object/offer suggestions. Thanks!
Comment #10
jhodgdonThanks again! Committed to 8.x.