The @codingStandardsIgnoreStart/End pair are very long and tedious if used often.

Example of usage to avoid 'There must be no blank line following and inline comment' error.

  /**
   * An array of arguments to pass to the page callback.
   *
   * @var string[]
   */
  protected $pageArguments;
  // @codingStandardsIgnoreStart
  // NB: @var string[] not caught by PEAR PHP_UML !
  // @codingStandardsIgnoreEnd

Please introduce a shortcut. Some ideas.

Extremely compact:

// @csis
// ...
// @csie

Quite compact:

// @csiStart
// ...
// @csiEnd
// @csIgnoreStart
// ...
// @csIgnoreEnd

Not sure whether this is possible, use bracket in annotation:

// @csi{
// ...
// @csi}
// @csi[
// ...
// @csi]

Comments

klausi’s picture

Status: Active » Closed (won't fix)

I don't see an easy way to specify aliases for those annotations and I don't think it is worth the effort.

Instead I would recommend that you create your own phpcs.xml file where you selectively disable sniffs that you are not compliant with. Then you can either fix the violations later or leave the exclusion in place if you don't like the sniff. We do that in Drupal core for example with a phpcs.xml.dist file because core itself is not compliant yet with all sniffs.