PHPackages                             interaction-design-foundation/coding-standard - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. interaction-design-foundation/coding-standard

ActivePhpcodesniffer-standard[Testing &amp; Quality](/categories/testing)

interaction-design-foundation/coding-standard
=============================================

IxDF coding standard: PHP\_CodeSniffer rules and shared PHP-CS-Fixer configuration.

1.0.0(4w ago)7176.5k—4.6%1[1 issues](https://github.com/InteractionDesignFoundation/coding-standard/issues)10MITPHPPHP ^8.4CI passing

Since Apr 14Pushed 4w ago7 watchersCompare

[ Source](https://github.com/InteractionDesignFoundation/coding-standard)[ Packagist](https://packagist.org/packages/interaction-design-foundation/coding-standard)[ RSS](/packages/interaction-design-foundation-coding-standard/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (10)Dependencies (25)Versions (36)Used By (10)

[![IxDF PHP Coding Standard](https://raw.githubusercontent.com/InteractionDesignFoundation/coding-standard/main/art/logo_gdt_light.svg)](https://www.interaction-design.org)

[![Tests](https://github.com/InteractionDesignFoundation/coding-standard/actions/workflows/test.yml/badge.svg)](https://github.com/InteractionDesignFoundation/coding-standard/actions/workflows/test.yml)[![PHP Psalm](https://github.com/InteractionDesignFoundation/coding-standard/actions/workflows/psalm.yml/badge.svg)](https://github.com/InteractionDesignFoundation/coding-standard/actions/workflows/psalm.yml)[![PHP Psalm Level](https://camo.githubusercontent.com/72e97ab6e2b497d4b7dcce435b05be09769225dfff5a28146d8304addf30d65e/68747470733a2f2f73686570686572642e6465762f6769746875622f496e746572616374696f6e44657369676e466f756e646174696f6e2f636f64696e672d7374616e646172642f6c6576656c2e737667)](https://shepherd.dev/github/InteractionDesignFoundation/coding-standard)[![PHP Psalm Type Coverage](https://camo.githubusercontent.com/0d9f7d30a7d711a9d022fce1e62bb7c757bd12c790c0be181332647cc8b0d0aa/68747470733a2f2f73686570686572642e6465762f6769746875622f496e746572616374696f6e44657369676e466f756e646174696f6e2f636f64696e672d7374616e646172642f636f7665726167652e737667)](https://shepherd.dev/github/InteractionDesignFoundation/coding-standard)[![Total Downloads](https://camo.githubusercontent.com/20b7c28829590b3f94a7f62ac62d1ffa25c80b30b5b10a0c3e7e741a8fd12b52/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696e746572616374696f6e2d64657369676e2d666f756e646174696f6e2f636f64696e672d7374616e64617264)](https://packagist.org/packages/interaction-design-foundation/coding-standard)[![Latest Stable Version](https://camo.githubusercontent.com/aeef3352b340e53af10f640ec47de9c3f59ec554d0c90bdb68993dc97b9647a1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696e746572616374696f6e2d64657369676e2d666f756e646174696f6e2f636f64696e672d7374616e64617264)](https://packagist.org/packages/interaction-design-foundation/coding-standard)

IxDF PHP Coding Standard
------------------------

[](#ixdf-php-coding-standard)

An opinionated coding standard for PHP and Laravel projects, built on [PER-CS3.0](https://www.php-fig.org/per/coding-style/). Focuses on:

- **High signal-to-noise ratio** (concise but informative PHPDoc, e.g. array shapes)
- **Strict, explicit code**: `strict_types`, strict comparisons, final by default, no magic
- **Harmony with static analysis tools** (PHPStan, Psalm, Rector, etc.)
- **Auto-fixing over reporting** (violations are not only reported but also fixed automatically, when possible)
- **PHP and Laravel best practices** (enforced, not just suggested)

Two tools, two roles, meant to run together:

- **PHP-CS-Fixer** (primary): fast auto-formatting and modernization rules.
- **PHP\_CodeSniffer** (supplementary): structural and semantic checks PHP-CS-Fixer cannot express (complexity, Laravel conventions, naming).

Tip

This repository is a part of the IxDF toolchain for PHP: Rector ➝ Coding Standard Fixers ➝ PHPStan + Psalm.

1. Installation
---------------

[](#1-installation)

```
composer require --dev interaction-design-foundation/coding-standard
```

2. Configuration
----------------

[](#2-configuration)

### PHP-CS-Fixer

[](#php-cs-fixer)

Primary formatter.

Create `.php-cs-fixer.php` in your project root:

```
