schwarzer/php-code-style
最新稳定版本:v3.0.0
Composer 安装命令:
composer require schwarzer/php-code-style
包简介
Schwarzer IT's shared PHP style rules for PHP-CS-Fixer
README 文档
README
Require this package.
composer require "schwarzer/php-code-style" --dev
Using this package
Create a PHP-CS-Fixer dist file.
touch .php-cs-fixer.dist.php
Minimum Setup
Add this to your .php-cs-fixer.dist.php file.
<?php $classLoader = require __DIR__ . '/vendor/autoload.php'; $classLoader->register(true); $rules = [ // 'use-this-to-override' => 'the-default-rules', ]; $finder = PhpCsFixer\Finder::create() ->in([ __DIR__.'/your/source/code', ]); return (new Schwarzer\PhpCs\Styles)($finder, $rules);
Our Laravel Setup
<?php $classLoader = require __DIR__ . '/vendor/autoload.php'; $classLoader->register(true); $rules = [ // 'use-this-to-override' => 'the-default-rules', ]; $finder = PhpCsFixer\Finder::create() ->notPath('bootstrap') ->notPath('storage') ->notPath('vendor') ->in(getcwd()) ->name('*.php') ->notName('*.blade.php') ->notName('index.php') ->notName('server.php') ->ignoreDotFiles(true) ->ignoreVCS(true); return (new Schwarzer\PhpCs\Styles)($finder, $rules);
Ready
You can now use php-cs-fixer as usual.
- php-cs-fixer fix --dry-run
- php-cs-fixer fix
统计信息
- 总下载量: 488
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-06-02