-
Notifications
You must be signed in to change notification settings - Fork 0
/
.php-cs-fixer.dist.php
36 lines (34 loc) · 2.12 KB
/
.php-cs-fixer.dist.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
<?php
$finder = PhpCsFixer\Finder::create()
->in(['src', 'test']);
$config = new PhpCsFixer\Config();
return $config
->setFinder($finder)
->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'fully_qualified_strict_types' => true, // Transforms imported FQCN parameters and return types in function arguments to short version.
'dir_constant' => true, // Replaces dirname(__FILE__) expression with equivalent __DIR__ constant.
'heredoc_to_nowdoc' => true,
'linebreak_after_opening_tag' => true, // Ensure there is no code on the same line as the PHP open tag.
'modernize_types_casting' => true, // Replaces intval, floatval, doubleval, strval and boolval function calls with according type casting operator.
'multiline_whitespace_before_semicolons' => true, // Forbid multi-line whitespace before the closing semicolon or move the semicolon to the new line for chained calls.
'no_unreachable_default_argument_value' => true, // In function arguments there must not be arguments with default values before non-default ones.
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_class_elements' => true, // Orders the elements of classes/interfaces/traits.
'ordered_imports' => true,
'phpdoc_add_missing_param_annotation' => ['only_untyped' => true], // PHPDoc should contain @param for all params (for untyped parameters only).
'phpdoc_order' => true, // Annotations in PHPDoc should be ordered so that @param annotations come first, then @throws annotations, then @return annotations.
'declare_strict_types' => true,
'no_php4_constructor' => true, // Convert PHP4-style constructors to __construct.
'semicolon_after_instruction' => true,
'align_multiline_comment' => true,
'general_phpdoc_annotation_remove' => ['annotations' => ['author', 'package']],
'list_syntax' => ['syntax' => 'short'],
'phpdoc_to_comment' => false,
'php_unit_method_casing' => ['case' => 'snake_case'],
])
;