mirror of
https://gitee.com/technical-laohu/mpay_v2_webman.git
synced 2026-04-21 09:24:33 +08:00
1. 调整异常处理类
2. 统一职责分工 3. 清除多余代码
This commit is contained in:
@@ -1,2 +1,38 @@
|
||||
<?php
|
||||
// This file is generated by Webman, please don't modify it.
|
||||
|
||||
use support\Container;
|
||||
|
||||
if (!function_exists('container_get')) {
|
||||
/**
|
||||
* 从容器中获取实例(单例)
|
||||
*
|
||||
* @param string $name 类名或接口名
|
||||
* @return mixed
|
||||
*
|
||||
* @example
|
||||
* $foo = container_get(Foo::class);
|
||||
* $user_service = container_get(UserService::class);
|
||||
*/
|
||||
function container_get(string $name)
|
||||
{
|
||||
return Container::get($name);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('container_make')) {
|
||||
/**
|
||||
* 从容器中创建新实例(每次创建新实例)
|
||||
*
|
||||
* @param string $name 类名或接口名
|
||||
* @param array $parameters 构造函数参数
|
||||
* @return mixed
|
||||
*
|
||||
* @example
|
||||
* $log_service = container_make(LogService::class, [$path, $name]);
|
||||
*/
|
||||
function container_make(string $name, array $parameters = [])
|
||||
{
|
||||
return Container::make($name, $parameters);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user