diff options
author | 2018-12-26 21:39:36 +0100 | |
---|---|---|
committer | 2018-12-26 21:39:37 +0100 | |
commit | ce65f51d919bc4e32b9f25259e0a92d70490c6e5 (patch) | |
tree | 70175331b53d0c9b6e8723987708792f8a5cd540 | |
parent | 4b22862295699490e8e56044942cf0f29a8b918c (diff) | |
download | rss-bridge-ce65f51d919bc4e32b9f25259e0a92d70490c6e5.tar.gz rss-bridge-ce65f51d919bc4e32b9f25259e0a92d70490c6e5.tar.zst rss-bridge-ce65f51d919bc4e32b9f25259e0a92d70490c6e5.zip |
[phpcs] Fix blank line detection
Squiz.WhiteSpace.SuperfluousWhitespace has problems detecting blank
lines in functions when used together with the PSR2 standard.
More information: https://github.com/squizlabs/PHP_CodeSniffer/issues/600
This commit fixes that issue by restoring the original behavior.
It also adds rules for function spacing because the sniff mentioned
above does only work within functions.
-rw-r--r-- | phpcs.xml | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -79,7 +79,22 @@ <!-- Do not add a whitespace before a semicolon --> <rule ref="Squiz.WhiteSpace.SemicolonSpacing"/> <!-- Do not add whitespace at start or end of a file or end of a line --> - <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/> + <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"> + <properties> + <!-- + This fixes an issue in combination with PSR2 + https://github.com/squizlabs/PHP_CodeSniffer/issues/600 + --> + <property name="ignoreBlankLines" value="false"/> + </properties> + </rule> + <rule ref="Squiz.WhiteSpace.FunctionSpacing"> + <properties> + <property name="spacing" value="1" /> + <property name="spacingBeforeFirst" value="0" /> + <property name="spacingAfterLast" value="0" /> + </properties> + </rule> <!-- Whenever possible use single quote strings --> <rule ref="Squiz.Strings.DoubleQuoteUsage"> <exclude name="Squiz.Strings.DoubleQuoteUsage.ContainsVar" /> |