eee
This commit is contained in:
@@ -45,18 +45,18 @@ class BindForm implements InjectParameterInterface
|
|||||||
$object = $validator->setFormData($reflect->newInstanceWithoutConstructor());
|
$object = $validator->setFormData($reflect->newInstanceWithoutConstructor());
|
||||||
foreach ($reflect->getProperties() as $property) {
|
foreach ($reflect->getProperties() as $property) {
|
||||||
$ignoring = $property->getAttributes(Ignoring::class);
|
$ignoring = $property->getAttributes(Ignoring::class);
|
||||||
if (count($ignoring) > 0) {
|
$comment = $property->getDocComment();
|
||||||
|
if (count($ignoring) > 0 || ($comment && str_contains($comment, '@deprecated'))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$binding = $property->getAttributes(Binding::class);
|
$binding = $property->getAttributes(Binding::class);
|
||||||
if (count($binding) == 1) {
|
if (count($binding) == 1) {
|
||||||
$attribute = current($binding);
|
/** @var Binding $rule */
|
||||||
$rule = inject($attribute->newInstance());
|
$rule = $binding[0]->newInstance();
|
||||||
if ($rule instanceof RequestFilterInterface) {
|
|
||||||
$validator->addRule($property->getName(), $rule->dispatch($object, $property->getName()));
|
$validator->addRule($property->getName(), $rule->dispatch($object, $property->getName()));
|
||||||
}
|
$validator->setAlias($property->getName(), $rule->field);
|
||||||
$validator->setAlias($attribute->getName(), $rule->field);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$typeProxy = $this->_typeValidator($property);
|
$typeProxy = $this->_typeValidator($property);
|
||||||
|
|||||||
Reference in New Issue
Block a user