承接 mfonte/coding-standard 相关项目开发

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

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

mfonte/coding-standard

最新稳定版本:1.3.5

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.

统计信息

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

GitHub 信息

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

其他信息

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