Skip to content

Commit

Permalink
magento#162 Modified @deprecated validator to consider it valid if co…
Browse files Browse the repository at this point in the history
…mment is absent but @see tag is set
  • Loading branch information
sinisa86 committed Apr 4, 2020
1 parent 919dcc1 commit 6a3f52f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Magento2/Helpers/Commenting/PHPDocFormattingValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,18 @@ 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;
if ($seeTagRequired) {
return false;
} else {
return true;
}
}
if ($tokens[$seePtr + 2]['code'] !== T_DOC_COMMENT_STRING) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,12 @@ class DoNotCareHandler
{

}

/**
* @deprecated
* @see Magento\Framework\NewHandler
*/
class OldHandler
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ class Profiler
*/
const COMPUTER = 'Deep Thought';

/**
* @deprecated
* @see \ComputationalMatrix\Mars
*/
const KEYBOARD = 'Ergonomic';

/**
* @see
*/
Expand Down

0 comments on commit 6a3f52f

Please sign in to comment.