mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 12:39:43 +00:00
Use PHP-CS-fixer to standardize the code style
This commit is contained in:
parent
66bc178238
commit
fc5c5625cb
2 changed files with 42 additions and 0 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -10,6 +10,9 @@ server.lock
|
||||||
*.txt
|
*.txt
|
||||||
*.properties
|
*.properties
|
||||||
|
|
||||||
|
# php-cs-fixer
|
||||||
|
/.php_cs.cache
|
||||||
|
/.php-cs-fixer.cache
|
||||||
|
|
||||||
############
|
############
|
||||||
## Windows
|
## Windows
|
||||||
|
|
|
||||||
39
.php-cs-fixer.php
Normal file
39
.php-cs-fixer.php
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$finder = PhpCsFixer\Finder::create()
|
||||||
|
->in(__DIR__ . '/src');
|
||||||
|
|
||||||
|
return (new PhpCsFixer\Config)
|
||||||
|
->setRules([
|
||||||
|
'array_indentation' => true,
|
||||||
|
'array_syntax' => [
|
||||||
|
'syntax' => 'short'
|
||||||
|
],
|
||||||
|
'binary_operator_spaces' => [
|
||||||
|
'default' => 'single_space'
|
||||||
|
],
|
||||||
|
'blank_line_after_namespace' => true,
|
||||||
|
'blank_line_after_opening_tag' => true,
|
||||||
|
'cast_spaces' => [
|
||||||
|
'space' => 'single'
|
||||||
|
],
|
||||||
|
'concat_space' => [
|
||||||
|
'spacing' => 'one'
|
||||||
|
],
|
||||||
|
'elseif' => true,
|
||||||
|
'indentation_type' => true,
|
||||||
|
'no_closing_tag' => true,
|
||||||
|
'no_empty_phpdoc' => true,
|
||||||
|
'no_extra_blank_lines' => true,
|
||||||
|
'no_superfluous_phpdoc_tags' => [
|
||||||
|
'allow_mixed' => true,
|
||||||
|
],
|
||||||
|
'no_trailing_whitespace' => true,
|
||||||
|
'no_trailing_whitespace_in_comment' => true,
|
||||||
|
'no_whitespace_in_blank_line' => true,
|
||||||
|
'unary_operator_spaces' => true
|
||||||
|
])
|
||||||
|
->setFinder($finder)
|
||||||
|
->setIndent("\t")
|
||||||
|
->setLineEnding("\n")
|
||||||
|
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect());
|
||||||
Loading…
Add table
Add a link
Reference in a new issue