diff --git a/Magento2/Helpers/Commenting/PHPDocFormattingValidator.php b/Magento2/Helpers/Commenting/PHPDocFormattingValidator.php index 9b462e36..fb98db7c 100644 --- a/Magento2/Helpers/Commenting/PHPDocFormattingValidator.php +++ b/Magento2/Helpers/Commenting/PHPDocFormattingValidator.php @@ -122,19 +122,15 @@ public function hasDeprecatedWellFormatted($commentStartPtr, $tokens) return true; } + $seeTagRequired = false; if ($tokens[$deprecatedPtr + 2]['code'] !== T_DOC_COMMENT_STRING) { - return false; + $seeTagRequired = true; } - $seePtr = $this->getTagPosition('@see', $commentStartPtr, $tokens); if ($seePtr === -1) { - return true; + return !$seeTagRequired; } - if ($tokens[$seePtr + 2]['code'] !== T_DOC_COMMENT_STRING) { - return false; - } - - return true; + return $tokens[$seePtr + 2]['code'] === T_DOC_COMMENT_STRING; } /** diff --git a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc index 14ba369a..e5895e32 100644 --- a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc +++ b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc @@ -153,3 +153,12 @@ class DoNotCareHandler { } + +/** + * @deprecated + * @see Magento\Framework\NewHandler + */ +class OldHandler +{ + +} diff --git a/Magento2/Tests/Commenting/ConstantsPHPDocFormattingUnitTest.1.inc b/Magento2/Tests/Commenting/ConstantsPHPDocFormattingUnitTest.1.inc index 05dfdb52..6e0b16f0 100644 --- a/Magento2/Tests/Commenting/ConstantsPHPDocFormattingUnitTest.1.inc +++ b/Magento2/Tests/Commenting/ConstantsPHPDocFormattingUnitTest.1.inc @@ -38,6 +38,12 @@ class Profiler */ const COMPUTER = 'Deep Thought'; + /** + * @deprecated + * @see \ComputationalMatrix\Mars + */ + const KEYBOARD = 'Ergonomic'; + /** * @see */