-
Notifications
You must be signed in to change notification settings - Fork 0
/
.php_cs.dist.php
29 lines (27 loc) · 950 Bytes
/
.php_cs.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
<?php
$finder = \PhpCsFixer\Finder::create()
//Search for files in the current directory
->in([__DIR__])
//Exclude the vendor folder, and any folder beginning with a dot
->exclude(['vendor', '.*']);
$config = (new \PhpCsFixer\Config('mlambley'))
//Risky rules include things like changing != to !== which would be disastrous
->setRiskyAllowed(false)
//On windows machines, setting line endings to \r\n assumes that git.config.autocrlf = true
//If git preserves \n on checkout, then this should be changed to \n
->setLineEnding(PHP_EOL)
->setRules([
//Includes PSR1
'@PSR2' => true,
'no_blank_lines_before_namespace' => true,
])
//The cache file should be gitignored
->setCacheFile('.php_cs.cache')
->setFinder($finder)
->setFormat('txt')
->setHideProgress(false)
->setIndent(' ')
->setPhpExecutable(null)
->setUsingCache(true)
;
return $config;