Problem/Motivation
The return variable of function _responsive_image_build_source_attributes in responsive_image.module doesn't have the correct return type.
Steps to reproduce
1. Call the _responsive_image_build_source_attributes()
2. Try to get the offset of an attribute.
3. Analyse with PHPStan.
Cannot call method offsetGet() on array<Drupal\Core\Template\Attribute>
Return type in PHPDoc does not match the actual return type \Drupal\Core\Template\Attribute
Proposed resolution
Update _responsive_image_build_source_attributes PHPDoc to * @return \Drupal\Core\Template\Attribute .
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3312883-1.patch | 856 bytes | smavri |
| #2 | 3312883.patch | 736 bytes | smavri |
Issue fork drupal-3312883
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 #2
smavri commentedComment #3
smavri commentedChange the description of the return type.
Comment #4
cilefen commentedComment #7
smustgrave commentedCan the MR be updated for 9.5 please. Will need a separate one for 10.1 also.
Comment #11
rpayanmI created the MR for 9.5.x and 10.1.x, please review.
Comment #12
smustgrave commentedThanks!
Comment #18
lauriiiCommitted 5bfa2ee and pushed to 10.1.x. Cherry-picked to 10.0.x and 9.5.x as a docs improvement. Thanks!