- Issue created by @ptmkenny
I'm trying to update the JSON-RPC module to support attributes in addition to annotations.
JSON-RPC annotations extend a custom MethodInterface, which extends core's PluginDefinitionInterface.
This doesn't work with attributes because core's AttributeBase setClass returns void
, while PluginDefinitionInterface setClass does not have an explicit return type.
Attempting to use a JsonRpcMethod Attribute that extends MethodInterface results in this fatal error:
Fatal error: Declaration of Drupal\Component\Plugin\Attribute\AttributeBase::setClass(string $class): void must be compatible with Drupal\Component\Plugin\Definition\PluginDefinitionInterface::setClass($class) in
I humbly request that core provide a way to have Attributes implement an interface that extends PluginDefinitionInterface.
Active
11.0 🔥
plugin system