-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy path.php-cs-fixer.php
More file actions
executable file
·28 lines (22 loc) · 702 Bytes
/
.php-cs-fixer.php
File metadata and controls
executable file
·28 lines (22 loc) · 702 Bytes
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
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;
$finder = Finder::create()
->in([__DIR__, __DIR__ . DIRECTORY_SEPARATOR . 'tests']);
$rules = [
'psr_autoloading' => false,
'@PSR2' => true,
'phpdoc_order' => true,
'ordered_imports' => true,
'native_function_invocation' => [
'include' => ['@internal'],
'exclude' => ['file_put_contents']
]
];
$cacheDir = \getenv('HOME') ? \getenv('HOME') : __DIR__;
$config = new Config();
return $config->setRules($rules)
->setParallelConfig(ParallelConfigFactory::detect())
->setFinder($finder)
->setCacheFile($cacheDir . '/.php-cs-fixer.cache');