diff --git a/Scanner.php b/Scanner.php index 8fcc9fc..e622922 100644 --- a/Scanner.php +++ b/Scanner.php @@ -119,7 +119,11 @@ class Scanner extends Component if (!class_exists($attribute->getName())) { continue; } - $attribute->newInstance()->dispatch($class, $method->getName()); + $instance = $attribute->newInstance(); + if (!method_exists($instance, 'dispatch')) { + continue; + } + $instance->dispatch($class, $method->getName()); } } }