guanguans/php-cs-fixer-custom-fixers

Use php-cs-fixer to format bats,blade.php,Dockerfile,env,json,md,mdx,sh,sql,tex,text,toml,txt,xml,yaml...files. - 使用 php-cs-fixer 去格式化 bats、blade.php、Dockerfile、env、json、md、mdx、sh、sql、tex、text、toml、txt、xml、yaml...文件。

Maintainers

👁 guanguans

Package info

github.com/guanguans/php-cs-fixer-custom-fixers

pkg:composer/guanguans/php-cs-fixer-custom-fixers

Fund package maintenance!

Sponsors

Statistics

Installs: 7 109

Dependents: 13

Suggesters: 0

Stars: 4

Open Issues: 0

1.2.1 2026-03-26 10:09 UTC

Requires

Requires (Dev)

Suggests

Provides

None

Replaces

None


README

Note

Use php-cs-fixer to format bats,blade.php,Dockerfile,env,json,md,mdx,sh,sql,tex,text,toml,txt,xml,yaml...files. - 使用 php-cs-fixer 去格式化 bats、blade.php、Dockerfile、env、json、md、mdx、sh、sql、tex、text、toml、txt、xml、yaml...文件。 A set of custom fixers for friendsofphp/php-cs-fixer. - 一套针对 friendsofphp/php-cs-fixer 的自定义修复器。

👁 tests
👁 php-cs-fixer
👁 codecov
👁 Latest Stable Version
👁 GitHub release (with filter)
👁 Total Downloads
👁 License

Requirement

  • PHP >= 7.4

Installation

composer require guanguans/php-cs-fixer-custom-fixers --dev --ansi -v

Usage

In your php-cs-fixer configuration(sample) register fixers and use them

 <?php
 return (new PhpCsFixer\Config())
+ ->registerCustomFixers($fixers = Guanguans\PhpCsFixerCustomFixers\Fixers::make())
 ->setRules([
 '@PhpCsFixer:risky' => true,
+ Guanguans\PhpCsFixerCustomFixers\Fixer\CommandLineTool\BladeFormatterFixer::name() => true,
+ Guanguans\PhpCsFixerCustomFixers\Fixer\CommandLineTool\YamlfmtFixer::name() => true,
+ // Other fixers...
 ])
 ->setFinder(
 PhpCsFixer\Finder::create()
 ->in(__DIR__)
+ // ->name(Guanguans\PhpCsFixerCustomFixers\Fixer\CommandLineTool\BladeFormatterFixer::make()->extensionPatterns())
+ // ->name(Guanguans\PhpCsFixerCustomFixers\Fixer\CommandLineTool\YamlfmtFixer::make()->extensionPatterns())
+ // Other ...
+ ->name($fixers->extensionPatterns())
 );

Run php-cs-fixer

vendor/bin/php-cs-fixer check --config=.php-cs-fixer-custom.php --show-progress=dots --diff --ansi -vv # Check only
vendor/bin/php-cs-fixer fix --config=.php-cs-fixer-custom.php --show-progress=dots --diff --dry-run --ansi -vv # Check only
vendor/bin/php-cs-fixer fix --config=.php-cs-fixer-custom.php --show-progress=dots --diff --ansi -vv # Fix
vendor/bin/php-cs-fixer fix --config=.php-cs-fixer-custom.php --show-progress=dots --diff --ansi -vvv --sequential # Fix with show debug information

Fixers

Composer scripts

composer checks:required
composer php-cs-fixer-custom-fixers:install-command-line-tools --dry-run
composer php-cs-fixer-custom-fixers:install-command-line-tools -vvv
composer php-cs-fixer-custom-fixers:update-fixers-document
composer php-cs-fixer:fix
composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.