Code Style
A custom PHP code-style standard based on PhpStorm settings. Code Style ships 16+ PHP_CodeSniffer sniffs that enforce consistent formatting, structure, naming and security practices — so your team spends less time debating style and more time shipping.
v1.2.0
GPL-3.0-or-later License
★ 0
composer require artisanpack-ui/code-style
$ composer require artisanpack-ui/code-style --dev
✓ Installed as a dev dependency
$ ./vendor/bin/phpcs --standard=ArtisanPackUIStandard .
✓ 0 errors, 0 warnings
What it does
Consistent style, enforced
A PHP_CodeSniffer standard you drop into any project — 16+ sniffs covering formatting, structure, naming, security and best practices.
16+ custom sniffs
Formatting, structure, naming and security sniffs, ready to run.
Consistent formatting
Indentation, braces, spacing and alignment enforced automatically.
Naming conventions
PascalCase classes, camelCase functions and snake_case table columns.
Security sniffs
Catch missing input validation and output escaping before review.
Best practices
Yoda conditionals, type declarations and disallowed-function checks.
Fully configurable
Override any sniff's properties from your own phpcs.xml.
Get started
Install and run the sniffer
Reference ArtisanPackUIStandard in a phpcs.xml or pass it on the command line.
1 · Install
composer require artisanpack-ui/code-style --dev
2 · Run
./vendor/bin/phpcs --standard=ArtisanPackUIStandard .
Requirements
What you need
| Requirement | Detail | |
|---|---|---|
| Tooling | PHP_CodeSniffer (phpcs) | |
| Install | composer require --dev | |
| Standard | ArtisanPackUIStandard | |
| Pairs with artisanpack-ui/code-style-pint to enforce the same standards through Laravel Pint. | ||
Ship consistent code with Code Style
Stop debating formatting and let the sniffs decide. Free and open source under the MIT license.
