-
-
Notifications
You must be signed in to change notification settings - Fork 400
Expand file tree
/
Copy path.php-cs-fixer.dist.php
More file actions
33 lines (31 loc) · 1.45 KB
/
.php-cs-fixer.dist.php
File metadata and controls
33 lines (31 loc) · 1.45 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
<?php
declare(strict_types=1);
$config = new PhpCsFixer\Config();
return $config
->setRiskyAllowed(true)
->setRules([
// see https://cs.symfony.com/doc/ruleSets/PER-CS2.0.html
'@PER-CS2.0' => true,
// RISKY: Use && and || logical operators instead of and or.
'logical_operators' => true,
// RISKY: Replaces intval, floatval, doubleval, strval and boolval function calls with according type casting operator.
'modernize_types_casting' => true,
// PHP84: Adds or removes ? before single type declarations or |null at the end of union types when parameters have a default null value.
'nullable_type_declaration_for_default_null_value' => true,
// Convert double quotes to single quotes for simple strings.
'single_quote' => true,
// Arguments lists, array destructuring lists, arrays that are multi-line, match-lines and parameters lists must have a trailing comma.
// removed "match" and "parameters" for PHP7
// see https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8308
'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['arguments', 'array_destructuring', 'arrays']],
])
->setFinder(
PhpCsFixer\Finder::create()
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->name('*.php')
->ignoreDotFiles(true)
->ignoreVCS(true)
);