From 821cc64ae63f4066af1d3b4f2be053358adc6291 Mon Sep 17 00:00:00 2001 From: catch Date: Wed, 29 Mar 2023 17:24:18 +0100 Subject: [PATCH] Issue #3351067 by Spokje: Fix PHPStan L1 errors "Class already @covers \Foo\Bar so the method @covers is redundant." --- .../tests/src/Kernel/ValidatorsTest.php | 8 ---- .../src/Kernel/WildcardHtmlSupportTest.php | 1 - .../MediaEmbedFilterConfigurationUiTest.php | 2 - core/phpstan-baseline.neon | 39 +------------------ 4 files changed, 2 insertions(+), 48 deletions(-) diff --git a/core/modules/ckeditor5/tests/src/Kernel/ValidatorsTest.php b/core/modules/ckeditor5/tests/src/Kernel/ValidatorsTest.php index 9fd60cb0d5d..e1724fe9db2 100644 --- a/core/modules/ckeditor5/tests/src/Kernel/ValidatorsTest.php +++ b/core/modules/ckeditor5/tests/src/Kernel/ValidatorsTest.php @@ -60,9 +60,6 @@ class ValidatorsTest extends KernelTestBase { } /** - * @covers \Drupal\ckeditor5\Plugin\Validation\Constraint\ToolbarItemConstraintValidator - * @covers \Drupal\ckeditor5\Plugin\Validation\Constraint\ToolbarItemDependencyConstraintValidator - * @covers \Drupal\ckeditor5\Plugin\Validation\Constraint\EnabledConfigurablePluginsConstraintValidator * @covers \Drupal\ckeditor5\Plugin\Validation\Constraint\CKEditor5ElementConstraintValidator * @covers \Drupal\ckeditor5\Plugin\Validation\Constraint\StyleSensibleElementConstraintValidator * @covers \Drupal\ckeditor5\Plugin\Validation\Constraint\UniqueLabelInListConstraintValidator @@ -549,11 +546,6 @@ class ValidatorsTest extends KernelTestBase { } /** - * @covers \Drupal\ckeditor5\Plugin\Editor\CKEditor5::validatePair() - * @covers \Drupal\ckeditor5\Plugin\Validation\Constraint\FundamentalCompatibilityConstraintValidator - * @covers \Drupal\ckeditor5\Plugin\Validation\Constraint\ToolbarItemConstraintValidator - * @covers \Drupal\ckeditor5\Plugin\Validation\Constraint\ToolbarItemDependencyConstraintValidator - * @covers \Drupal\ckeditor5\Plugin\Validation\Constraint\EnabledConfigurablePluginsConstraintValidator * @covers \Drupal\ckeditor5\Plugin\Validation\Constraint\SourceEditingPreventSelfXssConstraintValidator * @dataProvider providerPair * diff --git a/core/modules/ckeditor5/tests/src/Kernel/WildcardHtmlSupportTest.php b/core/modules/ckeditor5/tests/src/Kernel/WildcardHtmlSupportTest.php index 1e9b93f8beb..3888a6d8c6c 100644 --- a/core/modules/ckeditor5/tests/src/Kernel/WildcardHtmlSupportTest.php +++ b/core/modules/ckeditor5/tests/src/Kernel/WildcardHtmlSupportTest.php @@ -41,7 +41,6 @@ class WildcardHtmlSupportTest extends KernelTestBase { /** * @covers \Drupal\ckeditor5\Plugin\CKEditor5Plugin\SourceEditing::getDynamicPluginConfig() - * @covers \Drupal\ckeditor5\Plugin\CKEditor5PluginManager::getCKEditor5PluginConfig() * @dataProvider providerGhsConfiguration */ public function testGhsConfiguration(string $filter_html_allowed, array $source_editing_tags, array $expected_ghs_configuration, ?array $additional_toolbar_items = []): void { diff --git a/core/modules/media/tests/src/FunctionalJavascript/MediaEmbedFilterConfigurationUiTest.php b/core/modules/media/tests/src/FunctionalJavascript/MediaEmbedFilterConfigurationUiTest.php index dd18f7f7094..be010617540 100644 --- a/core/modules/media/tests/src/FunctionalJavascript/MediaEmbedFilterConfigurationUiTest.php +++ b/core/modules/media/tests/src/FunctionalJavascript/MediaEmbedFilterConfigurationUiTest.php @@ -52,7 +52,6 @@ class MediaEmbedFilterConfigurationUiTest extends MediaJavascriptTestBase { /** * @covers ::media_form_filter_format_add_form_alter - * @covers ::media_filter_format_edit_form_validate * @dataProvider providerTestValidations */ public function testValidationWhenAdding($filter_html_status, $filter_align_status, $filter_caption_status, $filter_html_image_secure_status, $media_embed, $allowed_html, $expected_error_message) { @@ -100,7 +99,6 @@ class MediaEmbedFilterConfigurationUiTest extends MediaJavascriptTestBase { /** * @covers ::media_form_filter_format_edit_form_alter - * @covers ::media_filter_format_edit_form_validate * @dataProvider providerTestValidations */ public function testValidationWhenEditing($filter_html_status, $filter_align_status, $filter_caption_status, $filter_html_image_secure_status, $media_embed, $allowed_html, $expected_error_message) { diff --git a/core/phpstan-baseline.neon b/core/phpstan-baseline.neon index 631c26b6cc6..fb1469b3d30 100644 --- a/core/phpstan-baseline.neon +++ b/core/phpstan-baseline.neon @@ -962,7 +962,7 @@ parameters: - message: "#^@covers value \\\\Drupal\\\\ckeditor5\\\\Plugin\\\\Editor\\\\CKEditor5\\:\\:validatePair\\(\\) references an invalid method\\.$#" - count: 2 + count: 1 path: modules/ckeditor5/tests/src/Kernel/ValidatorsTest.php - @@ -970,34 +970,9 @@ parameters: count: 1 path: modules/ckeditor5/tests/src/Kernel/ValidatorsTest.php - - - message: "#^Class already @covers \\\\Drupal\\\\ckeditor5\\\\Plugin\\\\Editor\\\\CKEditor5\\:\\:validatePair\\(\\) so the method @covers is redundant\\.$#" - count: 1 - path: modules/ckeditor5/tests/src/Kernel/ValidatorsTest.php - - - - message: "#^Class already @covers \\\\Drupal\\\\ckeditor5\\\\Plugin\\\\Validation\\\\Constraint\\\\EnabledConfigurablePluginsConstraintValidator so the method @covers is redundant\\.$#" - count: 2 - path: modules/ckeditor5/tests/src/Kernel/ValidatorsTest.php - - - - message: "#^Class already @covers \\\\Drupal\\\\ckeditor5\\\\Plugin\\\\Validation\\\\Constraint\\\\FundamentalCompatibilityConstraintValidator so the method @covers is redundant\\.$#" - count: 1 - path: modules/ckeditor5/tests/src/Kernel/ValidatorsTest.php - - - - message: "#^Class already @covers \\\\Drupal\\\\ckeditor5\\\\Plugin\\\\Validation\\\\Constraint\\\\ToolbarItemConstraintValidator so the method @covers is redundant\\.$#" - count: 2 - path: modules/ckeditor5/tests/src/Kernel/ValidatorsTest.php - - - - message: "#^Class already @covers \\\\Drupal\\\\ckeditor5\\\\Plugin\\\\Validation\\\\Constraint\\\\ToolbarItemDependencyConstraintValidator so the method @covers is redundant\\.$#" - count: 2 - path: modules/ckeditor5/tests/src/Kernel/ValidatorsTest.php - - message: "#^@covers value \\\\Drupal\\\\ckeditor5\\\\Plugin\\\\CKEditor5PluginManager\\:\\:getCKEditor5PluginConfig\\(\\) references an invalid method\\.$#" - count: 2 + count: 1 path: modules/ckeditor5/tests/src/Kernel/WildcardHtmlSupportTest.php - @@ -1005,11 +980,6 @@ parameters: count: 1 path: modules/ckeditor5/tests/src/Kernel/WildcardHtmlSupportTest.php - - - message: "#^Class already @covers \\\\Drupal\\\\ckeditor5\\\\Plugin\\\\CKEditor5PluginManager\\:\\:getCKEditor5PluginConfig\\(\\) so the method @covers is redundant\\.$#" - count: 1 - path: modules/ckeditor5/tests/src/Kernel/WildcardHtmlSupportTest.php - - message: "#^@covers value \\\\Drupal\\\\ckeditor5\\\\HTMLRestrictions\\:\\:allowsNothing\\(\\) references an invalid method\\.$#" count: 1 @@ -1945,11 +1915,6 @@ parameters: count: 1 path: modules/media/src/OEmbed/UrlResolver.php - - - message: "#^Class already @covers \\:\\:media_filter_format_edit_form_validate so the method @covers is redundant\\.$#" - count: 2 - path: modules/media/tests/src/FunctionalJavascript/MediaEmbedFilterConfigurationUiTest.php - - message: "#^Relying on entity queries to check access by default is deprecated in drupal\\:9\\.2\\.0 and an error will be thrown from drupal\\:10\\.0\\.0\\. Call \\\\Drupal\\\\Core\\\\Entity\\\\Query\\\\QueryInterface\\:\\:accessCheck\\(\\) with TRUE or FALSE to specify whether access should be checked\\.$#" count: 1