承接 distortedfusion/php-cs-fixer-config 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

distortedfusion/php-cs-fixer-config

最新稳定版本:2.1.3

Composer 安装命令:

composer require distortedfusion/php-cs-fixer-config

包简介

A shared php-cs-fixer config used in our packages.

README 文档

README

Latest Version Software License Build Status

This is a shared FriendsOfPHP/PHP-CS-Fixer configuration used in our packages.

Installation

composer require --dev distortedfusion/php-cs-fixer-config

Usage

Create a .php_cs.dist configuration file in the root of your project.

<?php

$config = new DistortedFusion\PhpCsFixerConfig\Config();
$config->getFinder()
    ->in(__DIR__ . "/src")
    ->in(__DIR__ . "/tests");

return $config;

Adding or overloading rules

Adding an array of rules to the construct of the Config object allows you to add or overload rules:

<?php

$config = new DistortedFusion\PhpCsFixerConfig\Config([
    'psr0' => false,
    'psr4' => false,
]);
$config->getFinder()
    ->in(__DIR__ . "/src")
    ->in(__DIR__ . "/tests");

return $config;

Composer scripts

Adding composer scripts makes it easy to add aliases for testing and fixing code styling.

Please Note: The config contains risky rules by default, this requires the usage of --allow-risky=yes. If you don't want to run risky rules you can excluded them in the .php-cs.dist config.

{
    ...
    "scripts": {
        "phpcs-fix" : "php-cs-fixer fix --using-cache=no --allow-risky=yes --ansi",
        "phpcs": "php-cs-fixer fix -v --diff --dry-run --allow-risky=yes --ansi",
        "test": [
            "@phpcs"
        ]
    },
    "scripts-descriptions": {
        "phpcs": "Runs coding style test suite",
        "test": "Runs all tests"
    }
}

Testing

To run the tests, run the following command from the project folder:

$ composer test

Security

If you discover a security vulnerability within this package, please send an e-mail to Kevin Dierkx via kevin@distortedfusion.com. All security vulnerabilities will be promptly addressed.

Contributing

Contributions are welcome and will be fully credited. Please see CONTRIBUTING for details.

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-09-11