Skip to content

sugared-rim/php_codesniffer

Repository files navigation

SugaredRim\PHP_CodeSniffer

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

About

PHP_CodeSniffer sweetened with ease 🍒

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages