apiera / php-standards
PHP code quality configurations enforcing strict typing and clean code practices
1.0.1
2025-01-27 14:48 UTC
Requires
- php: ^8.3
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^2.1
- slevomat/coding-standard: ^8.15
- squizlabs/php_codesniffer: ^3.11
Requires (Dev)
This package is auto-updated.
Last update: 2025-02-27 14:55:56 UTC
README
Central repository for PHP coding standards and static analysis configurations.
Installation
composer require apiera/php-standards --dev
Components
Usage
Add to your composer.json:
{ "scripts": { "cs": "phpcs --standard=vendor/apiera/php-standards/phpcs/ruleset.xml src/", "cs:fix": "phpcbf --standard=vendor/apiera/php-standards/phpcs/ruleset.xml src/", "stan": "phpstan analyse -c vendor/apiera/php-standards/phpstan/phpstan.neon src/", "analyse": [ "@cs", "@stan" ] } }
Then run:
composer cs # Check code style composer cs:fix # Fix code style issues composer stan # Run static analysis composer analyse # Run all checks