1 | <?php |
||
26 | * @package PHP_CodeSniffer |
||
27 | * @author Alexander Obuhovich <[email protected]> |
||
28 | * @license https://github.com/aik099/CodingStandard/blob/master/LICENSE BSD 3-Clause |
||
29 | * @link https://github.com/aik099/CodingStandard |
||
30 | */ |
||
31 | class ValidClassNameSniff implements Sniff |
||
32 | { |
||
33 | |||
34 | /** |
||
35 | * A list of tokenizers this sniff supports. |
||
36 | * |
||
37 | * @var array |
||
38 | */ |
||
39 | public $supportedTokenizers = array('PHP'); |
||
40 | |||
41 | |||
42 | /** |
||
43 | * Returns an array of tokens this test wants to listen for. |
||
44 | * |
||
45 | * @return integer[] |
||
46 | */ |
||
47 | 1 | public function register() |
|
51 | |||
52 | |||
53 | /** |
||
54 | * Processes this test, when one of its tokens is encountered. |
||
55 | * |
||
56 | * @param File $phpcsFile The file being scanned. |
||
57 | * @param int $stackPtr The position of the current token in the |
||
58 | * stack passed in $tokens. |
||
59 | * |
||
60 | * @return void |
||
61 | */ |
||
62 | 1 | public function process(File $phpcsFile, $stackPtr) |
|
89 | }//end class |
||
90 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: