[v0.1.0] - 2025-03-19
๐ Initial Release!
Weโre excited to announce the first release of justcoded/php-cs-fixer! ๐
โจ Features
- Preconfigured ECS setup:
- Includes recommended rules from:
symplify/coding-standard
slevomat/coding-standard
php-cs-fixer
php-cs-fixer-custom-fixers
squizlabs/php_codesniffer
- Includes recommended rules from:
- Programmatic API:
CodeFixer
service to run checks and fixes via PHP code.- Supports custom paths and configuration options (e.g.,
tty
).
- Laravel Integration:
- Provides a Service Provider with out-of-the-box configuration file publishing.
- Registers
CodeFixer
as a scoped singleton within Laravel's service container. - Default config (
config/php-cs-fixer.php
) includestty
setup.
๐ง Usage Highlights
CLI
./vendor/bin/ecs check
./vendor/bin/ecs check --fix
Programmatically
use JustCoded\PhpCsFixer\Services\CodeFixer;
$fixer = new CodeFixer();
$result = $fixer->check(path: 'app/');
Laravel
app(\JustCoded\PhpCsFixer\Services\CodeFixer::class)->fix(config: ['tty' => true]);
โ๏ธ Custom Configuration File Support
You can override the default ECS config by placing your own ecs.php
file in the project root:
<?php
use Symplify\EasyCodingStandard\Config\ECSConfig;
return static function (ECSConfig $ecsConfig): void {
$ecsConfig->import('vendor/justcoded/php-cs-fixer/config/ecs.php');
// Add your custom rules here
};
The package will automatically detect and use your custom config file.
Thank you for using justcoded/php-cs-fixer! ๐