diff --git a/Magento2/Helpers/Commenting/PHPDocFormattingValidator.php b/Magento2/Helpers/Commenting/PHPDocFormattingValidator.php index 9fd42e7f..a87312d5 100644 --- a/Magento2/Helpers/Commenting/PHPDocFormattingValidator.php +++ b/Magento2/Helpers/Commenting/PHPDocFormattingValidator.php @@ -123,6 +123,12 @@ public function hasDeprecatedWellFormatted($commentStartPtr, $tokens) } $seePtr = $this->getTagPosition('@see', $commentStartPtr, $tokens); if ($seePtr === -1) { + if (preg_match( + "/This [a-zA-Z]* will be removed in version \d.\d.\d without replacement/", + $tokens[$deprecatedPtr + 2]['content'] + )) { + return true; + } return false; } diff --git a/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.inc b/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.inc index 4d3e0b7b..2e0fdf0e 100644 --- a/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.inc +++ b/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.inc @@ -369,4 +369,24 @@ class MethodAnnotationFixture { return true; } + + /** + * This deprecated function is correct even though it only contains the @deprecated tag. + * + * @deprecated This method will be removed in version 1.0.0 without replacement + */ + public function correctBecauseOfKeywordPhrase() + { + return false; + } + + /** + * This deprecated function is correct even though it only contains the @deprecated tag. + * + * @deprecated WOW! This method will be removed in version 1.0.0 without replacement + */ + public function alsoCorrectBecauseOfKeywordPhrase() + { + return false; + } } diff --git a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc index e5895e32..afd4c934 100644 --- a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc +++ b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc @@ -162,3 +162,20 @@ class OldHandler { } + +/** + * @deprecated This class will be removed in version 1.0.0 without replacement + */ +class DeprecatedButHandler +{ + +} + +/** + * @deprecated It's also deprecated - This class will be removed in version 1.0.0 without replacement + */ +class AlsoDeprecatedButHandler +{ + +} + diff --git a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.2.inc b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.2.inc index 96900de2..c1c456ed 100644 --- a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.2.inc +++ b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.2.inc @@ -153,3 +153,19 @@ interface DoNotCareHandler { } + +/** + * @deprecated This interface will be removed in version 1.0.0 without replacement + */ +interface DeprecatedButHandler +{ + +} + +/** + * @deprecated Yeah! This interface will be removed in version 1.0.0 without replacement + */ +interface AlsoDeprecatedButHandler +{ + +} diff --git a/Magento2/Tests/Commenting/ClassPropertyPHPDocFormattingUnitTest.inc b/Magento2/Tests/Commenting/ClassPropertyPHPDocFormattingUnitTest.inc index 62e9688f..cde71269 100644 --- a/Magento2/Tests/Commenting/ClassPropertyPHPDocFormattingUnitTest.inc +++ b/Magento2/Tests/Commenting/ClassPropertyPHPDocFormattingUnitTest.inc @@ -194,4 +194,10 @@ class correctlyFormattedClassMemberDocBlock * @see Message with some reference */ protected string $itIsCorrect; + + /** + * @var string + * @deprecated This property will be removed in version 1.0.0 without replacement + */ + protected string $deprecatedWithKeyword; } diff --git a/Magento2/Tests/Commenting/ConstantsPHPDocFormattingUnitTest.2.inc b/Magento2/Tests/Commenting/ConstantsPHPDocFormattingUnitTest.2.inc index 12b89834..a751d8aa 100644 --- a/Magento2/Tests/Commenting/ConstantsPHPDocFormattingUnitTest.2.inc +++ b/Magento2/Tests/Commenting/ConstantsPHPDocFormattingUnitTest.2.inc @@ -63,4 +63,14 @@ class Profiler * @see */ const d = 100; + + /** + * @deprecated This constant will be removed in version 1.0.0 without replacement + */ + const KEYWORD_PHRASE = false; + + /** + * @deprecated It's awesome - This constant will be removed in version 1.0.0 without replacement + */ + const WITH_KEYWORD_PHRASE = false; }