digitalcz/coding-standard

Coding standards used across projects developed by Digital Solutions teams.

v0.3.0 2025-06-19 11:04 UTC

This package is auto-updated.

Last update: 2025-06-19 11:05:29 UTC


README

PHP coding standards library for Digital Solutions projects. Built on PHP_CodeSniffer and Slevomat Coding Standard.

Installation

composer require --dev digitalcz/coding-standard

Create ruleset.xml in your project root:

<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="custom">
    <rule ref="./vendor/digitalcz/coding-standard/ruleset.xml"/>
</ruleset>

Usage

# Check code standards
vendor/bin/phpcs

# Auto-fix issues
vendor/bin/phpcbf

Key Features

  • PSR-12 compliance with strict additions
  • 180 character line length
  • Cyclomatic complexity max 25
  • Modern PHP features required
  • Doctrine/REST/OpenAPI annotation support

Development

composer test        # Run tests
composer cs-check    # Check standards
composer cs-fix      # Fix standards