You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PSR2.Methods.FunctionCallSignature.SpaceBeforeCloseBracket forbids space before close bracket, but it should not be reported if last value in call is heredoc/nowdoc
Create a file called test.php with the code sample above...
Run phpcs test.php ...
See error message displayed
Expected 0 spaces before closing parenthesis; newline found (PSR2.Methods.FunctionCallSignature.SpaceBeforeCloseBracket)
Expected behavior
No error.
Interesting is that similar code without heredoc/nowdoc does not report problematic check, but instead reports PSR2.Methods.FunctionCallSignature.ContentAfterOpenBracket
functiontest(): void
{
foo('bar',
'baz',
);
}
Reporting fixable ContentAfterOpenBracket would also work (and should be probably fixed too), because in case ContentAfterOpenBracket is fixed, then SpaceBeforeCloseBracket is no longer reported
Versions:
OS: Windows 10
PHP: 8.1.9
PHPCS: 3.7.1
Standard: orisai/coding-standard-php (but mostly irrelevant for the issue)
The text was updated successfully, but these errors were encountered:
Describe the bug
PSR2.Methods.FunctionCallSignature.SpaceBeforeCloseBracket
forbids space before close bracket, but it should not be reported if last value in call is heredoc/nowdocCode sample
This is okay
This is reported by rule
Custom ruleset
To reproduce
Steps to reproduce the behavior:
test.php
with the code sample above...phpcs test.php ...
Expected behavior
No error.
Interesting is that similar code without heredoc/nowdoc does not report problematic check, but instead reports
PSR2.Methods.FunctionCallSignature.ContentAfterOpenBracket
Reporting fixable
ContentAfterOpenBracket
would also work (and should be probably fixed too), because in caseContentAfterOpenBracket
is fixed, thenSpaceBeforeCloseBracket
is no longer reportedVersions:
The text was updated successfully, but these errors were encountered: