diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 05a7070..25758bb 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -2,27 +2,35 @@ declare(strict_types=1); -use Beste\PhpCsFixer\Config\RuleSet\Php81; -use Ergebnis\PhpCsFixer\Config; +$finder = PhpCsFixer\Finder::create()->in(__DIR__); -$config = Config\Factory::fromRuleSet(new Php81(), [ - 'phpdoc_line_span' => false, - 'concat_space' => [ - 'spacing' => 'none', - ], - 'final_class' => false, - 'final_internal_class' => false, - 'final_public_method_for_abstract_class' => false, - 'global_namespace_import' => [ - 'import_classes' => true, - 'import_constants' => true, - 'import_functions' => true, - ], - 'php_unit_test_case_static_method_calls' => [ - 'call_type' => 'this', - ], -]); - -$config->getFinder()->in(__DIR__); - -return $config; +return (new PhpCsFixer\Config()) + ->setRiskyAllowed(true) + ->setRules([ + '@PER-CS2.0' => true, + 'class_definition' => [ + 'single_line' => true, + ], + 'concat_space' => [ + 'spacing' => 'none', + ], + 'no_unused_imports' => true, + 'ordered_imports' => [ + 'imports_order' => [ + 'class', + 'function', + 'const', + ], + 'sort_algorithm' => 'alpha', + ], + 'php_unit_method_casing' => [ + 'case' => 'camel_case', + ], + 'php_unit_test_case_static_method_calls' => [ + 'call_type' => 'this', + 'methods' => [], + ], + 'single_line_empty_body' => false, + 'yoda_style' => false, + ]) + ->setFinder($finder); diff --git a/composer.json b/composer.json index f557242..73cfc19 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,6 @@ "psr/cache-implementation": "to cache fetched remote public keys" }, "require-dev": { - "beste/php-cs-fixer-config": "^2.4.1", "friendsofphp/php-cs-fixer": "^3.40", "phpstan/extension-installer": "^1.2", "phpstan/phpstan": "^1.9.2", diff --git a/src/JWT/Action/VerifyIdToken/WithLcobucciJWT.php b/src/JWT/Action/VerifyIdToken/WithLcobucciJWT.php index d9c8963..6caea2a 100644 --- a/src/JWT/Action/VerifyIdToken/WithLcobucciJWT.php +++ b/src/JWT/Action/VerifyIdToken/WithLcobucciJWT.php @@ -101,7 +101,7 @@ public function handle(VerifyIdToken $action): Token } } catch (RequiredConstraintsViolated $e) { $errors = array_map( - static fn (ConstraintViolation $violation): string => '- '.$violation->getMessage(), + static fn(ConstraintViolation $violation): string => '- '.$violation->getMessage(), $e->violations(), ); } diff --git a/src/JWT/Action/VerifySessionCookie/WithLcobucciJWT.php b/src/JWT/Action/VerifySessionCookie/WithLcobucciJWT.php index a5914c5..c635dca 100644 --- a/src/JWT/Action/VerifySessionCookie/WithLcobucciJWT.php +++ b/src/JWT/Action/VerifySessionCookie/WithLcobucciJWT.php @@ -100,7 +100,7 @@ public function handle(VerifySessionCookie $action): Token } } catch (RequiredConstraintsViolated $e) { $errors = array_map( - static fn (ConstraintViolation $violation): string => '- '.$violation->getMessage(), + static fn(ConstraintViolation $violation): string => '- '.$violation->getMessage(), $e->violations(), ); }