When executing PHPCS, it prompts the analysis of File: Found 1 Error Affecting 1 Line
1. PHP_CodeSniffer marks PHP, JavaScript and CSS files to detect and repair violations of a set of defined encoding standards. When executing PHPCS, you will be prompted for the analysis of File: Found 1 Error Affecting 1 Line. as shown in Figure 1
PS E:\wwwroot\object> phpcs --standard=PSR1,PSR2,./ruleset.xml --ignore=config/us-zipcode.php app/ routes/ config/
FILE: ...root\object\app\Http\Controllers\CheckoutsController.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
182 | ERROR | [x] Each PHP statement must be on a line by itself
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
FILE: E:\wwwroot\object\app\Services\ThemeService.php
----------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
66 | ERROR | [x] Line indented incorrectly; expected 8 spaces,
| | found 12
66 | ERROR | [x] Closing brace indented incorrectly; expected 8
| | spaces, found 12
128 | ERROR | [x] Function closing brace must go on the next line
| | following the body; found 1 blank lines before
| | brace
----------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
Time: 56.87 secs; Memory: 66MB
PS E:\wwwroot\object>
2. First confirm the first file, on line 182, there is ;; , you need to delete a ;. as shown in Figure 2
3. Reconfirm the second file, on lines 66 and 128 respectively. In line 66, the line indentation is incorrect; it is expected that 8 spaces are expected, and 12 are found. At line 128, the curly braces of the function must be in the next line of the body; find 1 blank line before the braces. At line 66, the code can be formatted via the IDE. as shown in Figure 3
4. When executing phpcs, no longer prompt. as shown in Figure 4



