This repository has been archived by the owner on Dec 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.php-cs-fixer.dist.php
47 lines (46 loc) · 1.67 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
37
38
39
40
41
42
43
44
45
46
47
<?php
$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude('config')
->exclude('var')
->exclude('public/bundles')
->exclude('public/build')
// exclude files generated by Symfony Flex recipes
->notPath('bin/console')
->notPath('public/index.php')
;
// https://cs.symfony.com/doc/rules/
return (new PhpCsFixer\Config)
->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
'@Symfony:risky' => true,
'array_syntax' => ['syntax' => 'short'],
'blank_line_after_opening_tag' => false,
'blank_lines_before_namespace' => false,
'linebreak_after_opening_tag' => true,
'lowercase_cast' => false,
'mb_str_functions' => true,
'native_function_invocation' => false,
'native_constant_invocation' => false,
'new_with_braces' => false,
'new_with_parentheses' => false,
'no_php4_constructor' => true,
'no_unreachable_default_argument_value' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'nullable_type_declaration_for_default_null_value' => true,
'ordered_class_elements' => [], // Remove 'use_trait'
'ordered_imports' => true,
'phpdoc_summary' => false, // In comments: add useless "." at ending and make urls in error
'php_unit_strict' => true,
'phpdoc_order' => true,
'semicolon_after_instruction' => true,
'single_import_per_statement' => false,
'single_trait_insert_per_statement' => false,
'strict_comparison' => true,
'strict_param' => true,
])
->setFinder($finder)
->setCacheFile(__DIR__.'/var/cache/.php_cs.cache')
;