From 73731fa9dbeb4297d3d337bafef8dfd116567142 Mon Sep 17 00:00:00 2001 From: "J. King" Date: Wed, 14 Apr 2021 11:16:36 -0400 Subject: [PATCH] Fix up CS config file --- .php-cs-fixer.dist.php | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index c276167..b545600 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -4,6 +4,7 @@ * See LICENSE and AUTHORS files for details */ declare(strict_types=1); + namespace JKingWeb\Arsse; const BASE = __DIR__.DIRECTORY_SEPARATOR; @@ -13,7 +14,10 @@ $paths = [ BASE."arsse.php", BASE."RoboFile.php", BASE."lib", - BASE."tests", + BASE."tests/cases", + BASE."tests/lib", + BASE."tests/bootstrap.php", + BASE."tests/server.php", ]; $rules = [ // house rules where PSR series is silent @@ -35,6 +39,7 @@ $rules = [ 'no_blank_lines_after_phpdoc' => true, 'no_empty_comment' => true, 'no_empty_phpdoc' => true, + 'no_empty_statement' => true, 'no_extra_blank_lines' => true, // this could probably use more configuration 'no_mixed_echo_print' => ['use' => "echo"], 'no_short_bool_cast' => true, @@ -52,22 +57,7 @@ $rules = [ '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"]], + '@PSR12' => true, // house exceptions to PSR rules 'braces' => ['position_after_functions_and_oop_constructs' => "same"], 'function_declaration' => ['closure_function_spacing' => "none"], @@ -82,4 +72,4 @@ foreach ($paths as $path) { $finder = $finder->in($path); } } -return \PhpCsFixer\Config::create()->setRiskyAllowed(true)->setRules($rules)->setFinder($finder); +return (new \PhpCsFixer\Config)->setRiskyAllowed(true)->setRules($rules)->setFinder($finder);