Skip to content
Snippets Groups Projects

Add phpstan deprecation rules

Closed Tim Mallezie requested to merge issue/drupal-3263109:3263109-use-phpstan-for into 10.0.x
8 unresolved threads

Closes #3263109

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
112 112 // Clear the annotation loaders of any previous annotation classes.
113 113 AnnotationRegistry::reset();
114 114 // Register the namespaces of classes that can be used for annotations.
115 // @phpstan-ignore-next-line
115 116 AnnotationRegistry::registerLoader('class_exists');
  • 625 728 count: 1
    626 729 path: modules/system/tests/modules/advisory_feed_test/src/AdvisoriesTestHttpClient.php
    627 730
    731 -
    732 message: """
    733 #^Call to deprecated function deprecation_test_function\\(\\)\\:
    734 in drupal\\:8\\.4\\.0 and is removed from drupal\\:9\\.0\\.0\\. This is
    735 the deprecation message for deprecated_test_function\\(\\)\\.$#
    736 """
    737 count: 1
    738 path: modules/system/tests/modules/deprecation_test/src/DeprecatedController.php
  • 1795 -
    1796 message: """
    1797 #^Call to deprecated method getConfig\\(\\) of class GuzzleHttp\\\\ClientInterface\\:
    1798 ClientInterface\\:\\:getConfig will be removed in guzzlehttp/guzzle\\:8\\.0\\.$#
    1799 """
    1800 count: 1
    1801 path: tests/Drupal/Tests/DrupalTestBrowser.php
    1802
    1803 -
    1804 message: """
    1805 #^Usage of deprecated trait Drupal\\\\Tests\\\\Traits\\\\ExpectDeprecationTrait in class Drupal\\\\Tests\\\\ExpectDeprecationTest\\:
    1806 in drupal\\:9\\.1\\.0 and is removed from drupal\\:10\\.0\\.0\\. Use
    1807 \\\\Symfony\\\\Bridge\\\\PhpUnit\\\\ExpectDeprecationTrait instead\\.$#
    1808 """
    1809 count: 1
    1810 path: tests/Drupal/Tests/ExpectDeprecationTest.php
  • 915 1612 count: 1
    916 1613 path: tests/Drupal/KernelTests/Core/Test/BrowserTestBaseTest.php
    917 1614
    1615 -
    1616 message: """
    1617 #^Call to deprecated function deprecation_test_function\\(\\)\\:
    1618 in drupal\\:8\\.4\\.0 and is removed from drupal\\:9\\.0\\.0\\. This is
    1619 the deprecation message for deprecated_test_function\\(\\)\\.$#
    1620 """
    1621 count: 1
    1622 path: tests/Drupal/KernelTests/Core/Test/PhpUnitBridgeTest.php
  • mondrake added 9 commits

    added 9 commits

    Compare with previous version

  • mondrake added 1 commit

    added 1 commit

    Compare with previous version

  • mondrake added 1 commit

    added 1 commit

    Compare with previous version

  • mondrake added 1 commit

    added 1 commit

    • ff9a3c06 - Reverting changes to ConfigStorageStagingTest

    Compare with previous version

  • Tim Mallezie added 1 commit

    added 1 commit

    • 013aec3e - Add deprecation tags to legacy test methods.

    Compare with previous version

  • Tim Mallezie added 1 commit

    added 1 commit

    Compare with previous version

  • Tim Mallezie added 1 commit

    added 1 commit

    Compare with previous version

  • Tim Mallezie added 1 commit

    added 1 commit

    Compare with previous version

  • Tim Mallezie added 1 commit

    added 1 commit

    Compare with previous version

  • 145 145 protected function doWrite($name, $data) {
    146 146 // @todo Remove the 'return' option in Drupal 11.
    147 147 // @see https://www.drupal.org/project/drupal/issues/3256524
    148 // @phpstan-ignore-next-line
    • IMHO it would be better not to add the inline ignore here, but add the error to the baseline (1) - here and in all code of the MR that is in run-time code

    • The main reason i started with an ignore comment was that this will be here untill D11, and thus in the baseline till D11. (There is an @see with the D11 issue, so the fact this needs to be removed will not be forgotten). But i'm surely open to adjust.

    • Ah, I see, right. Makes sense - only if there's already a @todo for removal, then.

    • Please register or sign in to reply
  • 222 223 public function delete($name) {
    223 224 // @todo Remove the 'return' option in Drupal 11.
    224 225 // @see https://www.drupal.org/project/drupal/issues/3256524
    226 // @phpstan-ignore-next-line
  • 237 239 public function rename($name, $new_name) {
    238 240 // @todo Remove the 'return' option in Drupal 11.
    239 241 // @see https://www.drupal.org/project/drupal/issues/3256524
    242 // @phpstan-ignore-next-line
  • 18 18 /**
    19 19 * Tests file size upload errors.
    20 20 *
    21 * @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0.
    22 * Use \Drupal\file\Upload\FileUploadHandler::handleFileUpload() instead.
    23 *
    24 * @see https://www.drupal.org/node/3239547
    25 *
    • Comment on lines +21 to +25

      Well, the %extra_info% here makes sense on the deprecated runtime function (_file_save_upload_single() in this case). But in a deprecation test, it does not... You will not use \Drupal\file\Upload\FileUploadHandler::handleFileUpload() in place of testFileSaveUploadSingleErrorFormSize().

      That's why in an earlier version I was suggesting to use sth like This is a deprecation test.. It does not add anything to the info, agree, but it allows to pass the CS rule that requires %extra_info% to be present.

      Same in the other cases of the MR

    • Please register or sign in to reply
  • Tim Mallezie added 1 commit

    added 1 commit

    • 8b055a1e - Remove newline, add phpstan inline comment to deprecation tests.

    Compare with previous version

  • Tim Mallezie added 1 commit

    added 1 commit

    • 1b595b25 - Put ignore comment in class comment docblock.

    Compare with previous version

  • closed

  • Please register or sign in to reply
    Loading