Skip to content

Commit

Permalink
Use getMethodProperties
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Mar 9, 2020
1 parent 8e77e7c commit b627255
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ public function process(File $phpcsFile, $stackPtr)
$ignore = Tokens::$emptyTokens;
$ignore[] = T_STATIC;

$scopeModifier = $phpcsFile->findPrevious($ignore, ($stackPtr - 1), null, true);
if ($tokens[$scopeModifier]['code'] === T_PROTECTED
$scopeModifier = $phpcsFile->getMethodProperties($stackPtr)['scope'];
if ($scopeModifier === 'protected'
&& $this->minimumVisibility === 'public'
|| $tokens[$scopeModifier]['code'] === T_PRIVATE
|| $scopeModifier === 'private'
&& ($this->minimumVisibility === 'public' || $this->minimumVisibility === 'protected')
) {
return;
Expand Down

0 comments on commit b627255

Please sign in to comment.