-
-
Notifications
You must be signed in to change notification settings - Fork 25
/
.php-cs-fixer.php
51 lines (43 loc) · 1.5 KB
/
.php-cs-fixer.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
declare(strict_types=1);
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;
$rules = [
// Default
'@PHP80Migration' => true,
'@PHP80Migration:risky' => true,
'@Symfony' => true,
'@Symfony:risky' => true,
// Override of the Symfony config
'class_attributes_separation' => [
'elements' => ['method' => 'one', 'property' => 'one'],
], // Instead of ['elements' => ['method' => 'one']]
'error_suppression' => false, // For testing purpose
'no_trailing_whitespace_in_string' => false, // For string comparison in tests
'operator_linebreak' => true, // Instead of ['only_booleans' => true]
'phpdoc_to_comment' => [
'ignored_tags' => ['phpstan-var', 'psalm-suppress'],
],
'single_line_throw' => false,
// Added
'explicit_string_variable' => true,
'general_phpdoc_annotation_remove' => [
'annotations' => ['author', 'since', 'package', 'subpackage'],
],
'header_comment' => ['header' => ''],
'no_superfluous_elseif' => true,
'no_useless_else' => true,
'php_unit_test_case_static_method_calls' => true,
'phpdoc_add_missing_param_annotation' => true,
'phpdoc_no_empty_return' => true,
];
$finder = Finder::create()->in(__DIR__)->ignoreDotFiles(false);
$config = new Config();
$config
->setParallelConfig(ParallelConfigFactory::detect())
->setFinder($finder)
->setRiskyAllowed(true)
->setRules($rules)
->setUsingCache(true);
return $config;