Update PHP-CS-Fixer to PER coding standard
authorTim Düsterhus <tim@bastelstu.be>
Wed, 21 Sep 2022 14:44:36 +0000 (16:44 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 21 Sep 2022 14:59:32 +0000 (16:59 +0200)
.php-cs-fixer.dist.php

index 0e683164c4461382aabd37ed79a83ee378bd32ed..574d52f14c2d412ce7c033e76d0203ac5858737e 100644 (file)
@@ -8,6 +8,8 @@ return (new PhpCsFixer\Config())
     ->setRules([
         '@PSR1' => true,
         '@PSR2' => true,
+        '@PSR12' => true,
+        '@PER' => true,
 
         'array_push' => true,
         'backtick_to_shell_exec' => true,
@@ -25,23 +27,18 @@ return (new PhpCsFixer\Config())
 
         'non_printable_character' => ['use_escape_sequences_in_strings' => true],
 
-        'lowercase_static_reference' => true,
         'magic_constant_casing' => true,
         'magic_method_casing' => true,
         'native_function_casing' => true,
         'native_function_type_declaration_casing' => true,
 
         'cast_spaces' => ['space' => 'none'],
-        'lowercase_cast' => true,
         'no_unset_cast' => true,
-        'short_scalar_cast' => true,
 
         'class_attributes_separation' => true,
-        'no_blank_lines_after_class_opening' => true,
         'no_null_property_initialization' => true,
         'self_accessor' => true,
         'single_class_element_per_statement' => true,
-        'single_trait_insert_per_statement' => true,
 
         'no_empty_comment' => true,
         'single_line_comment_style' => ['comment_types' => ['hash']],
@@ -60,15 +57,12 @@ return (new PhpCsFixer\Config())
         'native_function_invocation' => ['include' => ['@internal']],
         'no_unreachable_default_argument_value' => true,
         'nullable_type_declaration_for_default_null_value' => true,
-        'return_type_declaration' => true,
         'static_lambda' => true,
 
         'fully_qualified_strict_types' => true,
-        'no_leading_import_slash' => true,
         'no_unused_imports' => true,
         'ordered_imports' => true,
 
-        'declare_equal_normalize' => true,
         'dir_constant' => true,
         'explicit_indirect_variable' => true,
         'function_to_constant' => true,
@@ -79,7 +73,6 @@ return (new PhpCsFixer\Config())
 
         'clean_namespace' => true,
         'no_leading_namespace_whitespace' => true,
-        'single_blank_line_before_namespace' => true,
 
         'no_homoglyph_names' => true,
 
@@ -91,7 +84,6 @@ return (new PhpCsFixer\Config())
         'operator_linebreak' => true,
         'standardize_increment' => true,
         'standardize_not_equals' => true,
-        'ternary_operator_spaces' => true,
         'ternary_to_elvis_operator' => true,
         'ternary_to_null_coalescing' => true,
         'unary_operator_spaces' => true,
@@ -112,7 +104,6 @@ return (new PhpCsFixer\Config())
 
         'array_indentation' => true,
         'blank_line_before_statement' => ['statements' => ['return', 'exit']],
-        'compact_nullable_typehint' => true,
         'method_chaining_indentation' => true,
         'no_extra_blank_lines' => ['tokens' => ['case', 'continue', 'curly_brace_block', 'default', 'extra', 'parenthesis_brace_block', 'square_brace_block', 'switch', 'throw', 'use']],
         'no_spaces_around_offset' => true,