phpstan-drupal icon indicating copy to clipboard operation
phpstan-drupal copied to clipboard

Call to deprecated method loadRevision()/deleteRevision() of class Drupal\Core\Entity\EntityStorageInterface round 3

Open mxr576 opened this issue 2 years ago • 6 comments

Bug report

$ composer show mglaman/*
mglaman/phpstan-drupal 1.2.1 Drupal extension and rules for PHPStan
 $ composer show phpstan/*
phpstan/extension-installer       1.3.1   Composer plugin for automatic installation of PHPStan extensions
phpstan/phpdoc-parser             1.24.2  PHPDoc parser with support for nullable, intersection and generic types
phpstan/phpstan                   1.10.41 PHPStan - PHP Static Analysis Tool
phpstan/phpstan-deprecation-rules 1.1.4   PHPStan rules for detecting usage of deprecated classes, methods, properties, constants and traits.
phpstan/phpstan-phpunit           1.3.15  PHPUnit extensions and rules for PHPStan

Symthom is the same as in #549 or #586

  170    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.          

or

  170    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.      

Code snippet that reproduces the problem

The code calls a custom entity storage with the following definition

final class Foo extends SqlContentEntityStorage implements FooInterface {}

interface FooInterface extends ContentEntityStorageInterface {}

mxr576 avatar Nov 08 '23 13:11 mxr576

Oh no not again :(.

What version of Drupal core? There were fixes added to rearrange interfaces.

mglaman avatar Nov 08 '23 13:11 mglaman

10.1.5, I also tried to rearrange things in my local, but did not help,maybe I did not do it right.

mxr576 avatar Nov 08 '23 13:11 mxr576

Related commit and PR https://github.com/mglaman/phpstan-drupal/commit/73dab3110e68a55e022ae65e855091b47dc0b8a2

mglaman avatar Nov 08 '23 13:11 mglaman

Is this in the release of Drupal core? https://www.drupal.org/project/drupal/issues/3383215

mglaman avatar Nov 08 '23 13:11 mglaman

No it is not :( image

mxr576 avatar Nov 08 '23 14:11 mxr576

Looks like this is still happening even on 10.2.x-dev https://git.drupalcode.org/project/layout_builder_component_attributes/-/jobs/794515

mglaman avatar Feb 15 '24 22:02 mglaman