变更
This commit is contained in:
+5
-2
@@ -929,12 +929,15 @@ if (!function_exists('di')) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $className
|
* @param string|object $className
|
||||||
* @return mixed
|
* @return mixed
|
||||||
* @throws ReflectionException
|
* @throws ReflectionException
|
||||||
*/
|
*/
|
||||||
function di(string $className): mixed
|
function di(string|object $className): mixed
|
||||||
{
|
{
|
||||||
|
if (is_object($className)) {
|
||||||
|
return $className;
|
||||||
|
}
|
||||||
return Kiri::getDi()->get($className);
|
return Kiri::getDi()->get($className);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user