diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index d01fb00d..f2021d6b 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -128,6 +128,11 @@ jobs: run: | cd ~/drupal ./vendor/bin/phpstan analyze web/core/install.php --debug + - name: "Test legacy hook attribute stubs" + run: | + cp $GITHUB_WORKSPACE/tests/fixtures/integration/legacy-hook-attributes.php ~/drupal/legacy-hook-attributes.php + cd ~/drupal + ./vendor/bin/phpstan analyze legacy-hook-attributes.php --no-progress - name: "Test BrowserTestBase is autoloaded" run: | cd ~/drupal @@ -200,6 +205,11 @@ jobs: run: | cd ~/drupal ./vendor/bin/phpstan analyze web/core/install.php --debug + - name: "Test legacy hook attribute stubs" + run: | + cp $GITHUB_WORKSPACE/tests/fixtures/integration/legacy-hook-attributes.php ~/drupal/legacy-hook-attributes.php + cd ~/drupal + ./vendor/bin/phpstan analyze legacy-hook-attributes.php --no-progress - name: "Test no crash" run: | cd ~/drupal diff --git a/extension.neon b/extension.neon index 098118de..53f9518f 100644 --- a/extension.neon +++ b/extension.neon @@ -1,6 +1,16 @@ parameters: bootstrapFiles: - drupal-autoloader.php + ignoreErrors: + - + message: '#^Attribute class Drupal\\Core\\Hook\\Attribute\\LegacyHook does not exist\.$#' + reportUnmatched: false + - + message: '#^Attribute class Drupal\\Core\\Hook\\Attribute\\LegacyRequirementsHook does not exist\.$#' + reportUnmatched: false + - + message: '#^Attribute class Drupal\\Core\\Hook\\Attribute\\LegacyModuleImplementsAlter does not exist\.$#' + reportUnmatched: false excludePaths: - '*.api.php' - '*/tests/fixtures/*.php' diff --git a/tests/fixtures/integration/legacy-hook-attributes.php b/tests/fixtures/integration/legacy-hook-attributes.php new file mode 100644 index 00000000..5d08b521 --- /dev/null +++ b/tests/fixtures/integration/legacy-hook-attributes.php @@ -0,0 +1,28 @@ +