Problem/Motivation
#3383279: Bump mglaman/phpstan-drupal to latest to make daily "updated deps" QA run pass again introduced (a lot of) deprecation warnings like:
Call to deprecated method loadRevision() of class Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::loadRevision instead.
Currently they are suppressed in core/phpstan-baseline.neon.
This issue is here to remove all of them from the baseline by type-hinting.
Steps to reproduce
Proposed resolution
Use type-hinting on the likes of \Drupal::entityTypeManager()->getStorage($entity_type_id) to clarify (to PHPStan) we intend to use the more specific RevisionableStorageInterface instead of EntityStorageInterface.
This issue should leave none of the above mentioned deprecation suppressions in the baseline.
In the process of doing so we also remove two of these suppressions:
Call to deprecated method deleteRevision () of class Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::deleteRevision instead.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Issue fork drupal-3383513
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:
- 3383513-ue-type-hinting-on
changes, plain diff MR !4650
Comments
Comment #2
spokjeComment #4
spokjeComment #5
spokjeComment #6
spokjeComment #7
spokjeComment #8
smustgrave commentedApplied the MR and searched for Call to deprecated method loadRevision\ in the baseline file and all instances were replaced. Tests are all green so believe this is good.
Comment #9
catchNeeds a re-roll for the phpstan baseline.
A couple of these I wondered if we should think about adding assertions/instanceof checks, but not for here.
Comment #10
spokjeComment #12
catchCommitted cc0c9fd and pushed to 11.x. Thanks!