1 | <?php |
||
53 | class IsNumeric implements Check, ListCheck |
||
54 | { |
||
55 | // saves us having to implement inspectList() ourselves |
||
56 | use ListCheckHelper; |
||
57 | |||
58 | /** |
||
59 | * do we have something that can be used as a number? |
||
60 | * |
||
61 | * NOTE that we don't guarantee an int, a float, or even a base-10 |
||
62 | * number in this check, even though that might be what you're hoping |
||
63 | * for |
||
64 | * |
||
65 | * @param mixed $fieldOrVar |
||
66 | * the item to be checked |
||
67 | * @return bool |
||
68 | * TRUE if the item can be used as a number |
||
69 | * FALSE otherwise |
||
70 | */ |
||
71 | public static function check($fieldOrVar) |
||
81 | |||
82 | /** |
||
83 | * do we have something that can be used as a number? |
||
84 | * |
||
85 | * NOTE that we don't guarantee an int, a float, or even a base-10 |
||
86 | * number in this check, even though that might be what you're hoping |
||
87 | * for |
||
88 | * |
||
89 | * @param mixed $fieldOrVar |
||
90 | * the item to be checked |
||
91 | * @return bool |
||
92 | * TRUE if the item can be used as a number |
||
93 | * FALSE otherwise |
||
94 | */ |
||
95 | public function inspect($fieldOrVar) |
||
99 | |||
100 | /** |
||
101 | * is every entry in $list a number of some kind? |
||
102 | * |
||
103 | * @param mixed $list |
||
104 | * the list of items to be checked |
||
105 | * @return bool |
||
106 | * TRUE if every item in $list can be used as a number |
||
107 | * FALSE otherwise |
||
108 | */ |
||
109 | public static function checkList($list) |
||
114 | } |
||
115 |