Skip to content

Commit f423287

Browse files
committed
PHP cs fixer JoBinsJP#23
1 parent b20b4b3 commit f423287

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ vendor
44
.phpunit.result.cache
55
composer.lock
66
.php_cs.cache
7+
.php-cs-fixer.cache

.php-cs-fixer.dist.php

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
$config = new PhpCsFixer\Config();
4+
return $config
5+
->setRiskyAllowed(true)
6+
->setRules([
7+
'@PSR12' => true, // ここにルール追記
8+
])
9+
->setFinder(
10+
PhpCsFixer\Finder::create()
11+
->exclude([
12+
'vendor'
13+
])
14+
->in(__DIR__)
15+
)
16+
;

composer.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@
3333
"test": "vendor/bin/phpunit",
3434
"psalm": "vendor/bin/psalm",
3535
"pint": "vendor/bin/pint",
36-
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
36+
"test-coverage": "vendor/bin/phpunit --coverage-html coverage",
37+
"style-check": "php-cs-fixer fix --dry-run --verbose --diff",
38+
"style-fix": "php-cs-fixer fix --verbose"
3739
},
3840
"autoload-dev": {
3941
"psr-4": {
@@ -46,7 +48,8 @@
4648
"require-dev": {
4749
"orchestra/testbench": "^6.15",
4850
"phpunit/phpunit": "^9.0",
49-
"vimeo/psalm": "^4.7"
51+
"vimeo/psalm": "^4.7",
52+
"friendsofphp/php-cs-fixer": "^3.14"
5053
},
5154
"extra": {
5255
"laravel": {

0 commit comments

Comments
 (0)