From a21b9495122ffb405fe8baa877acd028aaff2451 Mon Sep 17 00:00:00 2001 From: whwyy Date: Fri, 9 Feb 2024 17:08:07 +0800 Subject: [PATCH] eee --- Scanner.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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()); } } }