forked from PHPCSStandards/PHP_CodeSniffer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generic/IncrementDecrementSpacing: fix post-decrement error message
This commit fixes the post-decrement error message when there is one or more newlines between the variable and the post-decrement operator. The wrong variable was being used to check whether the post-decrement and the variable were not on the same line, resulting in an incorrect error message. The error message should explicitly say that a newline was found. Before this commit the error message was: ``` Expected no spaces between $i and the decrement operator; 0 found ``` Now it is: ``` Expected no spaces between the decrement operator and $i; newline found ``` (`newline` instead of `0`) This commit also includes a test that exercises the modified line.
- Loading branch information
1 parent
b03d10f
commit a30addb
Showing
4 changed files
with
7 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,3 +35,6 @@ $obj->prop['key'] ++; | |
|
||
--ClassName::$prop; | ||
-- ClassName::$prop; | ||
|
||
getObject()->count | ||
++; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,3 +34,5 @@ $obj->prop['key']++; | |
|
||
--ClassName::$prop; | ||
--ClassName::$prop; | ||
|
||
getObject()->count++; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters