From b2bf378b7fb6cdeadeff3977825fe313ccbabab4 Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Fri, 18 Oct 2019 10:40:38 +0800 Subject: [PATCH] add clear --- wx/WxClient.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/wx/WxClient.php b/wx/WxClient.php index 105b0ea..2a30b3f 100644 --- a/wx/WxClient.php +++ b/wx/WxClient.php @@ -24,8 +24,6 @@ class WxClient const DELETE = 'delete'; const OPTIONS = 'option'; - private static $_instance; - private function __construct() { } @@ -35,10 +33,11 @@ class WxClient */ public static function getInstance() { - if (!(static::$_instance instanceof WxClient)) { - static::$_instance = new WxClient(); + static $client = null; + if (!($client instanceof WxClient)) { + $client = new WxClient(); } - return static::$_instance; + return $client; } /**