2022-08-28 22:57:06 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
$finder = PhpCsFixer\Finder::create()
|
|
|
|
->exclude('PhpParser/Parser')
|
|
|
|
->in(__DIR__ . '/lib')
|
2022-08-29 21:52:53 +02:00
|
|
|
->in(__DIR__ . '/test')
|
2022-08-29 21:56:41 +02:00
|
|
|
->in(__DIR__ . '/grammar')
|
2022-08-28 22:57:06 +02:00
|
|
|
;
|
|
|
|
|
|
|
|
$config = new PhpCsFixer\Config();
|
2022-08-28 23:02:46 +02:00
|
|
|
return $config->setRiskyAllowed(true)
|
|
|
|
->setRules([
|
2022-08-28 22:57:06 +02:00
|
|
|
'@PSR12' => true,
|
|
|
|
// We use PSR12 with consistent brace placement.
|
|
|
|
'curly_braces_position' => [
|
|
|
|
'functions_opening_brace' => 'same_line',
|
|
|
|
'classes_opening_brace' => 'same_line',
|
|
|
|
],
|
|
|
|
// declare(strict_types=1) on the same line as <?php.
|
|
|
|
'blank_line_after_opening_tag' => false,
|
2022-08-28 23:02:46 +02:00
|
|
|
'declare_strict_types' => true,
|
2022-08-28 22:57:06 +02:00
|
|
|
// Keep argument formatting for now.
|
|
|
|
'method_argument_space' => ['on_multiline' => 'ignore'],
|
2023-09-17 15:59:04 +02:00
|
|
|
'phpdoc_align' => ['align' => 'left'],
|
2023-09-17 18:22:52 +02:00
|
|
|
'phpdoc_trim' => true,
|
|
|
|
'no_empty_phpdoc' => true,
|
|
|
|
'no_superfluous_phpdoc_tags' => ['allow_mixed' => true],
|
|
|
|
'no_extra_blank_lines' => true,
|
2022-08-28 22:57:06 +02:00
|
|
|
])
|
|
|
|
->setFinder($finder)
|
|
|
|
;
|