Skip to content

Commit 20aa783

Browse files
committed
Squiz.Scope.MethodScope.Missing error message now mentions 'visibility' instead of 'scope modifier'
1 parent f98b181 commit 20aa783

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CodeSniffer/Standards/Squiz/Sniffs/Scope/MethodScopeSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ protected function processTokenWithinScope(PHP_CodeSniffer_File $phpcsFile, $sta
6464

6565
$modifier = $phpcsFile->findPrevious(PHP_CodeSniffer_Tokens::$scopeModifiers, $stackPtr);
6666
if (($modifier === false) || ($tokens[$modifier]['line'] !== $tokens[$stackPtr]['line'])) {
67-
$error = 'No scope modifier specified for function "%s"';
67+
$error = 'Visibility must be declared on method "%s"';
6868
$data = array($methodName);
6969
$phpcsFile->addError($error, $stackPtr, 'Missing', $data);
7070
}

package.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
5555
- Squiz ClassFileNameSniff no longer throws errors when checking STDIN
5656
- Squiz CSS sniffs no longer generate errors for IE filters
5757
- Squiz LogicalOperatorSpacingSniff now ignores whitespace at the end of a line
58+
- Squiz.Scope.MethodScope.Missing error message now mentions 'visibility' instead of 'scope modifier'
59+
-- Thanks to Renat Akhmedyanov for the patch
5860
- The PSR2 standard no longer throws errors for additional spacing after a type hint
5961
- Fixed bug #20026 : Check for multi-line arrays that should be single-line is slightly wrong
6062
-- Adds new error message for single-line arrays that end with a comma

0 commit comments

Comments
 (0)