2018-12-04 19:24:25 +03:00
|
|
|
<?php
|
|
|
|
use PhpCsFixer\Config;
|
|
|
|
use PhpCsFixer\Finder;
|
|
|
|
$finder = Finder::create()
|
|
|
|
->in(__DIR__ . '/src/')
|
|
|
|
->in(__DIR__ . '/tests/')
|
|
|
|
;
|
|
|
|
$rules = [
|
|
|
|
'@PSR2' => true,
|
|
|
|
'array_syntax' => [
|
|
|
|
'syntax' => 'short',
|
|
|
|
],
|
|
|
|
'braces' => [
|
|
|
|
'allow_single_line_closure' => true,
|
|
|
|
],
|
2019-01-26 17:51:05 +03:00
|
|
|
'logical_operators' => true,
|
2018-12-04 19:24:25 +03:00
|
|
|
'native_constant_invocation' => [
|
|
|
|
'fix_built_in' => true,
|
|
|
|
],
|
|
|
|
'native_function_invocation' => [
|
|
|
|
'include' => ['@all'],
|
|
|
|
],
|
|
|
|
'no_unused_imports' => true,
|
|
|
|
'ordered_imports' => [
|
|
|
|
'sort_algorithm' => 'alpha',
|
|
|
|
],
|
2019-01-26 17:54:58 +03:00
|
|
|
'single_blank_line_before_namespace' => true,
|
2018-12-04 19:24:25 +03:00
|
|
|
'strict_comparison' => true,
|
|
|
|
'strict_param' => true,
|
2019-01-26 17:54:58 +03:00
|
|
|
'whitespace_after_comma_in_array' => true,
|
2018-12-04 19:24:25 +03:00
|
|
|
];
|
|
|
|
return Config::create()
|
|
|
|
->setRules($rules)
|
|
|
|
->setFinder($finder)
|
|
|
|
->setUsingCache(false)
|
|
|
|
->setRiskyAllowed(true)
|
|
|
|
;
|