Skip to content

Conversation

@oliverklee
Copy link
Collaborator

@oliverklee oliverklee commented Nov 13, 2025

Also switch a test string from heredoc to a string literal
to avoid the string from getting indented.

@oliverklee oliverklee self-assigned this Nov 13, 2025
@oliverklee oliverklee marked this pull request as draft November 13, 2025 09:44
Also switch a test string from heredoc to a string literal
to avoid the string from getting indented.
@coveralls
Copy link

Coverage Status

coverage: 59.658%. remained the same
when pulling ebc7061 on cleanup/reformat
into c7eb1c1 on main.

@oliverklee
Copy link
Collaborator Author

oliverklee commented Nov 13, 2025

I don't understand why these changes cause PHP linting to fail in PHP 7.2 to fail. 🤯

@JakeQZ Any ideas?

Copy link
Collaborator

@JakeQZ JakeQZ left a 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...

Comment on lines +574 to +577
@import url("some/url.css") screen;
.foo, #bar {background-color: #000;}
@media screen {#foo.bar {position: absolute;}}
EXPECTED;
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants