Category : phpcs

I am looking into setting up the PHPCS to run at build time and report any issues. Something that I find more readable is a start indentation based on an open PHP tag: But PHPCS seems determined that I need to have something like this: I understand that this may be a slippery slope and ..

Read more

I’m trying to ignore spacing rule around concatenation operator, but without success. How to ignore this rule. This is my phpcs.xml file. <?xml version="1.0" encoding="UTF-8"?> <ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd"> <arg name="basepath" value="."/> <arg name="cache" value=".phpcs-cache"/> <arg name="colors"/> <arg name="extensions" value="php"/> <rule ref="PSR1"/> <rule ref="PSR2"/> <rule ref="PSR12"> <exclude name="Squiz.Strings.ConcatenationSpacing"/> </rule> <file>bin/</file> <file>config/</file> <file>public/</file> <file>src/</file> <file>tests/</file> </ruleset> Thank ..

Read more

When using PHPCS with the Generic.WhiteSpace.ScopeIndent sniff, it tries to indent code to the level of the opening tag. Take this example for instance (from a WordPress plugin): <p class="description"><?php esc_html_e( ‘Stuff here’, ‘plugin’ ) ?></p> It wants me to align the closing line with the beginning of the open tag, which in this case ..

Read more