brainbits/phpcs-standard

Brainbits Coding Style

Installs: 37 252

Dependents: 14

Suggesters: 0

Security: 0

Stars: 1

Watchers: 5

Forks: 2

Open Issues: 1

Type:phpcodesniffer-standard

7.0.1 2024-02-23 09:43 UTC

README

Global

  1. Clone repository
  2. Install dependencies
    composer install
  3. Configure standard:
    {install-dir}/vendor/bin/phpcs --config-set default_standard BrainbitsCodingStandard
    
  4. Execute:
    {install-dir}/vendor/bin/phpcs {src-dir}

In Project

  1. Add the standard to your project:
    composer require brainbits/phpcs-standard
  2. Configure standard:
    vendor/bin/phpcs --config-set default_standard BrainbitsCodingStandard
  3. Execute:
    vendor/bin/phpcs {src-dir}

In Project with Ruleset Customization

  1. Add the standard to your project:
    composer require brainbits/phpcs-standard
  2. Create phpcs.xml (See https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage)
    1. Include brainbits ruleset:
      <rule ref="BrainbitsCodingStandard" />
    2. Add default src-dir:
      <file>{src-dir}</file>
    3. Tweak to your needs, for example add rules or disable rules included in the brainbits standard.
  3. Execute:
    vendor/bin/phpcs

Docker

  1. docker run -it --rm -v $PWD:/app brainbits/phpcs-standard {src-dir}

Used Code Styles