Skip to content

v0.1.0

Latest
Compare
Choose a tag to compare
@MasterRO94 MasterRO94 released this 19 Mar 15:36
· 2 commits to main since this release

[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
  • 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) includes tty 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! ๐Ÿ™Œ