From 478fe7a859955a8bd7c9f32a5b572866fee995f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Sun, 16 Apr 2023 23:38:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Container.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Container.php b/Container.php index 83b7a2d..2706e1f 100644 --- a/Container.php +++ b/Container.php @@ -181,6 +181,9 @@ class Container implements ContainerInterface { $targetAttributes = $reflect->getAttributes(); foreach ($targetAttributes as $attribute) { + if (!class_exists($attribute->getName())) { + continue; + } $attribute->newInstance()->dispatch($object); } @@ -204,6 +207,9 @@ class Container implements ContainerInterface $propertyAttributes = $property->getAttributes(); foreach ($propertyAttributes as $attribute) { + if (!class_exists($attribute->getName())) { + continue; + } $attribute->newInstance()->dispatch($class, $property->getName()); } }