Skip to content

Commit b67bf72

Browse files
committedMar 18, 2018
update phpcs config
1 parent 4a9adbb commit b67bf72

File tree

1 file changed

+30
-25
lines changed

1 file changed

+30
-25
lines changed
 

‎.php_cs

+30-25
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,53 @@
11
<?php
22

3-
$finder = PhpCsFixer\Finder::create()
4-
->in(__DIR__.'/src')
5-
->depth('>= 1') // ignore Kernel.php (and all files in src/*.php)
6-
;
3+
// Inspired by https://github.com/jolicode/codingstyle
4+
5+
$header = <<<OEF
6+
This file is part of the appname project.
7+
8+
(c) Romain Gautier <mail@romain.sh>
9+
10+
For the full copyright and license information, please view the LICENSE
11+
file that was distributed with this source code.
12+
OEF;
713

814
return PhpCsFixer\Config::create()
915
->setRiskyAllowed(true)
1016
->setRules([
1117
'@Symfony' => true,
1218
'@Symfony:risky' => true,
13-
'array_syntax' => [
14-
'syntax' => 'short',
15-
],
16-
'braces' => [
17-
'allow_single_line_closure' => true,
18-
],
19-
'modernize_types_casting' => true,
20-
// 'native_function_invocation' => true,
19+
'header_comment' => ['header' => $header],
20+
'array_syntax' => ['syntax' => 'short'],
21+
'ordered_class_elements' => true,
22+
'ordered_imports' => true,
23+
'heredoc_to_nowdoc' => true,
24+
'php_unit_strict' => true,
25+
'php_unit_construct' => true,
26+
'phpdoc_add_missing_param_annotation' => true,
27+
'phpdoc_order' => true,
28+
'strict_comparison' => true,
29+
'strict_param' => true,
2130
'no_extra_consecutive_blank_lines' => [
2231
'break',
2332
'continue',
24-
'curly_brace_block',
2533
'extra',
26-
'parenthesis_brace_block',
2734
'return',
28-
'square_brace_block',
2935
'throw',
3036
'use',
37+
'parenthesis_brace_block',
38+
'square_brace_block',
39+
'curly_brace_block',
3140
],
41+
'no_short_echo_tag' => true,
3242
'no_unreachable_default_argument_value' => true,
3343
'no_useless_else' => true,
3444
'no_useless_return' => true,
35-
'ordered_imports' => true,
36-
// 'phpdoc_add_missing_param_annotation' => [
37-
// 'only_untyped' => false,
38-
// ],
39-
'phpdoc_order' => true,
40-
'psr4' => true,
4145
'semicolon_after_instruction' => true,
42-
'strict_comparison' => true,
43-
'strict_param' => true,
46+
'combine_consecutive_unsets' => true,
4447
'ternary_to_null_coalescing' => true,
4548
])
46-
->setFinder($finder)
47-
->setCacheFile(__DIR__.'/var/.php_cs.cache')
49+
->setFinder(
50+
PhpCsFixer\Finder::create()
51+
->in('src')
52+
)
4853
;

0 commit comments

Comments
 (0)
Please sign in to comment.