This commit is contained in:
xl
2023-11-09 20:31:01 +08:00
parent ce067c67d1
commit 345d02e310
+17
View File
@@ -261,6 +261,23 @@ if (!function_exists('request')) {
}
if (!function_exists('inject')) {
/**
* @param object $object
* @return object
* @throws ReflectionException
*/
function inject(object $object): object
{
$container = Kiri::getDi();
$reflect = $container->getReflectionClass($object::class);
$container->resolveProperties($reflect, $object);
return $object;
}
}
if (!function_exists('response')) {