Download the PHP package synergitech/laravel-coding-standards without Composer
On this page you can find all versions of the php package synergitech/laravel-coding-standards. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download synergitech/laravel-coding-standards
More information about synergitech/laravel-coding-standards
Files in synergitech/laravel-coding-standards
Package laravel-coding-standards
Short Description A generic package for implementing Laravel Pint coding standards across Laravel packages
License MIT
Informations about the package laravel-coding-standards
Laravel Coding Standards
A Composer package for implementing Laravel Pint coding standards across Laravel packages.
Overview
This package provides:
- A standardised
pint.jsonconfiguration file with PSR-12 preset and custom rules - Shell scripts to run Laravel Pint for code formatting and testing
- Automatic Laravel Pint dependency management through Composer
Installation
Via Composer (Recommended)
Install the package using Composer:
This will automatically install Laravel Pint as a dependency and make the scripts available in your project.
Alternative Installation Methods
-
As a Git Submodule:
- Manual Installation: Copy the files directly to your project and install Laravel Pint separately:
Usage
Running Pint
Apply Code Formatting
To automatically fix coding standard issues:
Or if installed as submodule/manually:
You can pass additional arguments to customise the behaviour:
Test Code Standards
To check for coding standard issues without making changes:
Or if installed as submodule/manually:
You can pass additional arguments to customise the testing:
Adding Scripts to Your Composer.json
For easier access, you can add these scripts to your project's composer.json:
Then run:
Boost Guidelines
As this plugin acts as a wrapper for pint, the boost guidelines that get published into the project do not reference this package.
If you use boost then you will need to override the boost guidelines for pint.
If you want this package to publish boost guideline stubs into your project (.ai/guidelines), add the Composer install script override below to your project's composer.json:
After adding it, run:
This triggers SynergiTech\LaravelCodingStandards\ComposerScripts::publishGuidelines and copies the guideline files into .ai/guidelines which boost will interpret as an overwrite when running boost:install and boost:update.
Configuration
The pint.json file includes:
- PSR-12 preset as the base standard
- Custom rules for enhanced code quality
- Exclusion of common directories (vendor, storage, bootstrap/cache)
Custom Rules Included
- Array syntax and indentation improvements
- Multiline comment alignment
- String concatenation with single space
- Strict type comparisons
- Ordered class elements and imports
- Modern PHP syntax preferences
- And many more quality-of-life improvements
For a full list of rules, see the pint.json configuration file.
Requirements
- PHP ^8.1
- Laravel Pint ^1.0 (automatically installed with this package)
License
This package is open-sourced software licensed under the MIT license.