add intOrDie() to Kernel/Utils
This commit is contained in:
parent
39c3c67155
commit
17b47a8ed8
@ -9,4 +9,10 @@ final class Utils
|
|||||||
else die("Key $key not present");
|
else die("Key $key not present");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function intOrDie($data)
|
||||||
|
{
|
||||||
|
if (is_numeric($data)) return (int) $data;
|
||||||
|
else die("Not an int");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user