Skip to content

Commit 86f2325

Browse files
committed
Introduce squizlabs/php_codesniffer
Signed-off-by: Jack Cherng <jfcherng@gmail.com>
1 parent ff2325d commit 86f2325

File tree

3 files changed

+74
-3
lines changed

3 files changed

+74
-3
lines changed

composer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
"require": {
2727
"php": "^7.1.3",
2828
"jfcherng/php-mb-string": "^1.3",
29-
"jfcherng/php-sequence-matcher": "^2.0"
29+
"jfcherng/php-sequence-matcher": "^2.0",
30+
"squizlabs/php_codesniffer": "^3.4"
3031
},
3132
"require-dev": {
3233
"friendsofphp/php-cs-fixer": "^2.14.1",
@@ -38,7 +39,8 @@
3839
},
3940
"scripts": {
4041
"analyze": [
41-
"phan --color"
42+
"phan --color",
43+
"phpcs --colors -n"
4244
],
4345
"fix": [
4446
"php-cs-fixer fix --verbose"

composer.lock

Lines changed: 52 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpcs.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<ruleset name="php-diff">
3+
<description>php-diff</description>
4+
5+
<!-- <arg name="report" value="summary" /> -->
6+
<!-- <arg name="colors" /> -->
7+
<arg value="sp" />
8+
9+
<file>./src/</file>
10+
11+
<exclude-pattern>*/tests/*</exclude-pattern>
12+
13+
<rule ref="PSR1" />
14+
<rule ref="PSR2">
15+
<!-- hmm... multiline IF statement -->
16+
<exclude name="PSR2.ControlStructures.ControlStructureSpacing.SpacingAfterOpenBrace" />
17+
</rule>
18+
</ruleset>

0 commit comments

Comments
 (0)