|
|
@ -16,6 +16,8 @@ $paths = [ |
|
|
|
BASE."tests", |
|
|
|
]; |
|
|
|
$rules = [ |
|
|
|
// PSR standard to apply |
|
|
|
'@PSR12' => true, |
|
|
|
// house rules where PSR series is silent |
|
|
|
'align_multiline_comment' => ['comment_type' => "phpdocs_only"], |
|
|
|
'array_syntax' => ['syntax' => "short"], |
|
|
@ -51,27 +53,15 @@ $rules = [ |
|
|
|
'trailing_comma_in_multiline' => true, |
|
|
|
'unary_operator_spaces' => true, |
|
|
|
'yoda_style' => false, |
|
|
|
// PSR standard to apply |
|
|
|
'@PSR2' => true, |
|
|
|
// PSR-12 rules; php-cs-fixer does not yet support PSR-12 natively |
|
|
|
'compact_nullable_typehint' => true, |
|
|
|
'declare_equal_normalize' => ['space' => "none"], |
|
|
|
'function_typehint_space' => true, |
|
|
|
'lowercase_cast' => true, |
|
|
|
'lowercase_static_reference' => true, |
|
|
|
'no_alternative_syntax' => true, |
|
|
|
'no_empty_statement' => true, |
|
|
|
'no_leading_import_slash' => true, |
|
|
|
'no_leading_namespace_whitespace' => true, |
|
|
|
'no_whitespace_in_blank_line' => true, |
|
|
|
'return_type_declaration' => ['space_before' => "none"], |
|
|
|
'single_trait_insert_per_statement' => true, |
|
|
|
'short_scalar_cast' => true, |
|
|
|
'visibility_required' => ['elements' => ["const", "property", "method"]], |
|
|
|
// house exceptions to PSR rules |
|
|
|
'braces' => ['position_after_functions_and_oop_constructs' => "same"], |
|
|
|
'function_declaration' => ['closure_function_spacing' => "none"], |
|
|
|
'new_with_braces' => false, // no option to specify absence of braces |
|
|
|
'new_with_braces' => [ |
|
|
|
'anonymous_class' => false, |
|
|
|
'named_class' => false, |
|
|
|
], |
|
|
|
'single_blank_line_before_namespace' => false, |
|
|
|
'blank_line_after_opening_tag' => false, |
|
|
|
]; |
|
|
|
|
|
|
|
$finder = \PhpCsFixer\Finder::create(); |
|
|
|