-
Notifications
You must be signed in to change notification settings - Fork 0
/
.php_cs.dist
64 lines (57 loc) · 2.17 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
declare(strict_types=1);
/*
* This file is part of the dotfiles project.
*
* (c) Anthonius Munthi <me@itstoni.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
$header = <<<'EOF'
This file is part of the dotfiles project.
(c) Anthonius Munthi <me@itstoni.com>
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
EOF;
if (!file_exists(__DIR__.'/src')) {
exit(0);
}
return PhpCsFixer\Config::create()
->setRules(array(
'@Symfony' => true,
'@Symfony:risky' => true,
'@PHPUnit60Migration:risky' => true,
'php_unit_no_expectation_annotation' => false, // part of `PHPUnitXYMigration:risky` ruleset, to be enabled when PHPUnit 4.x support will be dropped, as we don't want to rewrite exceptions handling twice
'array_syntax' => array('syntax' => 'long'),
'protected_to_private' => false,
'@PSR1' => true,
'@PSR2' => true,
'@PHP71Migration' => true,
'@PHP71Migration:risky' => true,
'ordered_imports' => array('sortAlgorithm' => 'alpha'),
'header_comment' => array('header' => $header),
'heredoc_to_nowdoc' => true,
'ordered_class_elements' => array('sortAlgorithm' => 'alpha'),
'method_separation' => true,
'no_extra_blank_lines' => array('tokens' => array('break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block')),
'blank_line_before_statement' => true,
))
->setRiskyAllowed(true)
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__.'/src')
->append(array(
__FILE__,
__DIR__.'/bin/compile',
__DIR__.'/bin/dotfiles',
))
->exclude(array(
// directories containing files with content that is autogenerated by `var_export`, which breaks CS in output code
'Resources',
'Spec',
'fixtures',
))
->notName('Constant.php')
)
;