- Issue created by @ptmkenny
- Status changed to Postponed
11 months ago 4:22am 31 August 2024 - Status changed to Active
11 months ago 1:17pm 4 September 2024 - π―π΅Japan ptmkenny
After struggling with this, I think we're blocked on β¨ Fatal error: Declaration of Drupal\Component\Plugin\Attribute\AttributeBase::setClass(string $class): void must be compatible with Drupal\Component\Plugin\Definition\PluginDefinitionInterface::setClass($class) Active .
- π―π΅Japan ptmkenny
Comment from fathershawn on Slack:
Both classes are essentially data objects. As I see it, they are related but not embodied in the same class.
Your instance of AttributeInterface powers discovery of your plugin classes and manages the metadata needed to instantiate them.
DefaultPluginManager::getDiscovery instantiates AttributeClassDiscovery
DefaultPluginManager extends PluginManagerBase and PluginManagerBase::getDefinitions passes itβs work to the discovery class. AttributeClassDiscovery::getDefinitions ultimately calls AttributeInterface::get to get the data from the attribute which has a return type of mixed and AttributeBase refines that as array|object . Which means that in the ::get method of your attribute you can return an instance of PluginDefinitionInterface
See \Drupal\Core\Layout\Attribute\Layout for an example. - Merge request !50Add support for attributes with help from claude code β (Merged) created by ptmkenny
- Status changed to Postponed
22 days ago 2:46pm 14 July 2025 - Merge request !54Add support for attributes and remove support for annotations β (Closed) created by ptmkenny
- π―π΅Japan ptmkenny
ptmkenny β changed the visibility of the branch attributes to hidden.
- π―π΅Japan ptmkenny
ptmkenny β changed the visibility of the branch attributes_claude to hidden.
- π―π΅Japan ptmkenny
ptmkenny β changed the visibility of the branch attributes_refactor2 to hidden.
-
ptmkenny β
committed de24afc9 on 3.x
Issue #3471347 by ptmkenny: Add support for PHP attributes
-
ptmkenny β
committed de24afc9 on 3.x
Automatically closed - issue fixed for 2 weeks with no activity.