Conditions | 5 |
Paths | 4 |
Total Lines | 40 |
Code Lines | 30 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
46 | public static function name($const_int) |
||
47 | { |
||
48 | $a = [ |
||
49 | 'character', |
||
50 | 'star', |
||
51 | 'right angle bracket', |
||
52 | 'dot', |
||
53 | 'octothorp', |
||
54 | 'right square bracket', |
||
55 | 'left square bracket', |
||
56 | 'colon', |
||
57 | 'right parenthesis', |
||
58 | 'left parenthesis', |
||
59 | 'plus', |
||
60 | 'tilde', |
||
61 | 'equals', |
||
62 | 'vertical bar', |
||
63 | 'comma', |
||
64 | 'space', |
||
65 | 'quote', |
||
66 | 'single quote', |
||
67 | 'backslash', |
||
68 | 'carat', |
||
69 | 'dollar', |
||
70 | 'at', |
||
71 | ]; |
||
72 | |||
73 | if (isset($a[$const_int]) && is_numeric($const_int)) { |
||
74 | return $a[$const_int]; |
||
75 | } |
||
76 | |||
77 | if ($const_int === self::STRING_LEGAL) { |
||
78 | return 'a legal non-alphanumeric character'; |
||
79 | } |
||
80 | |||
81 | if ($const_int === false) { |
||
82 | return 'end of file'; |
||
83 | } |
||
84 | |||
85 | return sprintf('illegal character (%s)', $const_int); |
||
86 | } |
||
88 |