-
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generic/LineLength: ignore line length for use statements
From PHP8 on use statements are considered a single token. For this reason they cannot be splitted up to shorter namespaces. PHPCS doesn't account for that and will throw line length errors and warnings for the use statements. This change ignores the line length for the use statements. RFC link: https://wiki.php.net/rfc/namespaced_names_as_token Issue link: squizlabs/PHP_CodeSniffer#3606
- Loading branch information
Showing
4 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
phpcs:set Generic.Files.LineLength ignoreUseStatements true | ||
<?php | ||
|
||
/* This line is fine. */ | ||
use ThisShort\UseStatement\ThatShouldBeAllowed; | ||
|
||
/* This line is too long but will be ignored. This line is too long but will be ignored. */ | ||
use ThisReallyLong\Long\Loooooooooooooooong\Loooooooooooooooong\UseStatement\ThatShouldBeAllowed\AndThrowNoWarningsOrErrors; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters