PHP_CodeSniffer
[ class tree: PHP_CodeSniffer ] [ index: PHP_CodeSniffer ] [ all elements ]

Source for file DiscouragedFunctionsSniff.php

Documentation is available at DiscouragedFunctionsSniff.php

  1. <?php
  2. /**
  3.  * Discourages the use of debug functions.
  4.  *
  5.  * @author    Greg Sherwood <gsherwood@squiz.net>
  6.  * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600)
  7.  * @license   https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
  8.  */
  9.  
  10. namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP;
  11.  
  12. use PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\ForbiddenFunctionsSniff as GenericForbiddenFunctionsSniff;
  13.  
  14. class DiscouragedFunctionsSniff extends GenericForbiddenFunctionsSniff
  15. {
  16.  
  17.     /**
  18.      * A list of forbidden functions with their alternatives.
  19.      *
  20.      * The value is NULL if no alternative exists. IE, the
  21.      * function should just not be used.
  22.      *
  23.      * @var array<string, string|null>
  24.      */
  25.     public $forbiddenFunctions = array(
  26.                                   'error_log' => null,
  27.                                   'print_r'   => null,
  28.                                   'var_dump'  => null,
  29.                                  );
  30.  
  31.     /**
  32.      * If true, an error will be thrown; otherwise a warning.
  33.      *
  34.      * @var boolean 
  35.      */
  36.     public $error = false;
  37.  
  38. }//end class

Documentation generated on Mon, 11 Mar 2019 15:27:24 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.