| Total Complexity | 4 |
| Total Lines | 41 |
| Duplicated Lines | 0 % |
| Coverage | 50% |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | class DataHelper { |
||
| 24 | /** |
||
| 25 | * Validate AN..$max. |
||
| 26 | * |
||
| 27 | * @param string $value Value to validate. |
||
| 28 | * @param int $max Max length of value. |
||
| 29 | * |
||
| 30 | * @return bool |
||
| 31 | * |
||
| 32 | * @throws InvalidArgumentException Throws invalid argument exception when string is longer then max length. |
||
| 33 | */ |
||
| 34 | 2 | public static function validate_an( $value, $max ) { |
|
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Validate null or AN..$max. |
||
| 50 | * |
||
| 51 | * @param string|null $value Value to validate. |
||
| 52 | * @param int $max Max length of value. |
||
| 53 | * |
||
| 54 | * @return bool |
||
| 55 | * |
||
| 56 | * @throws InvalidArgumentException Throws invalid argument exception when value is not null and longer then max length. |
||
| 57 | */ |
||
| 58 | 1 | public static function validate_null_or_an( $value, $max ) { |
|
| 66 |