maxictbv/coding-standard

MaxICT Coding Standard

Installs: 321

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

Type:phpcodesniffer-standard

1.0 2023-05-26 12:28 UTC

This package is auto-updated.

Last update: 2024-04-26 14:43:48 UTC


README

A PHP_CodeSniffer coding standard to be used across MaxICT PHP code bases.

Installation

To install, run:

composer require --dev maxictbv/coding-standard

Copy the phpcs.xml.dist file to the root of your project.

Progressive Application

Most legacy codebases won't play nice with the full coding standard at the start. Introducing strict typing for example may cause major issues. To avoid these issues, the following approach can be used. It is a bit tedious, because unfortunately Codesniffer can only exclude rules (blacklist) and not whitelist:

  • Copy the phpcs.xml.dist file to the root of your project.
  • Add an exclusion for every sniff.
  • Start removing exclusions one by one until an acceptable set is reached.
  • When the codebase improves over time, re-evaluate from time to time if more rules can be enabled, and do so if that's the case.