This commit is contained in:
2023-04-16 13:26:19 +08:00
parent e307494a53
commit ae48aca021
+5 -2
View File
@@ -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);
} }