From 441c8661605ed37fd487940a1ebd0d77453ac646 Mon Sep 17 00:00:00 2001 From: sunxyw Date: Tue, 5 Apr 2022 00:13:22 +0800 Subject: [PATCH] improve SingletonTrait compatibility --- phpstan.neon | 1 + src/ZM/Utils/SingletonTrait.php | 22 +++++++++++++--------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/phpstan.neon b/phpstan.neon index 80cc3e85..b20bc6c3 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -7,5 +7,6 @@ parameters: - '#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#' dynamicConstantNames: - SWOOLE_VERSION diff --git a/src/ZM/Utils/SingletonTrait.php b/src/ZM/Utils/SingletonTrait.php index b7fe5e08..cfe8d81b 100644 --- a/src/ZM/Utils/SingletonTrait.php +++ b/src/ZM/Utils/SingletonTrait.php @@ -1,30 +1,34 @@