From 7c702e0b668036273309fc6cd78f970c452d1999 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Tue, 5 Apr 2022 09:48:28 +0100 Subject: [PATCH 1/2] Add @author to forbidden tag list Ref https://devdocs.magento.com/guides/v2.4/coding-standards/docblock-standard-general.html#documentation-space --- .../Commenting/ClassAndInterfacePHPDocFormattingSniff.php | 1 + .../Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc | 2 +- .../Commenting/ClassAndInterfacePHPDocFormattingUnitTest.2.inc | 2 +- .../Commenting/ClassAndInterfacePHPDocFormattingUnitTest.php | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Magento2/Sniffs/Commenting/ClassAndInterfacePHPDocFormattingSniff.php b/Magento2/Sniffs/Commenting/ClassAndInterfacePHPDocFormattingSniff.php index 2d715c50..20c12851 100644 --- a/Magento2/Sniffs/Commenting/ClassAndInterfacePHPDocFormattingSniff.php +++ b/Magento2/Sniffs/Commenting/ClassAndInterfacePHPDocFormattingSniff.php @@ -24,6 +24,7 @@ class ClassAndInterfacePHPDocFormattingSniff implements Sniff * @var string[] List of tags that can not be used in comments */ public $forbiddenTags = [ + '@author', '@category', '@package', '@subpackage' diff --git a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc index e5895e32..e2727967 100644 --- a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc +++ b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc @@ -60,7 +60,7 @@ class EmptyHandler * @api is ok here * @deprecated can be used in this context * @see is ok here - * @author is actually ok + * @author is not ment to be used * @category is irrelevant * @package is not ment to be used * @subpackage does not belong here diff --git a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.2.inc b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.2.inc index 96900de2..e45e15ff 100644 --- a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.2.inc +++ b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.2.inc @@ -60,7 +60,7 @@ interface EmptyHandler * @api is ok here * @deprecated can be used in this context * @see is ok here - * @author is actually ok + * @author is not ment to be used * @category is irrelevant * @package is not ment to be used * @subpackage does not belong here diff --git a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.php b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.php index 9b5b2f85..b6a1c206 100644 --- a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.php +++ b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.php @@ -29,6 +29,7 @@ public function getWarningList($testFile = '') 35 => 1, 44 => 1, 52 => 1, + 63 => 1, 64 => 1, 65 => 1, 66 => 1, From 1f76b15da9af73ee88b41ad2ddedaa0f5ab29a8a Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Wed, 6 Jul 2022 15:51:56 +0100 Subject: [PATCH 2/2] Correct spelling/grammar --- .../ClassAndInterfacePHPDocFormattingUnitTest.1.inc | 4 ++-- .../ClassAndInterfacePHPDocFormattingUnitTest.2.inc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc index e2727967..146cded2 100644 --- a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc +++ b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc @@ -60,9 +60,9 @@ class EmptyHandler * @api is ok here * @deprecated can be used in this context * @see is ok here - * @author is not ment to be used + * @author should not be used * @category is irrelevant - * @package is not ment to be used + * @package should not be used * @subpackage does not belong here */ class ExampleHandler diff --git a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.2.inc b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.2.inc index e45e15ff..b6decf6c 100644 --- a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.2.inc +++ b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.2.inc @@ -60,9 +60,9 @@ interface EmptyHandler * @api is ok here * @deprecated can be used in this context * @see is ok here - * @author is not ment to be used + * @author should not be used * @category is irrelevant - * @package is not ment to be used + * @package should not be used * @subpackage does not belong here */ interface ExampleHandler