jascha030/php-cs-fixer-config
最新稳定版本:1.0.0
Composer 安装命令:
composer require jascha030/php-cs-fixer-config
包简介
Personal default configurations for php-cs-fixer.
README 文档
README
WP Back-end default configurations for php-cs-fixer.
Installation
composer require --dev jascha030/php-cs-fixer-config
Usage
The Jascha030\PhpCsFixer\Config class extends PhpCsFixer\Config class
and automatically sets our default php-cs-fixer ruleset.
It allows you to set the language version and header comment in a more readable way.
This means any other method from the PhpCsFixer\Config class can be used as well.
Language Version
The Jascha030\PhpCsFixer\Config class contains constants for the available
PHP language versions.
public const SUPPORTED_VERSIONS = [ self::PHP_74, // 70400 self::PHP_80, // 80000 self::PHP_81, // 80100 self::PHP_82, // 80200 (Currently the default value) self::PHP_83, // 80300 ];
Full Example
<?php declare(strict_types=1); use Jascha030\PhpCsFixer\Config; use PhpCsFixer\Finder; use Jascha030\PhpCsFixer\Enum\LanguageVersion; // Use the default PHP-cs-fixer Finder as you would normally do. $finder = Finder::create() ->in(__DIR__) ->exclude(['vendor']) ->ignoreDotFiles(false); $config = new Config( Config::PHP_82, // Set a minimal PHP Language version (8.2 is the default value). <<<'EOF' This file is part of the jascha030/php-cs-fixer-config package. (c) Jascha van Aalst <contact@jaschavanaalst.nl> For the full copyright and license information, please view the LICENSE file that was distributed with this source code. EOF, // Add optional header comment, if needed for the license. (In most cases we won't need this and the argument can be omitted). ); $config->addRules([ // Add or override custom or project-specific rules here if needed. ]); return $config->setFinder($finder); // Set the finder to specify the files to be fixed.
统计信息
- 总下载量: 19
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-11-18