first commit
This commit is contained in:
36
.php-cs-fixer.dist.php
Normal file
36
.php-cs-fixer.dist.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
$directories = array_values(array_filter([
|
||||
__DIR__ . '/src',
|
||||
__DIR__ . '/tests',
|
||||
__DIR__ . '/config',
|
||||
], static fn (string $directory): bool => is_dir($directory)));
|
||||
|
||||
$finder = PhpCsFixer\Finder::create()
|
||||
->in($directories)
|
||||
->name('*.php')
|
||||
->ignoreDotFiles(true)
|
||||
->ignoreVCS(true);
|
||||
|
||||
return (new PhpCsFixer\Config())
|
||||
->setRiskyAllowed(true)
|
||||
->setFinder($finder)
|
||||
->setRules([
|
||||
'@PSR12' => true,
|
||||
'array_indentation' => true,
|
||||
'binary_operator_spaces' => ['default' => 'single_space'],
|
||||
'blank_line_after_opening_tag' => true,
|
||||
'blank_line_before_statement' => ['statements' => ['return', 'throw', 'try']],
|
||||
'class_attributes_separation' => ['elements' => ['method' => 'one', 'property' => 'one']],
|
||||
'concat_space' => ['spacing' => 'one'],
|
||||
'declare_strict_types' => true,
|
||||
'final_class' => false,
|
||||
'no_unused_imports' => true,
|
||||
'ordered_imports' => ['sort_algorithm' => 'alpha'],
|
||||
'ordered_types' => ['sort_algorithm' => 'alpha'],
|
||||
'single_import_per_statement' => true,
|
||||
'single_line_empty_body' => true,
|
||||
'trailing_comma_in_multiline' => ['elements' => ['arrays', 'arguments', 'parameters']],
|
||||
]);
|
||||
Reference in New Issue
Block a user