[PSR12] Add failing test for valid code #2617
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
More if an issue than a pull request sorry.
The following code is valid as per PSR-12, however phpcs reports the following issues:
It recognises the inline docblock as a file header, which is incorrect. The fix for this is simple, however that affected the check for leading blank lines in
FileHeaderUnitTest.2.inc
.The code for the opening PHP tag also doesn't seem to be correct, PSR-12 only talks about mixed HTML and PHP files, it doesn't require the opening tag to be the first thing in the file in all scenarios (eg the hashbang seen here is valid)