How can I suppress PHPCS warnings using comments?

后端 未结 4 1761
没有蜡笔的小新
没有蜡笔的小新 2021-02-01 01:00

My TestMyClass.php has two class definitions in the same file (unit testing class), and PHP Code Sniffer complains about each class must be in a file by itself<

4条回答
  •  -上瘾入骨i
    2021-02-01 01:16

    The @codingStandards syntax is deprecated as of version 3.2.0, use phpcs instead.

    Some examples:

    // phpcs:disable
    // phpcs:ignore
    // phpcs:enable
    

    See this page for more information: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#ignoring-parts-of-a-file

提交回复
热议问题