empty-monkey/code-style
Composer 安装命令:
composer require empty-monkey/code-style
包简介
Code Style settings for Empty Monkey's repositories
README 文档
README
This package install PHP-CS-Fixer with styling fitted for Empty Monkey.
Installation
1. Install package
composer require --dev empty-monkey/code-style
2. Create config file
Create file .php-cs-fixer.dist.php to your project's root directory and copy the content from here:
<?php require_once __DIR__ . '/vendor/autoload.php'; $finder = PhpCsFixer\Finder::create() ->in(__DIR__) ->ignoreDotFiles(false) ->name('.php-cs-fixer.dist.php') ->exclude([ 'vendor', 'bootstrap/cache', 'storage', ]) ; $ruleSet = new \EmptyMonkey\CodeStyle\PhpCsFixer\RuleSet\EmptyMonkeySet(); $config = new \EmptyMonkey\CodeStyle\PhpCsFixer\Config(); $config ->setRules($ruleSet->getRules()) ->setFinder($finder) ; return $config;
Note: Excluding bootstrap/cache and storage are very Laravel specific excludes. Empty Monkey uses Laravel a lot, but feel free to remove those lines if they don't suit your needs.
3. Make it easy to run
Add support for your composer to run styling by adding this to your composer.json. Now you can run the styles to all your files by running composer style.
"scripts": { "style": [ "php vendor/friendsofphp/php-cs-fixer/php-cs-fixer fix --using-cache=no --config=.php-cs-fixer.dist.php -v" ] }
统计信息
- 总下载量: 124
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-10-25