Skip to content

webimpress/coding-standard

Webimpress Coding Standard

Unit Tests Coding Standards Coverage Status

Installation

  1. Install the module via composer by running:

    $ composer require --dev webimpress/coding-standard
  2. Add composer scripts into your composer.json:

    "scripts": {
        "cs-check": "phpcs",
        "cs-fix": "phpcbf"
    }
  3. Create file phpcs.xml in base path of your repository with content:

    <?xml version="1.0"?>
    <ruleset name="Webimpress Coding Standard"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:noNamespaceSchemaLocation="./vendor/squizlabs/php_codesniffer/phpcs.xsd">
        <rule ref="./vendor/webimpress/coding-standard/ruleset.xml"/>
    
        <!-- Paths to check -->
        <file>config</file>
        <file>src</file>
        <file>test</file>
    </ruleset>

As shown above you must define locations or files you want to be checked and fixed by code sniffer. For a reference please see: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-Ruleset

Usage

  • To run checks only:

    $ composer cs-check
  • To automatically fix many CS issues:

    $ composer cs-fix

About

Webimpress Coding Standard for PHP_CodeSniffer

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 10

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy