mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-03-18 05:04:51 +08:00
refactor container type hint
This commit is contained in:
parent
cad5636f92
commit
1deea5bebc
@ -44,10 +44,10 @@ class Container extends WorkerContainer
|
||||
* 获取一个绑定的实例
|
||||
*
|
||||
* @template T
|
||||
* @param string $abstract 类或接口名
|
||||
* @param class-string<T> $abstract 类或接口名
|
||||
* @param array $parameters 参数
|
||||
* @throws EntryResolutionException
|
||||
* @return T 实例
|
||||
* @return Closure|mixed|T 实例
|
||||
*/
|
||||
public function make(string $abstract, array $parameters = [])
|
||||
{
|
||||
|
||||
@ -92,9 +92,9 @@ interface ContainerInterface extends PsrContainerInterface
|
||||
* 获取一个绑定的实例
|
||||
*
|
||||
* @template T
|
||||
* @param string $abstract 类或接口名
|
||||
* @param array $parameters 参数
|
||||
* @return T 实例
|
||||
* @param class-string<T> $abstract 类或接口名
|
||||
* @param array $parameters 参数
|
||||
* @return Closure|mixed|T 实例
|
||||
*/
|
||||
public function make(string $abstract, array $parameters = []);
|
||||
|
||||
|
||||
@ -211,10 +211,10 @@ class WorkerContainer implements ContainerInterface
|
||||
* 获取一个绑定的实例
|
||||
*
|
||||
* @template T
|
||||
* @param string $abstract 类或接口名
|
||||
* @param class-string<T> $abstract 类或接口名
|
||||
* @param array $parameters 参数
|
||||
* @throws EntryResolutionException
|
||||
* @return T 实例
|
||||
* @return Closure|mixed|T 实例
|
||||
*/
|
||||
public function make(string $abstract, array $parameters = [])
|
||||
{
|
||||
|
||||
@ -656,8 +656,8 @@ function container(): ContainerInterface
|
||||
* 解析类实例(使用容器)
|
||||
*
|
||||
* @template T
|
||||
* @param string<T> $abstract
|
||||
* @return T
|
||||
* @param class-string<T> $abstract
|
||||
* @return Closure|mixed|T
|
||||
*/
|
||||
function resolve(string $abstract, array $parameters = [])
|
||||
{
|
||||
@ -668,8 +668,8 @@ function resolve(string $abstract, array $parameters = [])
|
||||
* 获取容器实例
|
||||
*
|
||||
* @template T
|
||||
* @param null|string<T> $abstract
|
||||
* @return ContainerInterface|T
|
||||
* @param null|class-string<T> $abstract
|
||||
* @return Closure|ContainerInterface|mixed|T
|
||||
*/
|
||||
function app(string $abstract = null, array $parameters = [])
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user