This commit is contained in:
2023-12-15 19:32:31 +08:00
parent 4f148fbdbf
commit aec33c4e0d
+6 -6
View File
@@ -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) {
/** @var Binding $rule */
$rule = $binding[0]->newInstance();
$validator->addRule($property->getName(), $rule->dispatch($object, $property->getName()));
}
$validator->setAlias($attribute->getName(), $rule->field);
$validator->setAlias($property->getName(), $rule->field);
}
$typeProxy = $this->_typeValidator($property);