From b8d4f92ddc299f92b78632bdd2e5b08dcdb8209c Mon Sep 17 00:00:00 2001 From: kj Date: Fri, 13 Mar 2020 22:41:48 -0400 Subject: [PATCH] Fix Params class at empty values. --- src/Libs/Params.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Libs/Params.php b/src/Libs/Params.php index bc14631..1ec8542 100644 --- a/src/Libs/Params.php +++ b/src/Libs/Params.php @@ -3,14 +3,18 @@ namespace Libs; class Params { + + private $data; + public function __construct($args){ + $this->data = []; foreach($args as $index => $value){ - $this->$index = $value; + $this->data[$index] = $value; } } public function __get($index){ - return (isset($this->$index) && $this->$index != '') ? urldecode($this->$index) : null; + return (isset($this->data[$index]) && $this->data[$index] != '') ? urldecode($this->data[$index]) : null; } }