PHPStarter/.php-cs-fixer.dist.php

35 lines
1.0 KiB
PHP

<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$finder = Finder::create()
->in(__DIR__ . '/src')
->in(__DIR__ . '/tests')
->in(__DIR__ . '/public')
->in(__DIR__ . '/config')
->exclude('vendor')
->name('*.php')
->ignoreDotFiles(true)
->ignoreVCS(true);
return (new Config())
->setIndent("\t")
->setRiskyAllowed(true)
->setRules([
'@PSR12' => true,
'array_syntax' => ['syntax' => 'short'],
'blank_line_before_statement' => ['statements' => ['return', 'throw', 'break', 'continue', 'exit']],
'braces_position' => ['control_structures_opening_brace' => 'next_line_unless_newline_at_signature_end'],
'control_structure_continuation_position' => ['position' => 'next_line'],
'indentation_type' => true,
'no_extra_blank_lines' => true,
'no_trailing_whitespace' => true,
'no_unused_imports' => true,
'ordered_imports' => true,
'single_blank_line_at_eof' => true,
'single_import_per_statement' => true,
'trailing_comma_in_multiline' => ['elements' => ['arrays', 'arguments']],
])
->setFinder($finder);