dekodeinteraktiv/coding-standards

This package is abandoned and no longer maintained. The author suggests using the dekode/coding-standards package instead.

Dekode Coding Standards

Maintainers

Package info

github.com/DekodeInteraktiv/coding-standards

Type:phpcodesniffer-standard

pkg:composer/dekodeinteraktiv/coding-standards

Statistics

Installs: 44 361

Dependents: 15

Suggesters: 0

Stars: 5

Open Issues: 0


README

Installation and usage

$ composer require --dev dekode/coding-standards

Add lint script to composer.json

"scripts": {
  "lint": [
    "./vendor/bin/phpcs ."
  ]
}

Configuration File

Create a phpcs.xml.dist file in your project root with the following contents. (Update required PHP version and text_domain accordingly.)

<?xml version="1.0"?>
<ruleset>
	<file>.</file>
	<arg name="extensions" value="php" />
	<config name="testVersion" value="8.2" />
	<config name="text_domain" value="block-theme,default" />
	<rule ref="Dekode" />
</ruleset>

DekodeNoAlignment ruleset

DekodeNoAlignment extends Dekode with additional strictness. Use it in place of Dekode for projects that want tighter formatting enforcement:

  • Adds a custom DekodeNoAlignment.Formatting.DisallowDoubleSpace sniff: disallows two or more consecutive spaces on a line (outside indentation) — auto-fixable via phpcbf
  • Suppresses noisy warnings for value-alignment (MultipleStatementAlignment, DoubleArrowNotAligned)
  • Suppresses Squiz.Commenting.FunctionComment.SpacingAfterParamType
<?xml version="1.0"?>
<ruleset>
	<file>.</file>
	<arg name="extensions" value="php" />
	<config name="testVersion" value="8.2" />
	<config name="text_domain" value="block-theme,default" />
	<rule ref="DekodeNoAlignment" />
</ruleset>