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