-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy path.php-cs-fixer.dist.php
More file actions
52 lines (47 loc) · 1.77 KB
/
.php-cs-fixer.dist.php
File metadata and controls
52 lines (47 loc) · 1.77 KB
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
52
<?php
/**
* PHP CS Fixer documentation:
* - Homepage: https://cs.symfony.com/
* - List of all available rules: https://cs.symfony.com/doc/rules/index.html
* - List of all available rule sets: https://cs.symfony.com/doc/ruleSets/index.html
* - Find / Compare / See History rules: https://mlocati.github.io/php-cs-fixer-configurator
*
* To inspect a specific rule (e.g. `blank_line_before_statement`), run:
*
* ```console
* > php-cs-fixer describe blank_line_before_statement
* ```
*
* ------------------------------------------------------------------------------
*
* `new \PhpCsFixer\Finder()` is equivalent to:
*
* ```php
* \Symfony\Component\Finder\Finder::create()
* ->files()
* ->name('/\.php$/')
* ->exclude('vendor')
* ->ignoreVCSIgnored(true) // Follow rules establish in .gitignore
* ->ignoreDotFiles(false) // Do not ignore files starting with `.`, like `.php-cs-fixer-dist.php`
* ;
* ```
*/
$finder = (new PhpCsFixer\Finder())
->in(__DIR__)
->ignoreDotFiles(false)
;
return (new PhpCsFixer\Config())
->setRules([
'@Symfony' => true,
// [Symfony] defaults to `camelCase`, we set it to `snake_case` (phpspec style)
'php_unit_method_casing' => ['case' => 'snake_case'],
// [Symfony] defaults to `['elements' => ['const', 'method', 'property']]`
// We exclude `method` for phpspec (no visibility keyword)
// We exclude `const` because we support PHP 8.0 (const visibility is optional)
'modifier_keywords' => ['elements' => ['property']],
// [Symfony] defaults to `['elements' => ['arguments', 'arrays', 'parameters']]`
'trailing_comma_in_multiline' => ['elements' => ['arguments', 'arrays', 'parameters']],
])
->setUsingCache(true)
->setFinder($finder)
;