fws/php-coding-standards

Internal PHP coding standards for FWS

Installs: 19

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:phpcodesniffer-standard

1.0.1 2021-03-01 15:40 UTC

This package is auto-updated.

Last update: 2024-04-29 04:21:35 UTC


README

Install

To install in your project, use:

composer require fws/php-coding-standards --dev

Then add a phpcs.xml file to your project:

<?xml version="1.0"?>
<ruleset name="Project">
    <rule ref="FWS"/>
</ruleset>

To do this quickly, run:

echo '<?xml version="1.0"?><ruleset name="Project"><rule ref="FWS"/></ruleset>' > phpcs.xml

Installation will automatically install Forwardslash standard for vendor/bin/phpcs.

CLI Linting

Lint a single file

./vendor/bin/phpcs -s path/to/file.php

Lint multiple files

./vendor/bin/phpcs -s --extensions=php /path/to/dir

Editor Linting

In your favorite editor install it's phpcs plugin, and it will automatically detect your phpcs.xml file and lint any PHP file you have open.