LoginSignup
0
0

phpcsのバツ[x]の意味

Last updated at Posted at 2023-08-29

phpcbfが自動で修正できるスニフを表すみたいです

$ phpcs -s /path/to/code/myfile.php

FILE: /path/to/code/classA.php
--------------------------------------------------------------------------------
FOUND 4 ERRORS AND 1 WARNING AFFECTING 5 LINES
--------------------------------------------------------------------------------
  2 | ERROR   | [ ] Missing file doc comment
    |         |     (PEAR.Commenting.FileComment.Missing)
  4 | ERROR   | [x] TRUE, FALSE and NULL must be lowercase; expected "false" but
    |         |     found "FALSE" (Generic.PHP.LowerCaseConstant.Found)
  6 | ERROR   | [x] Line indented incorrectly; expected at least 4 spaces, found
    |         |     1 (PEAR.WhiteSpace.ScopeIndent.Incorrect)
  9 | ERROR   | [ ] Missing function doc comment
    |         |     (PEAR.Commenting.FunctionComment.Missing)
 11 | WARNING | [x] Inline control structures are discouraged
    |         |     (Generic.ControlStructures.InlineControlStructure.Discouraged)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

$ phpcs -s --report=summary /path/to/code

PHP CODE SNIFFER REPORT SUMMARY
--------------------------------------------------------------------------------
FILE                                                            ERRORS  WARNINGS
--------------------------------------------------------------------------------
/path/to/code/classA.inc                                        5       0
/path/to/code/classB.inc                                        1       1
/path/to/code/classC.inc                                        0       2
--------------------------------------------------------------------------------
A TOTAL OF 6 ERROR(S) AND 3 WARNING(S) WERE FOUND IN 3 FILE(S)
--------------------------------------------------------------------------------

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0