From 4f148fbdbf2e3d6e5e601f15b389407716307147 Mon Sep 17 00:00:00 2001 From: whwyy Date: Fri, 15 Dec 2023 19:28:39 +0800 Subject: [PATCH] eee --- src/Validator/BindForm.php | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/Validator/BindForm.php b/src/Validator/BindForm.php index 4f2a005..8c4f6fb 100644 --- a/src/Validator/BindForm.php +++ b/src/Validator/BindForm.php @@ -45,17 +45,20 @@ class BindForm implements InjectParameterInterface $object = $validator->setFormData($reflect->newInstanceWithoutConstructor()); foreach ($reflect->getProperties() as $property) { $ignoring = $property->getAttributes(Ignoring::class); - if (count($ignoring) == 0) { - $binding = $property->getAttributes(Binding::class); - if (count($binding) == 1) { - $attribute = current($binding); - $rule = inject($attribute->newInstance()); - if ($rule instanceof RequestFilterInterface) { - $validator->addRule($property->getName(), $rule->dispatch($object, $property->getName())); - } - $validator->setAlias($attribute->getName(), $rule->field); - } + if (count($ignoring) > 0) { + continue; } + + $binding = $property->getAttributes(Binding::class); + if (count($binding) == 1) { + $attribute = current($binding); + $rule = inject($attribute->newInstance()); + if ($rule instanceof RequestFilterInterface) { + $validator->addRule($property->getName(), $rule->dispatch($object, $property->getName())); + } + $validator->setAlias($attribute->getName(), $rule->field); + } + $typeProxy = $this->_typeValidator($property); $validator->addRule($property->getName(), [$typeProxy, false]); }