-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.php-cs-fixer.php
executable file
·54 lines (49 loc) · 1.37 KB
/
.php-cs-fixer.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
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
<?php
declare(strict_types=1);
$finder = Symfony\Component\Finder\Finder::create()
->notPath('vendor')
->notPath('runtime')
->notPath('mail')
->notPath('.docker')
->notPath('.github')
->notPath('.environment')
->notPath('.docker')
->notPath('.tevun')
->notPath('database')
->notPath('storage')
->notPath('src/@core')
->in(__DIR__)
->name('*.php');
$config = new PhpCsFixer\Config();
$config
->setUsingCache(true)
->setCacheFile(__DIR__ . '/.php_cs.cache')
->setFinder($finder)
->setRiskyAllowed(true)
->setRules([
'@PSR12' => true,
'psr_autoloading' => true,
'declare_strict_types' => true,
'linebreak_after_opening_tag' => true,
'blank_line_after_opening_tag' => true,
'no_unused_imports' => true,
'new_with_braces' => true,
'type_declaration_spaces' => [
'elements' => ['function', 'property']
],
'array_syntax' => [
'syntax' => 'short'
],
'blank_line_before_statement' => [
'statements' => ['declare'],
],
'ordered_imports' => [
'sort_algorithm' => 'length'
],
'global_namespace_import' => [
'import_classes' => true,
'import_functions' => false,
'import_constants' => false,
]
]);
return $config;