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
Package info
github.com/guanguans/php-cs-fixer-custom-fixers
pkg:composer/guanguans/php-cs-fixer-custom-fixers
Fund package maintenance!
Requires
- php: >=7.4
- friendsofphp/php-cs-fixer: ^3.94
- illuminate/support: ^8.83 || ^9.0 || ^10.0 || ^11.0 || ^12.0 || ^13.0
Requires (Dev)
- adamwojs/php-cs-fixer-phpdoc-force-fqcn: ^2.0
- bamarni/composer-bin-plugin: ^1.9
- brainmaestro/composer-git-hooks: ^2.8 || ^3.0
- composer/composer: ^2.9
- dg/bypass-finals: ^1.9
- doctrine/sql-formatter: ^1.3
- ergebnis/composer-normalize: ^2.50
- ergebnis/license: ^2.7
- ergebnis/php-cs-fixer-config: ^6.60
- ergebnis/phpstan-rules: ^2.13
- ergebnis/rector-rules: ^1.15
- fakerphp/faker: ^1.24
- guanguans/phpstan-rules: ^1.1
- guanguans/rector-rules: ^1.7
- mockery/mockery: ^1.6
- nette/utils: ^3.2 || ^4.0
- pestphp/pest: ^1.23 || ^2.0 || ^3.0 || ^4.0
- php-cs-fixer/phpunit-constraint-isidenticalstring: ^1.7
- php-mock/php-mock-phpunit: ^2.15
- phpmyadmin/sql-parser: ^5.11 || ^6.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-mockery: ^2.0
- phpstan/phpstan-strict-rules: ^2.0
- phpstan/phpstan-webmozart-assert: ^2.0
- phpunit/phpunit: ^9.6 || ^10.0 || ^11.0 || ^12.0 || ^13.0
- povils/phpmnd: ^3.6
- rector/argtyper: ^0.6
- rector/jack: ^0.5
- rector/swiss-knife: ^2.3
- rector/type-perfect: ^2.1
- shipmonk/composer-dependency-analyser: ^1.8
- shipmonk/dead-code-detector: ^0.15
- shipmonk/name-collision-detector: ^2.1
- shipmonk/phpstan-baseline-per-identifier: ^2.3
- shipmonk/phpstan-rules: ^4.3
- spaze/phpstan-disallowed-calls: ^4.9
- staabm/annotate-pull-request-from-checkstyle: ^1.8
- staabm/phpstan-todo-by: ^0.3
- symfony/thanks: ^1.3
- symfony/var-dumper: ^5.4 || ^6.0 || ^7.0 || ^8.0
- symplify/phpstan-rules: ^14.9
- tomasvotruba/class-leak: ^2.1
- tomasvotruba/cognitive-complexity: ^1.0
- tomasvotruba/ctor: ^2.2
- tomasvotruba/type-coverage: ^2.1
- tomasvotruba/unused-public: ^2.2
- yamadashy/phpstan-friendly-formatter: ^1.2
Suggests
- doctrine/sql-formatter: Required to use the fixer [SqlOfDoctrineSqlFormatterFixer].
- laravel/pint: Required to use the fixer [PintFixer].
- phpmyadmin/sql-parser: Required to use the fixer [SqlOfPhpmyadminSqlParserFixer].
Provides
None
Conflicts
Replaces
None
MIT ff446cb9da4c06448d625ad29cdc648ff74b8207
- guanguans <ityaozm.woop@gmail.com>
testinglinterformatterformatstatic analysisstandardslintdevfixerphp-cs-fixertyposPintautocorrectblade-formatterdockerfmtdotenv-linterlint-mdmarkdownlintmarkdownlint-cli2shfmtsqlfluffsqrufftextlinttombixmllintyamlfmtzhlintdoctrine-sql-formatterphpmyadmin-sql-parser
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.
