Commit b7955ce
committed
Extra: add two new sniffs related to heredoc/nowdocs
Two new sniffs were introduced in PHPCS 3.11.0:
* The `Generic.Strings.UnnecessaryHeredoc` sniff recommends using nowdoc syntax for heredocs which don't contain interpolation or expressions.
This is similar to the `Squiz.Strings.DoubleQuoteUsage` sniff which is included in the WP-Core ruleset.
Ref: https://github.com/WordPress/WordPress-Coding-Standards/blob/48e59e97eb950dc011d25a6759feb949afd802a0/WordPress-Core/ruleset.xml#L58-L60
* The `Generic.WhiteSpace.HereNowdocIdentifierSpacing` sniff required that there is no space between the `<<<` and the heredoc/nowdoc identifier.
Both seem like useful additions to me,
I also think both sniffs should be regarded as candidates for moving them to the WPCS Core ruleset if/when a next update proposal is posted on Make.1 parent 48e59e9 commit b7955ce
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| |||
0 commit comments