dixydo/coding-standard

Dixydo Coding Standard for PHP_CodeSniffer

Installs: 486

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:phpcodesniffer-standard

dev-main 2021-10-25 09:02 UTC

This package is not auto-updated.

Last update: 2025-07-30 01:41:05 UTC


README

Dixydo coding standard for PHP CodeSniffer.

This coding standard is based on PSR-12 with some additional 3rd party and custom sniffs to enforce better code formatting.

Install as a dev dependency using composer

composer require --dev dixydo/coding-standard

Create ruleset.xml in the root of your project

<?xml version="1.0"?>
<ruleset>
    <arg name="basepath" value="."/>
    <arg name="cache" value=".phpcs-cache"/>

    <file>src/</file>

    <config name="installed_paths" value="vendor/dixydo/coding-standard"/>
    <rule ref="Dixydo"/>
</ruleset>

Run PHP CodeSniffer

Run the check and display report

vendor/bin/phpcs --standard=ruleset.xml

Run and automatically fix issues

vendor/bin/phpcbf --standard=ruleset.xml