prezly/code-style
Composer 安装命令:
composer require prezly/code-style
包简介
Prezly Code style configurations
README 文档
README
PHP Code Style checker (and fixer) is built with Easy-Coding-Standard.
Usage
-
(Optional) Add prefixed ECS CLI tool into your composer requirements (if you're not a fan of resolving conflicts with enormous dependencies list of
simplify/easy-coding-standard).composer require --dev symplify/easy-coding-standard-prefixed
-
Link prezly/code-style repo as composer dependency
composer require prezly/code-style:~4.0 -
Include the provided configuration into your project.
Simply create an ecs.php file in your project root and include the ecs.php provided by this package into it.
<?php // Include the stock prezly/code-style config as is. return require __DIR__ . '/vendor/prezly/code-style/ecs.php';
-
If you need to extend or override the stock configuration, you can of course do it by adding code on top of it:
<?php declare(strict_types=1); use PhpCsFixer\Fixer\Operator\BinaryOperatorSpacesFixer; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; return static function (ContainerConfigurator $config): void { // Include the stock prezly/code-style config. (require __DIR__ . '/vendor/prezly/code-style/ecs.php')($config); $services = $config->services(); // Override stock preset configuration. $services->set(BinaryOperatorSpacesFixer::class)->call('configure', [ [ 'operators' => [ '=>' => 'align', ], ], ]); };
-
Run checks (you can also configure your CI to run this for you on every push):
vendor/bin/ecs check src/
-
Fix problems:
vendor/bin/ecs check src/ --fix
prezly/code-style 适用场景与选型建议
prezly/code-style 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 142.62k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2020 年 08 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 prezly/code-style 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 prezly/code-style 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 142.62k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 2
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-08-23