This commit is contained in:
2023-04-18 10:26:32 +08:00
parent 478fe7a859
commit e5f048b778
+3 -1
View File
@@ -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());