1 | <?php |
||
14 | abstract class Tokens |
||
15 | { |
||
16 | const T_SP = 'SP'; |
||
17 | //const T_TRUE = 'TRUE'; |
||
|
|||
18 | //const T_FALSE = 'FALSE'; |
||
19 | //const T_NULL = 'NULL'; |
||
20 | const T_NUMBER = 'NUMBER'; |
||
21 | const T_STRING = 'STRING'; |
||
22 | const T_NAME = 'NAME'; |
||
23 | const T_DOT = 'DOT'; |
||
24 | const T_COLON = 'COLON'; |
||
25 | const T_SLASH = 'SLASH'; |
||
26 | const T_PAREN_OPEN = 'PAREN_OPEN'; |
||
27 | const T_PAREN_CLOSE = 'PAREN_CLOSE'; |
||
28 | const T_BRACKET_OPEN = ' BRACKET_OPEN'; |
||
29 | const T_BRACKET_CLOSE = ' BRACKET_CLOSE'; |
||
30 | // const T_NOT = 'NOT'; |
||
31 | // const T_AND = 'AND'; |
||
32 | // const T_OR = 'OR'; |
||
33 | // |
||
34 | // const T_PR = 'PR'; |
||
35 | // |
||
36 | // const T_EQ = 'EQ'; |
||
37 | // const T_NE = 'NE'; |
||
38 | // const T_CO = 'CO'; |
||
39 | // const T_SW = 'SW'; |
||
40 | // const T_EW = 'EW'; |
||
41 | // const T_GT = 'GT'; |
||
42 | // const T_LT = 'LT'; |
||
43 | // const T_GE = 'GE'; |
||
44 | // const T_LE = 'LE'; |
||
45 | // |
||
46 | // private static $_compareValue = [self::T_TRUE, self::T_FALSE, self::T_NULL, self::T_NUMBER, self::T_STRING]; |
||
47 | // |
||
48 | // private static $_compareUnaryOperators = [self::T_PR]; |
||
49 | // private static $_compareBinaryOperators = [self::T_EQ, self::T_NE, self::T_CO, self::T_SW, self::T_EW, self::T_GT, self::T_LT, self::T_GE, self::T_LE]; |
||
50 | // |
||
51 | // /** |
||
52 | // * @return array |
||
53 | // */ |
||
54 | // public static function _compareValues() |
||
55 | // { |
||
56 | // return ['true', 'false', 'null']; |
||
57 | // } |
||
58 | // |
||
59 | // /** |
||
60 | // * @return array |
||
61 | // */ |
||
62 | // public static function _compareOperators() |
||
63 | // { |
||
64 | // return array_merge(static::$_compareUnaryOperators, static::$_compareBinaryOperators); |
||
65 | // } |
||
66 | } |
||
67 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.