facile-it/facile-coding-standard
Composer 安装命令:
composer require facile-it/facile-coding-standard
包简介
Facile.it coding standard
README 文档
README
Repository with PHP coding standard ruleset, based on PHP-CS-Fixer.
Installation
Currently, Composer is the only supported installation tool.
$ composer require --dev facile-it/facile-coding-standard
When you install it, a plugin will ask you some questions to setup your project automatically.
The installer will add a .php-cs-fixer.dist.php file in your project root directory,
then you can edit manually if you need some changes.
The CS config will be configured to find your project files using composer autoload sources.
Only psr-0, psr-4 and classmap autoloads are supported.
The installer will also add two scripts in your composer.json;
"scripts": { "cs-check": "php-cs-fixer fix --dry-run --diff", "cs-fix": "php-cs-fixer fix --diff" }
Configuration
The installation configuration should be enough to use it.
If you need to change the CS config file, we suggest to don't edit the main .php-cs-fixer.dist.php file.
You can create a new file .php-cs-fixer.php with something like this:
<?php /** @var PhpCsFixer\Config $config */ $config = require __DIR__ . '/.php-cs-fixer.dist.php'; // change your configuration... $config->setUsingCache(false); return $config;
Usage
To start code style check:
$ composer cs-check
To automatically fix code style:
$ composer cs-fix
PhpCsFixer configuration
See PhpCsFixer GitHub page.
Risky rules
Risky rules may be unstable, and cause unintended behavioral changes to your code. If you want to add these rules, you can create your own .php-cs-fixer.php
configuration:
<?php /** @var \PhpCsFixer\Config $config */ $config = include __DIR__ . '/.php-cs-fixer.dist.php'; $rulesProvider = new Facile\CodingStandards\Rules\CompositeRulesProvider([ new Facile\CodingStandards\Rules\DefaultRulesProvider(), new Facile\CodingStandards\Rules\RiskyRulesProvider(), new Facile\CodingStandards\Rules\ArrayRulesProvider([ // additional rules or rules to override ]), ]); $config->setRules($rulesProvider->getRules()); return $config;
Generate configuration
If you have any problem updating to a new version, you can regenerate
the default .php-cs-fixer.dist.php with the command:
$ composer facile-cs-create-config
$ composer facile-cs-create-config --help
Usage:
facile-cs-create-config [options]
Options:
--no-dev Do not include autoload-dev directories
--no-risky Do not include risky rules
facile-it/facile-coding-standard 适用场景与选型建议
facile-it/facile-coding-standard 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 322.87k 次下载、GitHub Stars 达 10, 最近一次更新时间为 2017 年 02 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「Coding Standard」 「facile」 「facile.it」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 facile-it/facile-coding-standard 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 facile-it/facile-coding-standard 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 facile-it/facile-coding-standard 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Adds the EDTF data type to Wikibase
Vanio Coding Standard Ruleset for PHP_CodeSniffer.
CodeSniffer ruleset for the ZettaCMS coding standard
CodeSniffer ruleset for the Superbrave coding standard
Class to generate a standard structure for api json responses
Convert and operate with FIPS codes for states, counties, etc.
统计信息
- 总下载量: 322.87k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 10
- 点击次数: 10
- 依赖项目数: 29
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-02-02