drupal-code-generator
drupal-code-generator copied to clipboard
Add a command to generate plugin deriver
Please add a command to generate plugin derivative extending DeriverBase class.
Currently there is no command to generate plugin derivative.
Hence we need to code same boilerplate code again and again. Please Create a generator class to generate plugin derivative.
I presume If you want to extend DeriverBase then you want to generate a deriver and not a derivative. Especially because while I added support for plugin classes to define themselves as derivatives, it doesn't need generator support as those are just plugin classes with a special id. So I took the liberty to retitle the issue.
I guess it's worth doing it if we allow injecting dependencies, looking at ContainerDerivativeDiscoveryDecorator there's a special ContainerDeriverInterface to support that.
We could start it as a copy of the controller which has very similar semantics.
@chx Thanks for looking into it. What I meant was to have a command to generate something similar to this
Yes, indeed that's a deriver. I note the inconsistent naming in core, if you look at deriver classes you will find 34 which are called deriver and 47 which is called a derivative. Meanwhile the base class is DeriverBase and the interface is DeriverInterface so they are all derivers. What a mess.