artisanpack-ui/code-style
A custom PHP_CodeSniffer standard for ArtisanPack UI projects, with 16+ sniffs enforcing consistent formatting, naming, security, and best practices. Install via Composer, add a phpcs.xml ruleset, and run phpcs to check your code.
A custom PHP code style standard based on PHPStorm settings. This package provides custom sniffs for PHP_CodeSniffer that enforce consistent code style across your PHP projects.
You can install the ArtisanPack UI Code Standards package by running the following composer command:
composer require artisanpack-ui/code-style --dev
After installation, you can create a phpcs.xml file in your project root with the following content:
<?xml version="1.0"?>
<ruleset name="YourProjectStandard">
<description>Your project's coding standard</description>
<!-- Use ArtisanPackUI standard -->
<rule ref="ArtisanPackUIStandard"/>
<!-- Specify paths to check -->
<file>app</file>
<file>src</file>
<file>tests</file>
<!-- Exclude paths -->
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
</ruleset>
You can run PHP_CodeSniffer with the ArtisanPackUI standard using the following command:
./vendor/bin/phpcs --standard=ArtisanPackUIStandard .
Or if you've set up a custom phpcs.xml file:
./vendor/bin/phpcs
This package includes 16+ custom sniffs covering:
For complete details on all sniffs with examples, see the Custom Sniffs Reference.
You can customize the behavior of the sniffs by overriding their properties in your phpcs.xml file:
<rule ref="ArtisanPackUI.Formatting.Indentation">
<properties>
<property name="indent" value="2"/>
</properties>
</rule>
📚 Complete Documentation - Comprehensive guides and references
🤝 Contributing Guidelines - How to contribute to the project
As an open source project, this package is open to contributions from anyone. Whether you want to report bugs, suggest features, improve documentation, or contribute code, please read through our comprehensive contributing guidelines.
How can I help you explore Laravel packages today?