This repository has been archived by the owner on Sep 20, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.php-cs-fixer.php
84 lines (73 loc) · 2.71 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
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
<?php
/**
* 🚀 A WordPress plugin that focuses on minimizing payload size of HTML document
* and optimizing processing on the browser when rendering the WordPress page.
* (c) 2021-2024 SHIN Company <[email protected]>
*
* PHP Version >=7.2
*
* @category Web_Performance_Optimization
* @package defer-wordpress
* @author Mai Nhut Tan <[email protected]>
* @copyright 2021-2024 SHIN Company
* @license https://code.shin.company/defer-wordpress/blob/master/LICENSE GPL-2.0
* @link https://code.shin.company/defer-wordpress
* @see https://code.shin.company/defer-wordpress/blob/master/README.md
*/
$header = <<<'EOF'
🚀 A WordPress plugin that focuses on minimizing payload size of HTML document
and optimizing processing on the browser when rendering the WordPress page.
(c) 2021-2024 SHIN Company <[email protected]>
PHP Version >=7.2
@category Web_Performance_Optimization
@package defer-wordpress
@author Mai Nhut Tan <[email protected]>
@copyright 2021-2024 SHIN Company
@license https://code.shin.company/defer-wordpress/blob/master/LICENSE GPL-2.0
@link https://code.shin.company/defer-wordpress
@see https://code.shin.company/defer-wordpress/blob/master/README.md
EOF;
$rules = [
'@PhpCsFixer' => true,
'concat_space' => ['spacing' => 'one'],
'header_comment' => ['header' => $header, 'comment_type' => 'PHPDoc'],
'increment_style' => ['style' => 'post'],
'no_superfluous_phpdoc_tags' => false,
'phpdoc_summary' => true,
'phpdoc_to_comment' => false,
'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
'multiline_whitespace_before_semicolons' => [
'strategy' => 'no_multi_line',
],
'phpdoc_align' => ['align' => 'vertical'],
'binary_operator_spaces' => [
'default' => 'single_space',
'operators' => [
'||' => 'align_single_space_minimal',
'or' => 'align_single_space_minimal',
'=' => 'align_single_space_minimal',
'=>' => 'align_single_space_minimal',
'<=>' => 'align_single_space_minimal',
],
],
'visibility_required' => [
'elements' => ['method', 'property'],
],
];
$finder = \PhpCsFixer\Finder::create()
->in(__DIR__)
->name('*.php')
->exclude('.dist')
->exclude('.docker')
->exclude('.github')
->exclude('cache')
->exclude('node_modules')
->exclude('vendor')
->ignoreDotFiles(false)
->ignoreVCS(true);
return (new \PhpCsFixer\Config())
->setFinder($finder)
->setRules($rules)
->setIndent(' ')
->setLineEnding("\n")
->setUsingCache(false);