2017-06-03 22:05:31 +00:00
|
|
|
<?php
|
|
|
|
|
2021-01-23 20:33:34 +00:00
|
|
|
use PhpCsFixer\Config;
|
|
|
|
use PhpCsFixer\Finder;
|
|
|
|
|
2021-08-16 00:20:36 +00:00
|
|
|
$finder = (new Finder())
|
|
|
|
->in(__DIR__)
|
|
|
|
->exclude([
|
|
|
|
'vendor',
|
|
|
|
'node_modules',
|
|
|
|
'storage',
|
|
|
|
'bootstrap/cache',
|
|
|
|
])
|
|
|
|
->notName(['_ide_helper*']);
|
2017-06-03 22:05:31 +00:00
|
|
|
|
2021-01-23 21:44:35 +00:00
|
|
|
return (new Config())
|
2021-01-23 20:33:34 +00:00
|
|
|
->setRiskyAllowed(true)
|
|
|
|
->setFinder($finder)
|
2017-08-22 03:06:52 +00:00
|
|
|
->setRules([
|
|
|
|
'@Symfony' => true,
|
|
|
|
'@PSR1' => true,
|
|
|
|
'@PSR2' => true,
|
2021-01-23 20:33:34 +00:00
|
|
|
'@PSR12' => true,
|
2017-08-22 03:06:52 +00:00
|
|
|
'align_multiline_comment' => ['comment_type' => 'phpdocs_like'],
|
|
|
|
'combine_consecutive_unsets' => true,
|
|
|
|
'concat_space' => ['spacing' => 'one'],
|
|
|
|
'heredoc_to_nowdoc' => true,
|
|
|
|
'no_alias_functions' => true,
|
|
|
|
'no_unreachable_default_argument_value' => true,
|
|
|
|
'no_useless_return' => true,
|
2017-09-05 00:07:00 +00:00
|
|
|
'ordered_imports' => [
|
|
|
|
'sortAlgorithm' => 'length',
|
|
|
|
],
|
2021-01-28 04:52:11 +00:00
|
|
|
'phpdoc_align' => [
|
|
|
|
'align' => 'left',
|
|
|
|
'tags' => [
|
|
|
|
'param',
|
|
|
|
'property',
|
|
|
|
'return',
|
|
|
|
'throws',
|
|
|
|
'type',
|
|
|
|
'var',
|
|
|
|
],
|
|
|
|
],
|
2017-08-22 03:06:52 +00:00
|
|
|
'random_api_migration' => true,
|
2017-11-05 19:33:42 +00:00
|
|
|
'ternary_to_null_coalescing' => true,
|
|
|
|
'yoda_style' => [
|
|
|
|
'equal' => false,
|
|
|
|
'identical' => false,
|
|
|
|
'less_and_greater' => false,
|
2017-12-02 02:10:06 +00:00
|
|
|
],
|
2021-01-23 20:33:34 +00:00
|
|
|
]);
|