qubus/qubus-coding-standard

Qubus Coding Standard

Installs: 69

Dependents: 24

Suggesters: 0

Security: 0

Stars: 2

Watchers: 1

Forks: 0

Open Issues: 0

Type:phpcodesniffer-standard

v1.1.1 2024-09-29 19:08 UTC

This package is auto-updated.

Last update: 2024-10-29 19:18:30 UTC


README

Coding standard rulesets for QubusPHP.

QubusPHP coding standards loosely follows the Laminas Coding Style Guide with a few exceptions:

  1. Abstract classes MUST NOT be prefixed/suffixed with Abstract.
  2. Traits MUST NOT be prefixed/suffixed with Trait.
  3. Interfaces MUST NOT be prefixed/suffixed with Interface or Contract.
  4. Exceptions MUST be suffixed with Exception.
  5. File name of classes must be in PascalCase.
  6. File names of functions must be in lowercase and can be delimited with _.
  7. Custom functions must be namespaced and imported when used.
  8. Classes must be coded to interfaces and follow SOLID.

Installation

  1. Install the coding standard as a dependency of your project:
$ composer require --dev qubus/qubus-coding-standard
  1. Add coding standard to the PHP_CodeSniffer install path:
 vendor/bin/phpcs --config-set installed_paths vendor/qubus/qubus-coding-standard
  1. Run the standards:
 vendor/bin/phpcs /path/to/code