add intOrDie() to Kernel/Utils

This commit is contained in:
Thomas Rubini 2023-01-22 21:43:13 +01:00
parent 39c3c67155
commit 17b47a8ed8
No known key found for this signature in database
GPG Key ID: C7D287C8C1CAC373

View File

@ -9,4 +9,10 @@ final class Utils
else die("Key $key not present");
}
public static function intOrDie($data)
{
if (is_numeric($data)) return (int) $data;
else die("Not an int");
}
}