Problem/Motivation

Follow up for https://www.drupal.org/project/drupal/issues/3447950
Blocked by https://github.com/mglaman/phpstan-drupal/issues/772

In https://www.drupal.org/project/drupal/issues/3447950 -- most of the unspecific uses of phpstan-ignore-next-line were removed except those for errors coming from phpstan-drupal, since upstream hasn't added Error Identifiers yet.

We want to change these remaining phpstan-ignore-next-line as soon as upstream upgrades to Error Identifiers (https://phpstan.org/user-guide/ignoring-errors#ignoring-in-code-using-ph...).

Steps to reproduce

Grep for matches of phpstan-ignore-next-line in core:

$ grep --recursive --fixed-strings "phpstan-ignore-next-line" --after-context=1 .
./tests/Drupal/FunctionalTests/Core/Container/ServiceDeprecationTest.php:    // @phpstan-ignore-next-line
./tests/Drupal/FunctionalTests/Core/Container/ServiceDeprecationTest.php-    \Drupal::service('deprecation_test.service');
./tests/Drupal/FunctionalTests/Core/Container/ServiceDeprecationTest.php:    // @phpstan-ignore-next-line
./tests/Drupal/FunctionalTests/Core/Container/ServiceDeprecationTest.php-    \Drupal::service('deprecation_test.alias');
--
./tests/Drupal/Tests/Core/Render/RendererCallbackTest.php:        // @phpstan-ignore-next-line
./tests/Drupal/Tests/Core/Render/RendererCallbackTest.php-        ['#pre_render' => ['\Drupal\Tests\Core\Render\callback'], '#type' => 'container'],
--
./tests/Drupal/Tests/Core/Render/RendererCallbackTest.php:        // @phpstan-ignore-next-line
./tests/Drupal/Tests/Core/Render/RendererCallbackTest.php-        ['#post_render' => ['\Drupal\Tests\Core\Render\RendererCallbackTest::renderCallback'], '#type' => 'container'],
--
./tests/Drupal/Tests/Core/Render/RendererCallbackTest.php:        // @phpstan-ignore-next-line
./tests/Drupal/Tests/Core/Render/RendererCallbackTest.php-        ['#access_callback' => [new static('test'), 'renderCallback'], '#type' => 'container'],
--
./tests/Drupal/Tests/Core/Render/RendererCallbackTest.php:        // @phpstan-ignore-next-line
./tests/Drupal/Tests/Core/Render/RendererCallbackTest.php-        ['#lazy_builder' => ['\Drupal\Tests\Core\Render\callback', []]],
--
./tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php:    // @phpstan-ignore-next-line
./tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php-    $this->storage->getQuery()->execute();
--
./modules/navigation/src/Plugin/Block/NavigationShortcutsBlock.php:        // @phpstan-ignore-next-line
./modules/navigation/src/Plugin/Block/NavigationShortcutsBlock.php-        '#lazy_builder' => ['navigation.shortcut_lazy_builder:lazyLinks', [$this->configuration['label']]],
--
./modules/big_pipe/tests/modules/big_pipe_test/src/BigPipePlaceholderTestCases.php:          // @phpstan-ignore-next-line
./modules/big_pipe/tests/modules/big_pipe_test/src/BigPipePlaceholderTestCases.php-          'hello_or_hi',
--
./modules/big_pipe/tests/modules/big_pipe_test/src/BigPipePlaceholderTestCases.php:        // @phpstan-ignore-next-line
./modules/big_pipe/tests/modules/big_pipe_test/src/BigPipePlaceholderTestCases.php-        '#pre_render' => ['current_time'],

Proposed resolution

Wait for https://github.com/mglaman/phpstan-drupal/issues/772 to be fixed upstream. Apply new Error Identifiers

Remaining tasks

  • Use the new Error Identifiers as soon as phpstan-drupal is updated
  • Bump phpstan-drupal dependency

User interface changes

NA

API changes

NA

Data model changes

NA

Release notes snippet

NA

Comments

diegoe created an issue. See original summary.

quietone’s picture

Version: 11.0.x-dev » 11.x-dev

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.