Commit bbe6ca34 authored by Simon Welsh's avatar Simon Welsh

Add nullthrows

parent 163a1495
......@@ -2,6 +2,14 @@
namespace _91Carriage\Droplets;
function nullthrows<T>(?T $x, ?string $message = null): T {
if ($x === null) {
throw new \Exception($message === null ? $message : 'Unexpected null');
}
return $x;
}
enum Status: string {
Created = 'new';
Active = 'active';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment