agelgil / pint-preset
A shared Laravel Pint preset for Makiba General Trading PLC projects
v0.2.0
2026-07-20 13:10 UTC
Requires
- laravel/pint: ^1.25
This package is auto-updated.
Last update: 2026-07-20 13:13:35 UTC
README
A shared Laravel Pint preset for Makiba General Trading PLC projects. It centralizes our PHP code style so all repositories use the same rules with a single, versioned configuration.
- Preset file:
vendor/agelgil/pint-preset/pint.json - Based on the full
@PhpCsFixerand@PhpCsFixer:riskyrule sets, with stricter additions (strict types, fixed class member ordering, trailing commas everywhere) and a required proprietary header. - Intended for internal Makiba codebases. External use is allowed under MIT, but the header rule below will add a Makiba copyright notice to formatted files.
Installation
composer require agelgil/pint-preset --dev
Quick start
Run Pint using this preset directly:
./vendor/bin/pint --config vendor/agelgil/pint-preset/pint.json
Recommended composer scripts
Add convenient scripts to your project’s composer.json:
{
"scripts": {
"lint": "pint --config vendor/agelgil/pint-preset/pint.json --test",
"format": "pint --config vendor/agelgil/pint-preset/pint.json"
}
}
Then run:
composer lint # check-only (fails on styling issues) composer format # auto-fix files in place
What this preset enforces
The preset builds on the empty Pint preset and enables, in order:
@PhpCsFixer— the full non-risky formatting rule set (layout, whitespace, imports, PHPDoc).@PhpCsFixer:risky— risky transforms: strict comparison, native function invocation, alias replacements, and more.- A required Makiba proprietary PHPDoc header, injected after
declare(strict_types=1);. - Strict additions on top of the sets:
declare_strict_types,void_return, fixed class member ordering,?-syntax nullable types, trailing commas in all multiline constructs, classes-only namespace imports, and non-yoda comparisons (overriding the Symfony default).
See pint.json for the exact rule list. Later entries override the rule sets, so project-level
deviations should be discussed before editing this package.
Notes:
- Risky fixers change runtime behavior (
==becomes===, files gaindeclare(strict_types=1);). Run your full test suite after adopting or upgrading this preset, and land the initial reformat as a single dedicated commit (add its SHA to.git-blame-ignore-revs). - A PHPDoc copyright header will be injected/updated at the top of every PHP file.
License
This package is open-sourced software licensed under the MIT license.