sugared-rim/php_codesniffer

PHP_CodeSniffer sweetened with ease

3.1.0 2018-03-27 22:45 UTC

This package is not auto-updated.

Last update: 2024-12-21 21:31:17 UTC


README

Build Status Coverage Status Scrutinizer Code Quality Code Climate

SensioLabsInsight

PHP_CodeSniffer sweetened with ease 🍒

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

Install

$ composer require --dev sugared-rim/php_codesniffer

Usage

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

{
    ...
    "require-dev": {
        "sugared-rim/php_codesniffer": ...
    },
    "scripts": {
        "lint": "sugared-rim-phpcs"
    }
}

Configuration

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

See schnittstabil/finder-by-config for details of the files options.

Some of the default settings:

{
    ...
    "scripts": {
        "lint": "sugared-rim-phpcs"
    },
    "extra": {
        "sugared-rim/php_codesniffer": {
            "default_standard": ["PSR1", "PSR2"],
            "files": {
                "in": ["."],
                "name": ["*.php"],
                "files": true,
                "exclude": [
                    "build",
                    "bower_components",
                    "node_modules",
                    "vendor"
                ],
                "ignoreDotFiles": true,
                "ignoreVCS": true
            }
        }
    }
}

All extra.sugared-rim/php_codesniffer options are passed through PHP_CodeSniffer::setConfigData, except:

  • files: Array of files and/or directories to check.

License

MIT © Michael Mayer