Skip to content

Commit

Permalink
Merge pull request #251 from magento-commerce/imported-fredden-magent…
Browse files Browse the repository at this point in the history
…o-coding-standard-437

[Imported] Ensure only the relevant docblock is read
  • Loading branch information
sidolov authored Sep 27, 2023
2 parents d1711ba + 18a4579 commit 78200c1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ public function process(File $phpcsFile, $stackPtr)
$tokens = $phpcsFile->getTokens();
$commentStartPtr = $phpcsFile->findPrevious(T_DOC_COMMENT_OPEN_TAG, ($stackPtr), 0);
$commentEndPtr = $phpcsFile->findPrevious(T_DOC_COMMENT_CLOSE_TAG, ($stackPtr), 0);
if (!$commentStartPtr) {
$prevSemicolon = $phpcsFile->findPrevious(T_SEMICOLON, $stackPtr, $commentEndPtr);
if (!$commentStartPtr || $prevSemicolon) {
$phpcsFile->addError('Comment block is missing', $stackPtr, 'MethodArguments');
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,4 +389,12 @@ class MethodAnnotationFixture
{
return false;
}

/** @var OutputInterface */
private $output;

private function thisMethodHasNoDocBlock(): bool
{
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ public function getErrorList()
185 => 1,
227 => 1,
235 => 1,
261 => 1,
268 => 2,
269 => 1,
277 => 1,
278 => 1,
288 => 1,
289 => 1,
298 => 1
298 => 1,
396 => 1,
];
}

Expand Down

0 comments on commit 78200c1

Please sign in to comment.