From 64e179fb25f36d84096f1d8c49eb919d560e58a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 23 Mar 2021 17:00:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Annotation/Loader.php | 2 +- Annotation/Rpc/RpcService.php | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Annotation/Loader.php b/Annotation/Loader.php index f8594e3c..4dca8ea3 100644 --- a/Annotation/Loader.php +++ b/Annotation/Loader.php @@ -36,7 +36,7 @@ class Loader extends BaseObject /** * @param $path * @param $namespace - * @throws ComponentException + * @throws Exception */ public function loader($path, $namespace) { diff --git a/Annotation/Rpc/RpcService.php b/Annotation/Rpc/RpcService.php index a92b03d6..e49e9c2c 100644 --- a/Annotation/Rpc/RpcService.php +++ b/Annotation/Rpc/RpcService.php @@ -5,6 +5,7 @@ namespace Annotation\Rpc; use Annotation\Attribute; +use Exception; use ReflectionException; use Rpc\IProducer; use Snowflake\Exception\ComponentException; @@ -48,11 +49,16 @@ use Snowflake\Snowflake; * @throws ReflectionException * @throws ComponentException * @throws NotFindClassException + * @throws Exception */ public function execute(array $handler): mixed { $rpc = Snowflake::app()->getRpc(); $rpc->addProducer($this->cmd, $handler, $this->config); + + $attributes = Snowflake::app()->getAttributes(); + $attributes->injectProperty($handler[0]); + return parent::execute($handler); }