Skip to content

Commit caea458

Browse files
authored
Merge pull request #19 from QuorumCollection/dependabot/composer/friendsofphp/php-cs-fixer-tw-3.95
Update friendsofphp/php-cs-fixer requirement from ^2.17 to ^3.95, add php-cs-fixer dry-run to test, and modernize php-cs-fixer config
2 parents d16fe08 + ab57146 commit caea458

3 files changed

Lines changed: 17 additions & 9 deletions

File tree

.php_cs renamed to .php-cs-fixer.dist.php

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
->files()
55
->in(__DIR__ . '/src')
66
->in(__DIR__ . '/test')
7+
->in(__DIR__ . '/example')
78
->name('*.php');
89

910

10-
return PhpCsFixer\Config::create()
11+
return (new PhpCsFixer\Config)
1112
->setUsingCache(true)
1213
->setIndent("\t")
1314
->setLineEnding("\n")
@@ -103,7 +104,7 @@
103104
],
104105

105106
'blank_line_before_statement' => [
106-
'statements' => [ 'continue', 'try', 'switch', 'die', 'exit', 'throw', 'return', 'yield', 'do' ],
107+
'statements' => [ 'continue', 'try', 'switch', 'exit', 'throw', 'return', 'yield', 'do' ],
107108
],
108109

109110
'no_superfluous_phpdoc_tags' => [
@@ -113,8 +114,6 @@
113114

114115
'no_useless_else' => true,
115116

116-
'compact_nullable_typehint' => true,
117-
118117
'combine_consecutive_issets' => true,
119118
'escape_implicit_backslashes' => true,
120119
'explicit_indirect_variable' => true,
@@ -140,6 +139,7 @@
140139

141140
'method_chaining_indentation' => true,
142141
'method_argument_space' => [
142+
'on_multiline' => 'ignore',
143143
'keep_multiple_spaces_after_comma' => true,
144144
],
145145

@@ -156,10 +156,14 @@
156156
'import_functions' => false,
157157
],
158158

159-
'trailing_comma_in_multiline_array' => true,
159+
'trailing_comma_in_multiline' => true,
160160
'single_line_comment_style' => true,
161+
162+
'is_null' => true,
163+
'yoda_style' => [
164+
'equal' => false,
165+
'identical' => false,
166+
],
161167
]
162168
)
163169
->setFinder($finder);
164-
165-

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@ fix: cbf
1111
phpstan:
1212
vendor/bin/phpstan --memory-limit=2G
1313

14+
.PHONY: php-cs-fixer
15+
php-cs-fixer:
16+
vendor/bin/php-cs-fixer fix --dry-run --diff
17+
1418
.PHONY: test
15-
test: cs phpstan
19+
test: cs php-cs-fixer phpstan
1620
vendor/bin/phpunit
1721

1822
.PHONY: cs

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"phpunit/phpunit": "~8.5 | ~9.5",
1010
"squizlabs/php_codesniffer": "^3.5",
1111
"corpus/coding-standard": "~0.6.0",
12-
"friendsofphp/php-cs-fixer": "^2.17",
12+
"friendsofphp/php-cs-fixer": "^3.95",
1313
"phpstan/phpstan": "^2.2"
1414
},
1515
"license": "MIT",

0 commit comments

Comments
 (0)