Skip to content

Commit 2d49488

Browse files
author
Jovert Lota Palonpon
committed
[Php Code Formatting] Initial Setup
1 parent 56ccf36 commit 2d49488

File tree

4 files changed

+489
-1
lines changed

4 files changed

+489
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.php_cs.cache
12
dump.sql
23
nginx.conf
34
/node_modules

.php_cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
<?php
3+
4+
$finder = Symfony\Component\Finder\Finder::create()
5+
->notPath('vendor')
6+
->notPath('bootstrap')
7+
->notPath('storage')
8+
->in(__DIR__)
9+
->name('*.php')
10+
->notName('*.blade.php');
11+
12+
return PhpCsFixer\Config::create()
13+
->setRules([
14+
'@PSR2' => true,
15+
'array_syntax' => ['syntax' => 'short'],
16+
'ordered_imports' => ['sortAlgorithm' => 'alpha'],
17+
'no_unused_imports' => true,
18+
])
19+
->setFinder($finder);

composer.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"beyondcode/laravel-dump-server": "^1.0",
2222
"codedungeon/phpunit-result-printer": "^0.26.1",
2323
"filp/whoops": "^2.0",
24+
"friendsofphp/php-cs-fixer": "^2.14",
2425
"mockery/mockery": "^1.0",
2526
"nunomaduro/collision": "^3.0",
2627
"phpunit/phpunit": "^7.5"
@@ -48,6 +49,9 @@
4849
}
4950
},
5051
"scripts": {
52+
"format": [
53+
"vendor/bin/php-cs-fixer fix ."
54+
],
5155
"post-root-package-install": [
5256
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
5357
],

0 commit comments

Comments
 (0)