forked from andres-montanez/Magallanes
-
Notifications
You must be signed in to change notification settings - Fork 5
/
.php_cs
91 lines (79 loc) · 2.46 KB
/
.php_cs
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php
/*
* (c) 2016 by Cyberhouse GmbH
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the MIT License (MIT)
*
* For the full copyright and license information see
* <https://opensource.org/licenses/MIT>
*/
use Cyberhouse\Phpstyle\Fixer\LowerHeaderCommentFixer;
use Cyberhouse\Phpstyle\Fixer\NamespaceFirstFixer;
use Cyberhouse\Phpstyle\Fixer\SingleEmptyLineFixer;
use Symfony\CS\Config\Config;
use Symfony\CS\Finder\DefaultFinder;
use Symfony\CS\FixerInterface;
if (PHP_SAPI !== 'cli') {
die('Nope');
}
$cstart = 2016;
$cend = (int) date('Y');
$cline = (string) $cstart;
if ($cend > $cstart) {
$cline = $cstart . '-' . $cend;
}
$header = '(c) 2011-2015 Andrés Montañez <andres@andresmontanez.com>
(c) ' . $cline . ' by Cyberhouse GmbH <office@cyberhouse.at>
This is free software; you can redistribute it and/or
modify it under the terms of the MIT License (MIT)
For the full copyright and license information see
<https://opensource.org/licenses/MIT>';
LowerHeaderCommentFixer::setHeader($header);
$finder = DefaultFinder::create()
->exclude('docs')
->exclude('tests/Fixtures')
->name('/\.php$/')
->in(__DIR__);
return Config::create()
->setUsingCache(true)
->level(FixerInterface::PSR2_LEVEL)
->fixers([
'-psr0',
'encoding',
'lower_header_comment',
'namespace_first',
'remove_leading_slash_use',
'single_array_no_trailing_comma',
'ereg_to_preg',
'spaces_before_semicolon',
'unused_use',
'ordered_use',
'concat_with_spaces',
'whitespacy_lines',
'array_element_no_space_before_comma',
'double_arrow_multiline_whitespaces',
'no_blank_lines_before_namespace',
'namespace_no_leading_whitespace',
'native_function_casing',
'no_empty_lines_after_phpdocs',
'multiline_array_trailing_comma',
'spaces_cast',
'standardize_not_equal',
'align_double_arrow',
'align_equals',
'short_array_syntax',
'single_quote',
'extra_empty_lines',
'hash_to_slash_comment',
'method_argument_default_value',
'lowercase_cast',
'duplicate_semicolon',
'phpdoc_no_package',
'phpdoc_scalar',
'phpdoc_order',
])
->addCustomFixer(new LowerHeaderCommentFixer())
->addCustomFixer(new NamespaceFirstFixer())
->addCustomFixer(new SingleEmptyLineFixer())
->finder($finder);