From e5f048b778c47b161e938c112d98b944be12185a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Tue, 18 Apr 2023 10:26: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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Container.php b/Container.php index 2706e1f..3a56d5a 100644 --- a/Container.php +++ b/Container.php @@ -10,6 +10,7 @@ declare(strict_types=1); namespace Kiri\Di; +use Kiri\Router\Interface\ValidatorInterface; use Psr\Container\ContainerInterface; use ReflectionClass; use ReflectionException; @@ -207,7 +208,8 @@ class Container implements ContainerInterface $propertyAttributes = $property->getAttributes(); foreach ($propertyAttributes as $attribute) { - if (!class_exists($attribute->getName())) { + if (!class_exists($attribute->getName()) || + in_array(ValidatorInterface::class, class_implements($attribute->getName()))) { continue; } $attribute->newInstance()->dispatch($class, $property->getName());