Download the PHP package artisanpack-ui/code-style-pint without Composer
On this page you can find all versions of the php package artisanpack-ui/code-style-pint. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download artisanpack-ui/code-style-pint
More information about artisanpack-ui/code-style-pint
Files in artisanpack-ui/code-style-pint
Package code-style-pint
Short Description Laravel Pint preset for ArtisanPack UI code standards
License GPL-3.0-or-later
Informations about the package code-style-pint
ArtisanPack UI Code Style Pint
Laravel Pint preset for ArtisanPack UI code standards. This package provides a pre-configured pint.json file that enforces coding standards matching the artisanpack-ui/code-style PHPCS package.
Installation
Install the package via Composer:
Usage
For Laravel Applications
Publish the pint.json configuration file to your project root:
Use --force to overwrite an existing pint.json:
Alternatively, use Laravel's standard publish command:
For Laravel Packages
When developing a Laravel package, use PintConfigBuilder directly since php artisan isn't available:
Standard Pint Configuration:
Run it once to generate your config:
Or copy the stub directly:
WordPress-Style Spacing (PHP-CS-Fixer):
For WordPress-style spacing in packages, copy the PHP-CS-Fixer configuration stub:
Then install PHP-CS-Fixer:
WordPress-Style Spacing (Laravel Applications)
If you need WordPress-style spacing (spaces inside parentheses and brackets) in a Laravel application, use the --wordpress flag:
This will create .php-cs-fixer.dist.php with custom fixers that enforce:
- Spaces inside parentheses:
if ( $var )instead ofif ($var) - Spaces inside brackets (variable indices only):
$array[ $key ]instead of$array[$key] - Spaces around concatenation:
$a . $binstead of$a.$b
Note: WordPress spacing requires PHP-CS-Fixer instead of Pint:
Running Pint
Once the Pint configuration is in place, run Pint to format your code:
To test without making changes:
Running PHP-CS-Fixer (WordPress Spacing)
If you're using WordPress-style spacing, run PHP-CS-Fixer instead:
To test without making changes:
Programmatic Configuration
For advanced use cases, you can build configurations programmatically:
See docs/customization.md for detailed customization options.
Rules Included
This preset enforces the following code style rules:
- Array Syntax: Short array syntax (
[]instead ofarray()) - Binary Operator Spaces: Single space around operators, aligned assignments
- Brace Position: Same line for control structures, next line for functions
- Class Structure: Ordered class elements (traits, constants, properties, methods)
- Concatenation Spacing: Single space around concatenation operator (
.) - Import Ordering: Alphabetically sorted imports (classes, functions, constants)
- Single Quotes: Single quotes for strings without variables
- Trailing Commas: In multiline arrays, arguments, and parameters
- Visibility Required: All properties, methods, and constants must have visibility
- Yoda Style: Literals on the left side of comparisons
For WordPress-style spacing (spaces inside parentheses and brackets), see the WordPress-Style Spacing section.
Complementary PHPCS Usage
Some rules cannot be enforced by Pint (security checks, naming conventions, line length). For complete code style enforcement, use both packages:
Recommended Workflow
-
Run Pint first to auto-fix formatting:
- Run PHPCS to catch remaining issues:
Laravel Boost AI Guidelines
This package includes AI guidelines for Laravel Boost, which will automatically be available when users run php artisan boost:install.
Overriding Default Pint Guidelines
To have AI assistants use ArtisanPack UI standards instead of Laravel's default Pint guidelines, publish the Boost override:
This creates .ai/guidelines/laravel/pint.blade.php, which overrides Boost's default Pint guidelines with ArtisanPack UI specific guidance.
Documentation
- Customization Guide - Customize rules and configuration
- Rules Mapping - PHPCS to Pint rule mapping
- IDE Integration - PhpStorm, VS Code, Vim, and more
- CI/CD Integration - GitHub Actions, GitLab CI, and more
- Migration Guide - Migrate from other tools
Contributing
As an open source project, this package is open to contributions from anyone. Please read through the contributing guidelines to learn more about how you can contribute to this project.
License
This package is open-sourced software licensed under the GPL-3.0-or-later license.