-
Notifications
You must be signed in to change notification settings - Fork 149
[CLEANUP] Reformat the code with the PER-2 configuration #1391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Also switch a test string from heredoc to a string literal to avoid the string from getting indented.
e082ab6 to
ebc7061
Compare
|
I don't understand why these changes cause PHP linting to fail in PHP 7.2 to fail. 🤯 @JakeQZ Any ideas? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why these changes cause PHP linting to fail in PHP 7.2 to fail. 🤯
@JakeQZ Any ideas?
After a bit of head-scratching, a distant memory dawned on me...
| @import url("some/url.css") screen; | ||
| .foo, #bar {background-color: #000;} | ||
| @media screen {#foo.bar {position: absolute;}} | ||
| EXPECTED; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indenting this will probably break the test, because it will include the additional whitespace in the expected result. For readability, it might be better constructing the string by concatenating substrings.
The Lint failure in PHP 7.2 is because the heredoc closing identifier must be at the beginning of the line. From the docs:
The closing identifier may be indented by space or tab, in which case the indentation will be stripped from all lines in the doc string. Prior to PHP 7.3.0, the closing identifier must begin in the first column of the line.
So actually, indenting this will not break the tests for PHP >= 7.3, but will for PHP 7.2.
Also switch a test string from heredoc to a string literal
to avoid the string from getting indented.