Skip to content

Commit f38869a

Browse files
committed
Adding php codesniffer and config
1 parent 8d5066b commit f38869a

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

Diff for: .php_cs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
$finder = PhpCsFixer\Finder::create()
4+
->in(__DIR__ . '/app')
5+
->in(__DIR__ . '/database/migrations')
6+
;
7+
8+
return PhpCsFixer\Config::create()
9+
->setUsingCache(false)
10+
->setRules([
11+
'@PSR2' => true,
12+
'concat_space' => ['spacing' => 'one'],
13+
'cast_spaces' => ['space' => 'single'],
14+
'no_unused_imports' => true,
15+
'blank_line_before_statement' => true,
16+
'trailing_comma_in_multiline_array' => true,
17+
'single_quote' => true
18+
])
19+
->setFinder($finder)
20+
;

Diff for: Makefile

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
THIS := $(realpath $(lastword $(MAKEFILE_LIST)))
2+
HERE := $(shell dirname $(THIS))
3+
4+
.PHONY: fix lint test
5+
6+
fix:
7+
$(HERE)/vendor/bin/php-cs-fixer fix --config=$(HERE)/.php_cs
8+
9+
lint:
10+
$(HERE)/vendor/bin/php-cs-fixer fix --config=$(HERE)/.php_cs --dry-run
11+
12+
test: lint

0 commit comments

Comments
 (0)