定制 jascha030/php-cs-fixer-config 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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.

统计信息

  • 总下载量: 27
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-11-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固