From 4c584eb505b915a796cf276697a069c483c672a8 Mon Sep 17 00:00:00 2001 From: James John Date: Mon, 28 Feb 2022 08:15:00 +0000 Subject: [PATCH] Fix ecs error --- src/JSONDB.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/JSONDB.php b/src/JSONDB.php index ff77282..aa7c49d 100644 --- a/src/JSONDB.php +++ b/src/JSONDB.php @@ -108,12 +108,11 @@ private function check_file() throw new \Exception('An array of json is required: Json data enclosed with []'); } // An invalid jSON file - elseif (! is_array($content) && ! is_object($content)) { + if (! is_array($content) && ! is_object($content)) { throw new \Exception('json is invalid'); - } else { - $this->content = $content; - return true; } + $this->content = $content; + return true; } public function select($args = '*') @@ -200,7 +199,6 @@ public function update(array $columns) * * @param string $file json filename without extension * @param array $values Array of columns as keys and values - * */ public function insert($file, array $values) {