-
Notifications
You must be signed in to change notification settings - Fork 0
/
.php_cs.dist
41 lines (39 loc) · 2.25 KB
/
.php_cs.dist
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
<?php
$finder = PhpCsFixer\Finder::create()
->in('lib')
->in('tests')
;
return PhpCsFixer\Config::create()
->setFinder($finder)
->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
'@Symfony:risky' => true,
'@PHP71Migration:risky' => true,
'@PHP73Migration' => true,
'@PSR2' => true,
'@DoctrineAnnotation' => 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' => false], // 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,
'psr4' => true, // Class names should match the file name.
'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
])
;