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

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

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

plumthedev/yii2-php-cs-fixer-config

最新稳定版本:1.2.0

Composer 安装命令:

composer require plumthedev/yii2-php-cs-fixer-config

包简介

Yii2 PHP coding standards configuration

README 文档

README

Yii2 PHP CS Fixer Config

Packagist downloads GitHub license GitHub stars

PHP CS Fixer config for Yii2 projects. Contains Config and Finder which excludes by default Yii2 app basic and advanced directories.
The ruleset is grab from Yii 2 ecosystem and is automatically updated with it.

Installation

$ composer require --dev plumthedev/yii2-php-cs-fixer-config

Usage

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

<?php
$composerJsonPath = __DIR__ . '/composer.json';
$composerJson = file_get_contents($composerJsonPath);
$composerProject = json_decode($composerJson);
$currentYear = date('Y');

$projectHeader = <<<HEADER
Yii2 PHP CS Fixer Config

@author Kacper Pruszynski (plumthedev)
@link https://github.com/plumthedev/yii2-php-cs-fixer-config
@copyright Copyright (c) 2019 - {$currentYear} plumthedev
@license https://github.com/plumthedev/yii2-php-cs-fixer-config/blob/master/LICENSE
@version {$composerProject->version}
HEADER;

use plumthedev\PhpCsFixer\Config;

$csConfig = Config::create();

// CS Config setup
$csConfig->mergeRules([
    'header_comment' => [
        'header' => $projectHeader,
        'commentType' => 'PHPDoc',
        'separate' => 'bottom',
    ]
]);

// CS Finder setup
$csConfigFinder = $csConfig->getFinder();
$csConfigFinder->in(__DIR__); // set current project directory
$csConfig->setFinder($csConfigFinder);

return $csConfig;

Running the tests

PHPUnit

$ composer unit-tests

PHP CS Fixer

$ composer cs-fix

Contributing

This library is open source so if you want to contribute, you can.

Please submit bug reports, suggestions and pull requests to the GitHub issue tracker.

License

This project is licensed under the MIT License - see the LICENSE file for details

统计信息

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

GitHub 信息

  • Stars: 8
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-11-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固