Mercurial > hg > isophonics-drupal-site
annotate vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Functions/DiscouragedFunctionsSniff.php @ 7:848c88cfe644
More layout
author | Chris Cannam |
---|---|
date | Fri, 05 Jan 2018 13:59:44 +0000 |
parents | 4c8ae668cc8c |
children | 129ea1e6d783 |
rev | line source |
---|---|
Chris@0 | 1 <?php |
Chris@0 | 2 /** |
Chris@0 | 3 * Drupal_Sniffs_Functions_DiscouragedFunctionsSniff. |
Chris@0 | 4 * |
Chris@0 | 5 * @category PHP |
Chris@0 | 6 * @package PHP_CodeSniffer |
Chris@0 | 7 * @link http://pear.php.net/package/PHP_CodeSniffer |
Chris@0 | 8 */ |
Chris@0 | 9 |
Chris@0 | 10 /** |
Chris@0 | 11 * Discourage the use of debug functions. |
Chris@0 | 12 * |
Chris@0 | 13 * @category PHP |
Chris@0 | 14 * @package PHP_CodeSniffer |
Chris@0 | 15 * @link http://pear.php.net/package/PHP_CodeSniffer |
Chris@0 | 16 */ |
Chris@0 | 17 class Drupal_Sniffs_Functions_DiscouragedFunctionsSniff extends Generic_Sniffs_PHP_ForbiddenFunctionsSniff |
Chris@0 | 18 { |
Chris@0 | 19 |
Chris@0 | 20 /** |
Chris@0 | 21 * A list of forbidden functions with their alternatives. |
Chris@0 | 22 * |
Chris@0 | 23 * The value is NULL if no alternative exists, i.e., the function should |
Chris@0 | 24 * just not be used. |
Chris@0 | 25 * |
Chris@0 | 26 * @var array(string => string|null) |
Chris@0 | 27 */ |
Chris@0 | 28 public $forbiddenFunctions = array( |
Chris@0 | 29 // Devel module debugging functions. |
Chris@0 | 30 'dargs' => null, |
Chris@0 | 31 'dcp' => null, |
Chris@0 | 32 'dd' => null, |
Chris@0 | 33 'dfb' => null, |
Chris@0 | 34 'dfbt' => null, |
Chris@0 | 35 'dpm' => null, |
Chris@0 | 36 'dpq' => null, |
Chris@0 | 37 'dpr' => null, |
Chris@0 | 38 'dprint_r' => null, |
Chris@0 | 39 'drupal_debug' => null, |
Chris@0 | 40 'dsm' => null, |
Chris@0 | 41 'dvm' => null, |
Chris@0 | 42 'dvr' => null, |
Chris@0 | 43 'kdevel_print_object' => null, |
Chris@0 | 44 'kpr' => null, |
Chris@0 | 45 'kprint_r' => null, |
Chris@0 | 46 'sdpm' => null, |
Chris@0 | 47 // Functions which are not available on all |
Chris@0 | 48 // PHP builds. |
Chris@0 | 49 'fnmatch' => null, |
Chris@0 | 50 // Functions which are a security risk. |
Chris@0 | 51 'eval' => null, |
Chris@0 | 52 ); |
Chris@0 | 53 |
Chris@0 | 54 /** |
Chris@0 | 55 * If true, an error will be thrown; otherwise a warning. |
Chris@0 | 56 * |
Chris@0 | 57 * @var bool |
Chris@0 | 58 */ |
Chris@0 | 59 public $error = false; |
Chris@0 | 60 |
Chris@0 | 61 }//end class |