From e44b1c0989022d5dab25c2931ca01f3901a41c9b Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Fri, 19 Jul 2019 18:09:42 +0800 Subject: [PATCH] add clear --- wx/Config.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/wx/Config.php b/wx/Config.php index 644b9d4..8da54d5 100644 --- a/wx/Config.php +++ b/wx/Config.php @@ -396,4 +396,24 @@ class Config return $this->key; } + + /** + * @param array $configs + * @return $this + */ + public function setConfigs(array $configs) + { + foreach ($configs as $key => $val) { + if (empty($val) || is_array($val)) { + continue; + } + if (!property_exists($this, $key)) { + continue; + } + + $this->$key = $val; + } + return $this; + } + }