diff --git a/Annotation/LocalService.php b/Annotation/LocalService.php new file mode 100644 index 00000000..3714c244 --- /dev/null +++ b/Annotation/LocalService.php @@ -0,0 +1,49 @@ + get_class($handler[0])]; + if (!empty($this->args)) { + $class = array_merge($class, $this->args); + } + + Snowflake::set($this->service, $class); + + return parent::execute($handler); // TODO: Change the autogenerated stub + } + +} diff --git a/System/Snowflake.php b/System/Snowflake.php index 484ca3dc..6cf263ba 100644 --- a/System/Snowflake.php +++ b/System/Snowflake.php @@ -56,6 +56,20 @@ class Snowflake static::$service = $service; } + + /** + * @param $alias + * @param array $array + * @return mixed + * @throws ComponentException + * @throws NotFindClassException + * @throws ReflectionException + */ + public static function set($alias, $array = []): mixed + { + return static::app()->set($alias, $array); + } + /** * @return Application|null */