This repository has been archived by the owner on Jan 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
.php_cs.dist
69 lines (64 loc) · 2.99 KB
/
.php_cs.dist
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
<?php
/**
* Penjelasan contoh Config: https://mlocati.github.io/php-cs-fixer-configurator/#version:2.15
*/
$header = <<<'EOF'
@author walangkaji (https://github.com/walangkaji)
EOF;
$config = PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
'@PSR1' => true,
'@PSR2' => true,
'psr4' => true,
'array_indentation' => true,
'indentation_type' => true,
'single_quote' => true,
'concat_space' => ['spacing' => 'one'],
'cast_spaces' => ['space' => 'single'],
'declare_equal_normalize' => ['space' => 'single'],
'binary_operator_spaces' => ['default' => 'align'],
'array_syntax' => ['syntax' => 'short'],
'align_multiline_comment' => ['comment_type' => 'phpdocs_like'],
'blank_line_after_opening_tag' => true,
'blank_line_before_statement' => ['statements' => ['return']],
'no_singleline_whitespace_before_semicolons' => true,
'no_spaces_around_offset' => true,
'no_unused_imports' => true,
'no_whitespace_before_comma_in_array' => true,
'no_whitespace_in_blank_line' => true,
'phpdoc_add_missing_param_annotation' => true,
'phpdoc_align' => true,
'phpdoc_annotation_without_dot' => true,
'phpdoc_order' => true,
'phpdoc_scalar' => true,
'phpdoc_separation' => true,
'single_blank_line_before_namespace' => true,
'single_line_comment_style' => true,
'space_after_semicolon' => true,
'ternary_operator_spaces' => true,
'trim_array_spaces' => true,
'header_comment' => [
'commentType' => 'PHPDoc',
'header' => $header,
'location' => 'after_open',
'separate' => 'bottom',
],
])
->setFinder(
PhpCsFixer\Finder::create()
->exclude('vendor')
->in(__DIR__)
)
->setUsingCache(false);
// try {
// PhpCsFixer\FixerFactory::create()
// ->registerBuiltInFixers()
// ->registerCustomFixers($config->getCustomFixers())
// ->useRuleSet(new PhpCsFixer\RuleSet($config->getRules()));
// } catch (PhpCsFixer\ConfigurationException\InvalidConfigurationException $e) {
// $config->setRules([]);
// } catch (UnexpectedValueException $e) {
// $config->setRules([]);
// }
return $config;