Fix @param docs for $deriver on plugin attribute classes

Created on 6 March 2024, 3 months ago
Updated 21 March 2024, 3 months ago

Problem/Motivation

The doc for \Drupal\Component\Plugin\Attribute\Plugin::__construct type hints the $deriver param as class-string|null. Many child classes are using the looser string|null typehint for this property. At phpstan level 4 we get the following error:

PHPDoc type string of property Bar::$class is not covariant with PHPDoc type class-string of overridden property Foo::$class.

Steps to reproduce

PHPStan playground example

Proposed resolution

Use class-string|null instead of string|null

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Fixed

Version

10.3 ✨

Component
PluginΒ  β†’

Last updated about 15 hours ago

Created by

πŸ‡¦πŸ‡ΊAustralia mstrelan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024