Skip to content

Suppressing Warnings

tchule edited this page Jan 6, 2017 · 1 revision

Warnings can be removed with the help of annotations on a function level or a class level.

To remove a warning add the annotation "@SuppressWarnings warningName" in the PHPDoc where warningName is the identifier of the check rule.

The identifier of the rule is displayed as a tooltip in the generated HTML report.

/**
 * This is a data object without getter or setter.
 *
 * @package classes
 * @SuppressWarnings checkUnusedVariables
 */
class MyDataObject {

  /**
   * This property is not used in the class and would have raised a warning.
   */
   var $myProperty;

}