uptimeproject/php-cs-fixer-config
最新稳定版本:1.3.4
Composer 安装命令:
composer require uptimeproject/php-cs-fixer-config
包简介
Common codestyle configuration for all UptimeProject.io PHP code.
README 文档
README
This is a shared FriendsOfPHP/php-cs-fixer configuration used primarily in UptimeProject.io projects. But feel free to use it in your projects if you would like. Also, if you want to propose a change, feel free to create a PR 😁
This package can be used on PHP 7.4, 8.0 and 8.1.
Installation
composer require --dev uptimeproject/php-cs-fixer-config
PHP-CS-Fixer 2.0
If you are still using v2.x of PHP-CS-Fixer in your project, you should use version <1.2.x of this package.
composer require --dev uptimeproject/php-cs-fixer-config:1.2.*
Note that this version is no longer maintained, and you should upgrade to the latest version of PHP-CS-Fixer
Usage
Create a .php-cs-fixer.php configuration file in the root of your project.
<?php $config = new UptimeProject\PhpCsFixerConfig\Config; $config->getFinder() ->in(__DIR__ . "/src") ->in(__DIR__ . "/tests"); return $config;
Also, make sure to ignore the .php_cs.cache file in your git repository.
Adding/overriding rules
It can be the case that you want to change something in the rules. No problem, you can override or add rules as follows:
<?php $config = new UptimeProject\PhpCsFixerConfig\Config([ 'declare_strict_types' => true, ]); $config->getFinder() ->in(__DIR__ . "/src") ->in(__DIR__ . "/tests"); return $config;
Be aware when you do this that risky fixers are allowed by default!
Example without risky fixers
<?php $ruleOverrides = [ 'no_php4_constructor' => false, 'pow_to_exponentiation' => false, 'no_unneeded_final_method' => false, 'no_unreachable_default_argument_value' => false, 'php_unit_strict' => false, 'psr4' => false, ]; $config = new UptimeProject\PhpCsFixerConfig\Config($ruleOverrides, false); $config->getFinder() ->in(__DIR__ . '/src') ->in(__DIR__ . '/tests'); return $config;
License
The MIT License (MIT). Please see License File for more information.
UptimeProject.io
Check out uptimeproject.io
uptimeproject/php-cs-fixer-config 适用场景与选型建议
uptimeproject/php-cs-fixer-config 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 19.47k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2020 年 05 月 27 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 uptimeproject/php-cs-fixer-config 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 uptimeproject/php-cs-fixer-config 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 19.47k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 13
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-05-27