fix container and coroutine

This commit is contained in:
crazywhalecc
2022-08-14 18:24:59 +08:00
committed by Jerry Ma
parent 8be7207c3c
commit da6000b4da
6 changed files with 40 additions and 7 deletions

View File

@@ -8,9 +8,10 @@ class ZMUtil
{
/**
* 获取 composer.json 并转为数组进行读取使用
* @param null|string $path 路径
*/
public static function getComposerMetadata(): ?array
public static function getComposerMetadata(?string $path = null): ?array
{
return json_decode(file_get_contents(SOURCE_ROOT_DIR . '/composer.json'), true);
return json_decode(file_get_contents(($path ?? SOURCE_ROOT_DIR) . '/composer.json'), true);
}
}