变更
This commit is contained in:
@@ -27,6 +27,9 @@ abstract class AbstractRequestMethod
|
|||||||
|
|
||||||
$middlewareManager = \Kiri::getDi()->get(MiddlewareManager::class);
|
$middlewareManager = \Kiri::getDi()->get(MiddlewareManager::class);
|
||||||
foreach ($middleware as $value) {
|
foreach ($middleware as $value) {
|
||||||
|
if (!class_exists($value->getName())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
/** @var Middleware $instance */
|
/** @var Middleware $instance */
|
||||||
$instance = $value->newInstance();
|
$instance = $value->newInstance();
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ class AutoController
|
|||||||
foreach ($reflection->getMethods() as $method) {
|
foreach ($reflection->getMethods() as $method) {
|
||||||
$attributes = $method->getAttributes();
|
$attributes = $method->getAttributes();
|
||||||
foreach ($attributes as $attribute) {
|
foreach ($attributes as $attribute) {
|
||||||
|
if (!class_exists($attribute->getName())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$attribute->newInstance()->dispatch($object, $method->getName());
|
$attribute->newInstance()->dispatch($object, $method->getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,9 @@ class BindForm implements InjectParameterInterface
|
|||||||
$validator->setFormData($reflect->newInstanceWithoutConstructor());
|
$validator->setFormData($reflect->newInstanceWithoutConstructor());
|
||||||
foreach ($reflect->getProperties() as $property) {
|
foreach ($reflect->getProperties() as $property) {
|
||||||
foreach ($property->getAttributes() as $attribute) {
|
foreach ($property->getAttributes() as $attribute) {
|
||||||
|
if (!class_exists($attribute->getName())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$rule = $attribute->newInstance();
|
$rule = $attribute->newInstance();
|
||||||
if ($rule instanceof ValidatorInterface) {
|
if ($rule instanceof ValidatorInterface) {
|
||||||
$validator->addRule($property->getName(), $rule);
|
$validator->addRule($property->getName(), $rule);
|
||||||
|
|||||||
Reference in New Issue
Block a user