Skip to content

Commit 833a5d5

Browse files
committed
0 parents  commit 833a5d5

File tree

5 files changed

+132
-0
lines changed

5 files changed

+132
-0
lines changed

.phpcs.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0"?>
2+
<ruleset>
3+
<rule ref="Generic.WhiteSpace.LanguageConstructSpacing" />
4+
</ruleset>

composer.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"require-dev": {
3+
"squizlabs/php_codesniffer": "^3.10"
4+
},
5+
"scripts": {
6+
"phpcs": "phpcs -s --report-width=95 demo.php",
7+
"demo": "composer run phpcs | grep -v Time: | diff -u - expected.txt"
8+
}
9+
}

composer.lock

Lines changed: 99 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php
2+
function a() {
3+
echo 1;
4+
return
5+
1;
6+
};

expected.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
FILE: C:\Users\a\AppData\Local\Temp\phpcs-demo\demo.php
3+
-----------------------------------------------------------------------------------------------
4+
FOUND 2 ERRORS AFFECTING 2 LINES
5+
-----------------------------------------------------------------------------------------------
6+
3 | ERROR | [x] Language constructs must be followed by a single space; expected 1 space but
7+
| | found " " (Generic.WhiteSpace.LanguageConstructSpacing.IncorrectSingle)
8+
4 | ERROR | [x] Language constructs must be followed by a single space; expected 1 space but
9+
| | found "\n" (Generic.WhiteSpace.LanguageConstructSpacing.IncorrectSingle)
10+
-----------------------------------------------------------------------------------------------
11+
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
12+
-----------------------------------------------------------------------------------------------
13+
14+

0 commit comments

Comments
 (0)