定制 mfonte/coding-standard 二次开发

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

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

mfonte/coding-standard

Composer 安装命令:

composer require mfonte/coding-standard

包简介

Provides multiple rule sets for friendsofphp/php-cs-fixer.

README 文档

README

Mfonte Coding Standard is a Composer library that provides custom sets of rules for php-cs-fixer to keep our code style consistent across projects.

This library is intended for PHP CS Fixer v3. It will not work with PHP CS Fixer v2.

This library is targeted for projects relying on PHP versions from 7.4 onwards. It will not work with PHP versions below 7.4.

Installation

Use composer to install mfonte/coding-standard. php-cs-fixer v3 is automatically installed.

composer require --dev mfonte/coding-standard

Configuration

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

<?php

use Mfonte\CodingStandard\ConfigurationFactory;

$config = ConfigurationFactory::fromRuleset(new \Mfonte\CodingStandard\Ruleset\DefaultRuleset());
$config->getFinder()->in(__DIR__);

return $config;

The Finder can be configured to look for PHP files in a single path (as in the example), or in multiple directories. Is up to you choosing the best configuration based on your project structure.

The caching mechanism of php-cs-fixer is enabled by default. You have to add .php_cs.cache to .gitignore file.

Available Rulesets

  • DefaultRuleset - The default ruleset customized as per the package maintainer projects
  • LaravelRuleset - The default ruleset for Laravel projects
  • CmsRuleset - The default ruleset for CMS projects
  • WordpressRuleset - The default ruleset for Wordpress projects

Usage

vendor/bin/php-cs-fixer fix

See php-cs-fixer documentation for all commands and features.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2021-06-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固