54

によって分析されると、php ファイルのコードの一部を無視することができますPHP_CodeSniffer

4

3 に答える 3

84

はい、 @codingStandardsIgnoreStart および @codingStandardsIgnoreEnd アノテーションで可能です

<?php
some_code();
// @codingStandardsIgnoreStart
this_will_be_ignored();
// @codingStandardsIgnoreEnd
some_other_code();

ドキュメントにも記載されています。

于 2010-11-29T18:29:43.777 に答える
34

@codingStandardsIgnoreStartとの組み合わせを使用することも、 を使用することも@codingStandardsIgnoreEndできます@codingStandardsIgnoreLine

例:

<?php

command1();
// @codingStandardsIgnoreStart
command2(); // this line will be ignored by Codesniffer
command3(); // this one too
command4(); // this one too
// @codingStandardsIgnoreEnd

command6();

// @codingStandardsIgnoreLine
command7(); // this line will be ignored by Codesniffer
于 2015-06-10T11:09:00.383 に答える