-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.php_cs
More file actions
47 lines (38 loc) · 1.32 KB
/
.php_cs
File metadata and controls
47 lines (38 loc) · 1.32 KB
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
/*
* Copyright (C) 2015-2018 Libre Informatique
*
* This file is licenced under the GNU LGPL v3.
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/
$header = <<<EOF
Copyright (C) 2015-%end_copy_right_year% Libre Informatique
This file is licenced under the GNU LGPL v3.
For the full copyright and license information, please view the LICENSE.md
file that was distributed with this source code.
EOF;
$header = preg_replace('/%end_copy_right_year%/', date('Y'), $header);
// PHP-CS-Fixer 1.x
if (class_exists('Symfony\CS\Fixer\Contrib\HeaderCommentFixer')) {
\Symfony\CS\Fixer\Contrib\HeaderCommentFixer::setHeader($header);
}
$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
;
$config = PhpCsFixer\Config::create()
->setRules(array(
'@Symfony' => true,
'binary_operator_spaces' => ['align_double_arrow' => true],
'concat_space' => ['spacing'=>'one'],
'yoda_style' => null,
'increment_style' => ['style' => 'post'],
))
->setFinder($finder);
// PHP-CS-Fixer 2.x
if (method_exists($config, 'setRules')) {
$config->setRules(array_merge($config->getRules(), array(
'header_comment' => array('header' => $header),
)));
}
return $config;