-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PEAR/FunctionCallSignature: bug fix - fixer created parse errors
The fixer for the `OpeningIndent` error for multi-line function calls could inadvertently remove a PHP close tag (or other inline HTML content) on the previous line if the first non-whitespace token on a line was `T_INLINE_HTML`. In the case of a PHP close tag, this would cause a parse error in the file. This parse error would then result in the file being incorrectly tokenized for the second fixer loop, with the `<?php` after the inline HTML being tokenized as below, which causes problems with other sniffs: ``` 13 | L1 | C 43 | CC 1 | ( 0) | T_WHITESPACE | [ 3]: ⸱⸱⸱ 14 | L1 | C 46 | CC 1 | ( 0) | T_LESS_THAN | [ 1]: < 15 | L1 | C 47 | CC 1 | ( 0) | T_INLINE_THEN | [ 1]: ? 16 | L1 | C 48 | CC 1 | ( 0) | T_STRING | [ 3]: php ``` Fixed now. Includes unit test. Includes minor defensive coding fix (`$first !== false`) on line 345 and adding of an inline comment to clarify the code within the fixer.
- Loading branch information
Showing
4 changed files
with
24 additions
and
3 deletions.
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
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