Skip to content

Commit

Permalink
Merge pull request #3141 from movabletype/fix/MTC-29641-php-cs-fixer-…
Browse files Browse the repository at this point in the history
…reconfig

fix php-cs-fixer for v3 and reconfigure rules
  • Loading branch information
jamadam committed May 17, 2024
2 parents 4b4a314 + b08129f commit 6757730
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ perltidy.LOG
*.tdy
*.ERR
.php_cs.cache
.php-cs-fixer.cache

cover_db/

Expand Down
16 changes: 8 additions & 8 deletions .php_cs.dist → .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<?php

$finder = PhpCsFixer\Finder::create()
$finder = (new PhpCsFixer\Finder())
->exclude('php/extlib')
->exclude('plugins/Markdown')
->exclude('plugins/Textile')
->notPath('t/lib/JSON.php')
->in('.')
;

return PhpCsFixer\Config::create()
return (new PhpCsFixer\Config())
->setFinder($finder)
->setRules([
'@PSR2' => true,
'array_syntax' => ['syntax' => 'long'],
'array_syntax' => ['syntax' => 'short'],
'function_typehint_space' => true,
'no_unused_imports' => true,
'no_empty_comment' => true,
Expand All @@ -21,11 +23,9 @@
'return_type_declaration' => true,
'ternary_operator_spaces' => true,
'whitespace_after_comma_in_array' => true,
'braces' => [
'allow_single_line_closure' => true,
'position_after_anonymous_constructs' => 'same',
'position_after_control_structures' => 'same',
'position_after_functions_and_oop_constructs' => 'same',
'braces_position' => [
'functions_opening_brace' => 'same_line',
'classes_opening_brace' => 'same_line',
],
])
;
1 change: 1 addition & 0 deletions MANIFEST.SKIP
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ build-language-stamp
^node_modules/
\.node-version$
\.php_cs\.dist$
\.php-cs-fixer\.php
^rollup.config.ts
^tsconfig.json
\.babelrc
Expand Down

0 comments on commit 6757730

Please sign in to comment.