Skip to content

@not-depracted is not taken into account #180

@mibocs

Description

@mibocs

I got the following error in my Drupal:

Call to deprecated method loadRevision() of interface Drupal\Core\Entity\RevisionableStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::loadRevision instead.

This should be solved in theory if i apply the following fix: https://www.drupal.org/project/drupal/issues/3571148 i.e. if i use

/** @not-deprecated */

then this error shouldn't be reported(this should work according to phpstan => https://phpstan.org/writing-php-code/phpdocs-basics#deprecations), but it is reported because this is not taken into account in phpstan-deprecation-rules.

My phpstan.neon config file is the following:

includes:

  • vendor/mglaman/phpstan-drupal/extension.neon
  • vendor/mglaman/phpstan-drupal/rules.neon
  • vendor/phpstan/phpstan-deprecation-rules/rules.neon
    parameters:
    level: '1'
    paths:
    • lib
      excludePaths:
    • vendor
    • lib/themes/dta_theme/node_modules/*
      ignoreErrors:
    • '#^Unsafe usage of new static#'
      drupal:
      drupal_root: '%currentWorkingDirectory%/web'
      parallel:
      processTimeout: 900.0

If i remove "vendor/phpstan/phpstan-deprecation-rules/rules.neon" line then this error is gone, so the issue is in the phpstan-deprecation-rules for sure.

Question is how could this be solved?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions