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

Source for file ForbiddenFunctionsSniff.php

Documentation is available at ForbiddenFunctionsSniff.php

  1. <?php
  2. /**
  3.  * Discourages the use of alias 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 ForbiddenFunctionsSniff 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.                                   'sizeof'          => 'count',
  27.                                   'delete'          => 'unset',
  28.                                   'print'           => 'echo',
  29.                                   'is_null'         => null,
  30.                                   'create_function' => null,
  31.                                  );
  32.  
  33. }//end class

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