Skip to content

Commit

Permalink
Update PHP CS Fixer config to use PER CS 2.0 with modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromegamez committed Oct 10, 2023
1 parent a0f92d8 commit cf81cc8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 31 deletions.
51 changes: 21 additions & 30 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,26 @@

declare(strict_types=1);

use Beste\PhpCsFixer\Config\Factory;
use Beste\PhpCsFixer\Config\RuleSet\Php81;
$finder = PhpCsFixer\Finder::create()->in(__DIR__);

$config = Factory::fromRuleSet(new Php81(), [
'final_class' => false,
'final_internal_class' => false,
'global_namespace_import' => [
'import_classes' => true,
'import_constants' => true,
'import_functions' => true,
],
'php_unit_method_casing' => [
'case' => 'camel_case',
],
'php_unit_test_case_static_method_calls' => [
'call_type' => 'this',
'methods' => [],
],
'php_unit_test_class_requires_covers' => false,
'yoda_style' => false,
]);

$config
->getFinder()
->in([
'src',
'tests',
return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setRules([
'@PER-CS2.0' => true,
'class_definition' => [
'single_line' => true,
],
'concat_space' => [
'spacing' => 'none',
],
'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,
])
->ignoreDotFiles(false)
;

return $config;
->setFinder($finder);
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"psr/log": "^1.1|^2.0|^3.0"
},
"require-dev": {
"beste/php-cs-fixer-config": "^2.3",
"friendsofphp/php-cs-fixer": "^3.34.1",
"google/cloud-firestore": "^1.37.3",
"phpstan/extension-installer": "^1.3.1",
Expand Down

0 comments on commit cf81cc8

Please sign in to comment.