The Crawl Coding Standard (PHP CodeSniffer)
Go to file
Gertjan Krol a26d99204c Update changelog title 2022-08-20 01:23:04 +02:00
config Initial commit & release 2022-08-20 00:50:26 +02:00
src/rulesets Initial commit & release 2022-08-20 00:50:26 +02:00
.gitignore Initial commit & release 2022-08-20 00:50:26 +02:00
.gitlab-ci.yml Initial commit & release 2022-08-20 00:50:26 +02:00
CHANGELOG.md Initial commit & release 2022-08-20 00:50:26 +02:00
CONTRIBUTING.md Initial commit & release 2022-08-20 00:50:26 +02:00
LICENSE.md Initial commit & release 2022-08-20 00:50:26 +02:00
README.md Update changelog title 2022-08-20 01:23:04 +02:00
composer.json Initial commit & release 2022-08-20 00:50:26 +02:00

README.md

Crawl Coding Standard

Latest Version on Packagist Total Downloads

This package provides rule sets for the Crawl Coding Standard.
It requires squizlabs/php_codesniffer and some extensions (see composer.json).

Installation

You can install the package via composer (you should only need it for development):

composer require crawl/coding-standard --dev

Usage

Depending on your project, copy phpcs-laravel.xml or phpcs-package.xml from config/ to your project.
Note: don't forget to update Package\Namespace when using phpcs-package.xml.

You can then run PHP Code Sniffer/Beautifier:

$ vendor/bin/phpcs --standard=./path/to/copied/phpcs.xml
$ vendor/bin/phpcbf --standard=./path/to/copied/phpcs.xml

For easier usage, add the following to scripts in your project's composer.json:

    ...
    "scripts": {
        "style": "vendor/bin/phpcs --standard=./path/to/copied/phpcs.xml",
        "fix-style": "vendor/bin/phpcbf --standard=./path/to/copied/phpcs.xml",
    }.
    ...

You can then use composer style to run the sniffer, and composer fix-style to run the beautifier.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email security@gkcld.net instead of using the issue tracker.

Authors

License

The MIT License (MIT). Please see LICENSE for more information.