From 4f10b6dbc36ff63b5473751949578d38b342d6f6 Mon Sep 17 00:00:00 2001 From: sunxyw Date: Sun, 15 May 2022 16:40:12 +0800 Subject: [PATCH] fix use of deprecated methods --- phpstan.neon | 2 +- src/ZM/Container/ContainerTrait.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpstan.neon b/phpstan.neon index 66ea6614..b6c908a9 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -4,10 +4,10 @@ parameters: paths: - ./src/ ignoreErrors: - - '#Used constant OS_TYPE_(LINUX|WINDOWS) not found#' - '#Constant .* not found#' - '#PHPDoc tag @throws with type Psr\\Container\\ContainerExceptionInterface is not subtype of Throwable#' - '#Unsafe usage of new static#' + - '#Call to method initTableList\(\) of deprecated class ZM\\DB\\DB#' dynamicConstantNames: - SWOOLE_VERSION - ZM_TEST_LOG_DEBUG diff --git a/src/ZM/Container/ContainerTrait.php b/src/ZM/Container/ContainerTrait.php index d654dc32..d5f58e1d 100644 --- a/src/ZM/Container/ContainerTrait.php +++ b/src/ZM/Container/ContainerTrait.php @@ -663,7 +663,7 @@ trait ContainerTrait { try { // 尝试解析 - return $this->make($parameter->getClass()->name); + return $this->make(ReflectionUtil::getParameterClassName($parameter)); } catch (EntryResolutionException $e) { // 如果参数是可选的,则返回默认值 if ($parameter->isDefaultValueAvailable()) {