Skip to content

Commit 698847b

Browse files
committed
Changelog + minor error message change for #2233
1 parent 67103d7 commit 698847b

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

package.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,14 @@ http://pear.php.net/dtd/package-2.0.xsd">
110110
-- Thanks to Chris Wilkinson for the patch
111111
- Generic.PHP.CharacterBeforePHPOpeningTag now ignores a BOM at the start of the file
112112
-- Thanks to Chris Wilkinson for the patch
113+
- Generic.Formatting.SpaceAfterNot now has a setting to specify how many spaces are required after a NOT operator
114+
-- Default remains 1
115+
-- Override the "spacing" setting in a ruleset.xml file to change
116+
-- Thanks to Juliette Reinders Folmer for the patch
117+
- Generic.Formatting.SpaceAfterNot now has a setting to ignore newline characters after the NOT operator
118+
-- Default remains FALSE, so newlines are not allowed
119+
-- Override the "ignoreNewlines" setting in a ruleset.xml file to change
120+
-- Thanks to Juliette Reinders Folmer for the patch
113121
- PEAR.Functions.FunctionDeclaration now checks spacing before the opening parenthesis of functions with no body
114122
-- Thanks to Chris Wilkinson for the patch
115123
- PEAR.Functions.FunctionDeclaration now enforces no space before the semicolon in functions with no body

src/Standards/Generic/Sniffs/Formatting/SpaceAfterNotSniff.php

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -82,20 +82,11 @@ public function process(File $phpcsFile, $stackPtr)
8282
return;
8383
}
8484

85-
$maybePlural = '';
86-
if ($this->spacing !== 1) {
87-
$maybePlural = 's';
88-
}
89-
9085
$nextNonWhitespace = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true);
9186
if ($nextNonEmpty !== $nextNonWhitespace) {
92-
$error = 'Expected %s space%s after NOT operator; comment found';
93-
$data = [
94-
$this->spacing,
95-
$maybePlural,
96-
];
87+
$error = 'Expected %s space(s) after NOT operator; comment found';
88+
$data = [$this->spacing];
9789
$phpcsFile->addError($error, $stackPtr, 'CommentFound', $data);
98-
9990
return;
10091
}
10192

@@ -110,14 +101,13 @@ public function process(File $phpcsFile, $stackPtr)
110101
return;
111102
}
112103

113-
$error = 'Expected %s space%s after NOT operator; %s found';
104+
$error = 'Expected %s space(s) after NOT operator; %s found';
114105
$data = [
115106
$this->spacing,
116-
$maybePlural,
117107
$found,
118108
];
119-
$fix = $phpcsFile->addFixableError($error, $stackPtr, 'Incorrect', $data);
120109

110+
$fix = $phpcsFile->addFixableError($error, $stackPtr, 'Incorrect', $data);
121111
if ($fix === true) {
122112
$padding = str_repeat(' ', $this->spacing);
123113
if ($found === 0) {

0 commit comments

Comments
 (0)