From e9f3499f2f5df637b06131533a54d8e802d64642 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Sun, 16 Apr 2023 12:23:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Inject/ContainerParams.php | 2 +- Inject/ServiceParams.php | 2 +- Interface/InjectParameterInterface.php | 7 ++++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Inject/ContainerParams.php b/Inject/ContainerParams.php index f833690..9bf557e 100644 --- a/Inject/ContainerParams.php +++ b/Inject/ContainerParams.php @@ -25,7 +25,7 @@ class ContainerParams implements InjectParameterInterface * @return mixed|null * @throws \Exception */ - public function dispatch(): mixed + public function dispatch(object $class, string $method): mixed { return Container::instance()->get($this->value); } diff --git a/Inject/ServiceParams.php b/Inject/ServiceParams.php index 576fa2e..417fd79 100644 --- a/Inject/ServiceParams.php +++ b/Inject/ServiceParams.php @@ -27,7 +27,7 @@ class ServiceParams implements InjectParameterInterface * @return mixed|null * @throws Exception */ - public function dispatch(): mixed + public function dispatch(object $class, string $method): mixed { $service = Container::instance()->get(LocalService::class); diff --git a/Interface/InjectParameterInterface.php b/Interface/InjectParameterInterface.php index d00e10d..afb5fa4 100644 --- a/Interface/InjectParameterInterface.php +++ b/Interface/InjectParameterInterface.php @@ -7,6 +7,11 @@ interface InjectParameterInterface { - public function dispatch(): mixed; + /** + * @param object $class + * @param string $method + * @return mixed + */ + public function dispatch(object $class, string $method): mixed; }