2019-06-20 09:54:15 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
$header = <<<'EOF'
|
|
|
|
This file is part of Hyperf.
|
|
|
|
|
|
|
|
@link https://www.hyperf.io
|
2020-07-13 08:12:30 +08:00
|
|
|
@document https://hyperf.wiki
|
2019-06-20 09:54:15 +08:00
|
|
|
@contact group@hyperf.io
|
2019-10-22 09:35:48 +08:00
|
|
|
@license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
2019-06-20 09:54:15 +08:00
|
|
|
EOF;
|
|
|
|
|
|
|
|
return PhpCsFixer\Config::create()
|
|
|
|
->setRiskyAllowed(true)
|
|
|
|
->setRules([
|
|
|
|
'@PSR2' => true,
|
|
|
|
'@Symfony' => true,
|
|
|
|
'@DoctrineAnnotation' => true,
|
|
|
|
'@PhpCsFixer' => true,
|
|
|
|
'header_comment' => [
|
|
|
|
'commentType' => 'PHPDoc',
|
|
|
|
'header' => $header,
|
|
|
|
'separate' => 'none',
|
|
|
|
'location' => 'after_declare_strict',
|
|
|
|
],
|
|
|
|
'array_syntax' => [
|
|
|
|
'syntax' => 'short'
|
|
|
|
],
|
|
|
|
'list_syntax' => [
|
|
|
|
'syntax' => 'short'
|
|
|
|
],
|
|
|
|
'concat_space' => [
|
|
|
|
'spacing' => 'one'
|
|
|
|
],
|
|
|
|
'blank_line_before_statement' => [
|
|
|
|
'statements' => [
|
|
|
|
'declare',
|
|
|
|
],
|
|
|
|
],
|
|
|
|
'general_phpdoc_annotation_remove' => [
|
|
|
|
'annotations' => [
|
|
|
|
'author'
|
|
|
|
],
|
|
|
|
],
|
|
|
|
'ordered_imports' => [
|
|
|
|
'imports_order' => [
|
|
|
|
'class', 'function', 'const',
|
|
|
|
],
|
|
|
|
'sort_algorithm' => 'alpha',
|
|
|
|
],
|
|
|
|
'single_line_comment_style' => [
|
|
|
|
'comment_types' => [
|
|
|
|
],
|
|
|
|
],
|
|
|
|
'yoda_style' => [
|
|
|
|
'always_move_variable' => false,
|
|
|
|
'equal' => false,
|
|
|
|
'identical' => false,
|
|
|
|
],
|
|
|
|
'phpdoc_align' => [
|
|
|
|
'align' => 'left',
|
|
|
|
],
|
|
|
|
'multiline_whitespace_before_semicolons' => [
|
|
|
|
'strategy' => 'no_multi_line',
|
|
|
|
],
|
2020-05-18 18:33:27 +08:00
|
|
|
'constant_case' => [
|
|
|
|
'case' => 'lower',
|
|
|
|
],
|
2019-06-20 09:54:15 +08:00
|
|
|
'class_attributes_separation' => true,
|
|
|
|
'combine_consecutive_unsets' => true,
|
|
|
|
'declare_strict_types' => true,
|
|
|
|
'linebreak_after_opening_tag' => true,
|
|
|
|
'lowercase_static_reference' => true,
|
|
|
|
'no_useless_else' => true,
|
|
|
|
'no_unused_imports' => true,
|
|
|
|
'not_operator_with_successor_space' => true,
|
|
|
|
'not_operator_with_space' => false,
|
|
|
|
'ordered_class_elements' => true,
|
|
|
|
'php_unit_strict' => false,
|
|
|
|
'phpdoc_separation' => false,
|
|
|
|
'single_quote' => true,
|
|
|
|
'standardize_not_equals' => true,
|
|
|
|
'multiline_comment_opening_closing' => true,
|
|
|
|
])
|
|
|
|
->setFinder(
|
|
|
|
PhpCsFixer\Finder::create()
|
2020-04-16 11:41:10 +08:00
|
|
|
->exclude('bin')
|
2019-06-20 09:54:15 +08:00
|
|
|
->exclude('public')
|
|
|
|
->exclude('runtime')
|
|
|
|
->exclude('vendor')
|
|
|
|
->in(__DIR__)
|
|
|
|
)
|
|
|
|
->setUsingCache(false);
|