sugared-rim/php-cs-fixer

PHP-CS-Fixer sweetened with ease

2.1.0 2018-03-31 21:43 UTC

This package is not auto-updated.

Last update: 2024-04-27 17:53:21 UTC


README

SensioLabsInsight

PHP-CS-Fixer sweetened with ease 🍒

SugaredRim\PHP-CS-Fixer takes an opinionated view of code style checking with PHP-CS-Fixer, it is preconfigured to get you up and running as quickly as possible.

Install

$ composer require --dev sugared-rim/php-cs-fixer

Usage

Instead of running php-cs-fixer with all its options, just run sugared-rim-php-cs-fixer - that's it:

{
    ...
    "require-dev": {
        "sugared-rim/php-cs-fixer": ...
    },
    "scripts": {
        "lint": "sugared-rim-php-cs-fixer"
    }
}

Configuration

You may overwrite some options by putting it in your composer.json.

Some of the default settings:

{
    ...
    "scripts": {
        "lint": "sugared-rim-php-cs-fixer"
    },
    "extra": {
        "sugared-rim/php-cs-fixer": {
            "diff": true,
            "dry-run": true,
            "cache": true,
            "path": {
                "in": [
                    "."
                ],
                "name": [
                    "*.php",
                    "*.phtml",
                    "*.twig",
                    "*.xml",
                    "*.yml"
                ],
                "exclude": [
                    "build",
                    "bower_components",
                    "node_modules",
                    "vendor"
                ],
                "ignoreDotFiles": true,
                "ignoreVCS": true
            }
        }
    }
}

License

MIT © Michael Mayer