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
<?phpnamespaceBar;
useDateTimeImmutable, DateTimeZone;
class Foo
{
}
To reproduce
Create a file called Foo.php with the code sample above...
Run phpcs --standard=PSR12 Foo.php
See error message displayed
5 | ERROR | [x] Header blocks must be separated by a single blank line
Expected behavior
No error.
Versions:
OS: Windows 11
PHP: 8.1
PHPCS: 3.7.1
Standard: PSR12
Additional context
If I run phpcbf --standard=PSR12 Foo.php, it formats the file as follows:
<?phpnamespaceBar;
useDateTimeImmutable,
DateTimeZone;
class Foo
{
}
This does not appear to match the PSR-12 specification, and it makes no sense anyway given that an import like the following is correctly left on one line without any error:
usePackage\{ClassA, ClassB};
The text was updated successfully, but these errors were encountered:
theodorejb
changed the title
Error and incorrect formatting for comma-separated use statement
Incorrect formatting for comma-separated use statement
Nov 1, 2022
Code sample
To reproduce
Foo.php
with the code sample above...phpcs --standard=PSR12 Foo.php
Expected behavior
No error.
Versions:
Additional context
If I run
phpcbf --standard=PSR12 Foo.php
, it formats the file as follows:This does not appear to match the PSR-12 specification, and it makes no sense anyway given that an import like the following is correctly left on one line without any error:
The text was updated successfully, but these errors were encountered: