fixed something

This commit is contained in:
Simon Pocrnjič 2026-03-09 06:30:49 +01:00
parent b0d2aa93ab
commit 0b082549b9

View File

@ -24,9 +24,12 @@ public static function resolve(string $key): DecisionEventHandler
{
$key = trim(strtolower($key));
$class = static::$map[$key] ?? null;
if (! $class || ! class_exists($class)) {
if (! $class) {
throw new InvalidArgumentException("Unknown decision event handler for key: {$key}");
}
if (! class_exists($class)) {
throw new InvalidArgumentException("Handler class {$class} for key {$key} does not exist (check autoload)");
}
$handler = app($class);
if (! $handler instanceof DecisionEventHandler) {
throw new InvalidArgumentException("Handler for key {$key} must implement DecisionEventHandler");