You are here

class Drupal_Sniffs_Functions_DiscouragedFunctionsSniff in Coder 7.2

Discourage the use of debug functions.

@category PHP @package PHP_CodeSniffer @link http://pear.php.net/package/PHP_CodeSniffer

Hierarchy

Expanded class hierarchy of Drupal_Sniffs_Functions_DiscouragedFunctionsSniff

File

coder_sniffer/Drupal/Sniffs/Functions/DiscouragedFunctionsSniff.php, line 19

View source
class Drupal_Sniffs_Functions_DiscouragedFunctionsSniff extends Generic_Sniffs_PHP_ForbiddenFunctionsSniff {

  /**
   * A list of forbidden functions with their alternatives.
   *
   * The value is NULL if no alternative exists, i.e., the function should
   * just not be used.
   *
   * @var array(string => string|null)
   */
  protected $forbiddenFunctions = array(
    // Devel module debugging functions.
    'dargs' => null,
    'dcp' => null,
    'dd' => null,
    'dfb' => null,
    'dfbt' => null,
    'dpm' => null,
    'dpq' => null,
    'dpr' => null,
    'dprint_r' => null,
    'drupal_debug' => null,
    'dsm' => null,
    'dvm' => null,
    'dvr' => null,
    'kdevel_print_object' => null,
    'kpr' => null,
    'kprint_r' => null,
    'sdpm' => null,
  );

  /**
   * If true, an error will be thrown; otherwise a warning.
   *
   * @var bool
   */
  public $error = false;

}

Members

Namesort descending Modifiers Type Description Overrides
Drupal_Sniffs_Functions_DiscouragedFunctionsSniff::$error public property If true, an error will be thrown; otherwise a warning.
Drupal_Sniffs_Functions_DiscouragedFunctionsSniff::$forbiddenFunctions protected property A list of forbidden functions with their alternatives.