actra / coding-standard
Coding standard of Actra AG: rules for developers and AI assistants, strict PHPStan and PHP-CS-Fixer configuration.
Requires
- php: >=8.5
- friendsofphp/php-cs-fixer: ^3.95
- phpstan/phpstan: ^2.3
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.1
- phpstan/phpstan-strict-rules: ^2.1
- spaze/phpstan-disallowed-calls: ^4.14
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-11 16:00:57 UTC
README
Shared coding standard for all PHP projects and libraries of Actra AG, for developers and AI assistants. It builds on PSR and PER Coding Style, adds stricter rules for types, security and testing, and enforces them with a shared PHPStan (level 10, strict) and PHP-CS-Fixer configuration.
This repository is public: rules only, never project data, credentials, hostnames or customer names.
Contents
- AGENTS.md: entry point with the working rules and links to all standards/
- config/: shared PHPStan and PHP-CS-Fixer configuration
- templates/: starter files for projects
Usage
- Install it (brings PHPStan with extensions and PHP-CS-Fixer):
composer require --dev actra/coding-standard
- Copy the files from templates/ into the project root and adapt them (project part of
AGENTS.md, license in the header of.php-cs-fixer.dist.php). The npm files only for projects with own CSS or JavaScript (html-javascript.md, section 4). - Add the Composer scripts from tooling.md and make
composer checkgreen (PHPStan baseline for legacy code). Projects with request and session objects also include phpstan-no-superglobals.neon. - Remove rules from the project documentation that are already covered here.
Update with composer update actra/coding-standard after reading UPGRADE.md.
Changing the standard
Pull requests with a short reason per rule; only rules that apply to every Actra project (see versioning.md and git.md).