Skip to content

Latest commit

 

History

History
32 lines (23 loc) · 1.15 KB

phpcs.md

File metadata and controls

32 lines (23 loc) · 1.15 KB

Coding Standard validation (PHPCS / PHP_CodeSniffer)

The coding style is validated using PHPCS and uses the Youwe Coding Standard.

During the installation of the testing suite a file called phpcs.xml is added to the root of the repository which refers to the coding standard. To make adjustments to the coding standard this file can be edited and committed.

PHPCS PHP Coding Standards Fixer

Common issues

Especially when adapting Testing Suite at a later moment it might be useful to just ignore some issues and refactor the code later. Doing this inline in the code is pretty descriptive, If usage of phpcs:disable is used, make sure to explicitly describe what the intention of this was.

<?php
# Some examples of ignoring single lines
// phpcs:ignore Generic.Files.LineLength.TooLong
// phpcs:disable Generic.CodeAnalysis.EmptyStatement.DetectedCatch

# An example of disabling multiple lines
// phpcs:disable Some comment on why this piece of code is not checked with PHPCS
// ...
// phpcs:enable