Conditions | 4 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
16 | public static function isAddress($address) |
||
17 | { |
||
18 | if (!preg_match('/^(0x)?[0-9a-f]{40}$/i', $address)) { |
||
19 | // check if it has the basic requirements of an address |
||
20 | return false; |
||
21 | } elseif (!preg_match('/^(0x)?[0-9a-f]{40}$/', $address) || preg_match('/^(0x)?[0-9A-F]{40}$/', $address)) { |
||
22 | // If it's all small caps or all all caps, return true |
||
23 | return true; |
||
24 | } else { |
||
25 | // Otherwise check each case |
||
26 | return self::isChecksumAddress($address); |
||
27 | } |
||
57 |