Problem/Motivation
phpstan-drupal 2.4.0 reports both plugin managers as annotation-only (pluginManager.attributeDiscoveryMissing), so the phpstan job fails on 1.1.x, 1.2.x and 2.0.x. Annotation-only discovery is deprecated in Drupal 11.2 and removed in Drupal 12.
Steps to reproduce
- Run the phpstan CI job on any branch, for example the 1.2.4 tag pipeline.
- See the errors in
src/Style/StyleManager.phpline 31 andsrc/StylesGroup/StylesGroupManager.phpline 52.
Proposed resolution
- 2.0.x: add
StyleandStylesGroupattribute classes, used by the managers on Drupal 10.2 and newer. Older cores keep annotation-only discovery. - 1.2.x: the same attribute classes, the managers pass the attribute and the annotation, and the module's own plugins move to attributes. The annotation classes stay for plugins in other modules.
- 1.1.x (Drupal older than 10.3): add the two errors to the phpstan baseline, since the deprecation never applies there.
The attribute classes build on podarok's MR !88 in #3629649: Drupal 12 compatibility: add ^12 to core_version_requirement and fix removed/changed APIs, with group_id and icon added so plugins can use them. The ^12 change stays in #3629649: Drupal 12 compatibility: add ^12 to core_version_requirement and fix removed/changed APIs.
Remaining tasks
- ✅ File an issue
- ✅ Addition/Change/Update/Fix
- ✅ Testing to ensure no regression
- ➖ Automated unit/functional testing coverage
- ➖ Developer Documentation support
- ➖ User Guide Documentation support
- ➖ UX/UI designer responsibilities
- ➖ Accessibility and Readability
- ❌ Reviewed by a human
- ❌ Code review by maintainers
- ❌ Full testing and approval
- ❌ Credit contributors
- ❌ Review with the product owner
- ✅ Update Release Notes
- ✅ Release
User interface changes
- N/A
API changes
- New plugin attributes
Drupal\bootstrap_styles\Attribute\StyleandDrupal\bootstrap_styles\Attribute\StylesGroup. Annotation-based plugins keep working.
Data model changes
- N/A
Release notes snippet
- The Style and Styles group plugin managers support PHP attribute discovery.
Issue fork bootstrap_styles-3637458
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #5
rajab natshahComment #9
rajab natshah✅ Released in bootstrap_styles-1.2.5
✅ Released in bootstrap_styles-1.1.11