diff --git a/src/Validator/BindForm.php b/src/Validator/BindForm.php index 8c4f6fb..c785c4d 100644 --- a/src/Validator/BindForm.php +++ b/src/Validator/BindForm.php @@ -45,18 +45,18 @@ class BindForm implements InjectParameterInterface $object = $validator->setFormData($reflect->newInstanceWithoutConstructor()); foreach ($reflect->getProperties() as $property) { $ignoring = $property->getAttributes(Ignoring::class); - if (count($ignoring) > 0) { + $comment = $property->getDocComment(); + if (count($ignoring) > 0 || ($comment && str_contains($comment, '@deprecated'))) { 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); + /** @var Binding $rule */ + $rule = $binding[0]->newInstance(); + + $validator->addRule($property->getName(), $rule->dispatch($object, $property->getName())); + $validator->setAlias($property->getName(), $rule->field); } $typeProxy = $this->_typeValidator($property);