Skip to content

Commit b627255

Browse files
Use getMethodProperties
1 parent 8e77e7c commit b627255

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ public function process(File $phpcsFile, $stackPtr)
5353
$ignore = Tokens::$emptyTokens;
5454
$ignore[] = T_STATIC;
5555

56-
$scopeModifier = $phpcsFile->findPrevious($ignore, ($stackPtr - 1), null, true);
57-
if ($tokens[$scopeModifier]['code'] === T_PROTECTED
56+
$scopeModifier = $phpcsFile->getMethodProperties($stackPtr)['scope'];
57+
if ($scopeModifier === 'protected'
5858
&& $this->minimumVisibility === 'public'
59-
|| $tokens[$scopeModifier]['code'] === T_PRIVATE
59+
|| $scopeModifier === 'private'
6060
&& ($this->minimumVisibility === 'public' || $this->minimumVisibility === 'protected')
6161
) {
6262
return;

0 commit comments

Comments
 (0)