destination/php-cs-fixer-config
Composer 安装命令:
composer require destination/php-cs-fixer-config
包简介
PHP-CS-Fixer config for Destination Projects
README 文档
README
PHP-CS-Fixer config for Destination projects
Global Usage
Installation
Install the package globally with composer:
composer global require destination/php-cs-fixer-config
Now create a .php-cs-fixer.dist.php file within your home directory:
<?php $config = new Destination\PhpCsFixerConfig\Config(); $config ->setUsingCache(false) ->setRules(array_merge($config->getRules(), [ // Strict types is a sensible default for new projects but is risky on an existing code base 'declare_strict_types' => false, ])) ; return $config;
Usage
Assuming your global composer's bin directory is in your $PATH, you can now run the following within a directory you want to format:
php-cs-fixer fix --config ~/.php-cs-fixer.dist.php .
Local Usage
Installation
Use composer to add the package to your dev dependencies:
composer require destination/php-cs-fixer-config --dev
Add the following to your composer.json:
"scripts": { "fix": "vendor/bin/php-cs-fixer fix --using-cache=no -v", }
Usage
Create a .php-cs-fixer.dist.php file in your project's root directory.
You can copy a typical config file from this package if desired:
$ cp vendor/destination/php-cs-fixer-config/.php-cs-fixer.dist.php .
Add the following entries to your .gitignore file:
/.php-cs-fixer.cache
/.php-cs-fixer.php
Fixing Issues
Manually
To fix issues manually, run the following command:
$ composer fix
Pre-commit hook
Run the following to have PHP-CS-Fixer run on changed files before every commit:
$ cp vendor/destination/php-cs-fixer-config/git-hooks/pre-commit .git/hooks/pre-commit $ chmod +x .git/hooks/pre-commit
Editorconfig
Copy the .editorconfig file from the package into your project so your IDE follows some of our standards:
$ cp vendor/destination/php-cs-fixer-config/.editorconfig .
destination/php-cs-fixer-config 适用场景与选型建议
destination/php-cs-fixer-config 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 28.9k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 05 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 destination/php-cs-fixer-config 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 destination/php-cs-fixer-config 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 28.9k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: proprietary
- 更新时间: 2020-05-13