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 11:08:23 +02:00
|
|
|
'binary_operator_spaces' => [
|
|
|
|
'default' => 'at_least_single_space',
|
|
|
|
// Work around https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/7303.
|
|
|
|
'operators' => ['=' => null],
|
|
|
|
],
|
2022-08-28 22:57:06 +02:00
|
|
|
])
|
|
|
|
->setFinder($finder)
|
|
|
|
;
|