From e24b3d8962c8288dc5280040592e8262a56a007e Mon Sep 17 00:00:00 2001 From: wanshan Date: Thu, 21 Aug 2025 15:41:38 +0800 Subject: [PATCH] + [feat] ensure $_result is always an object --- test/lib/init.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/test/lib/init.php b/test/lib/init.php index 6b45c535eb..023539c86f 100644 --- a/test/lib/init.php +++ b/test/lib/init.php @@ -48,16 +48,12 @@ if(isset($codeCoverageConfig) and $codeCoverageConfig == 'true') */ function ensureObject($data) { - if (is_object($data)) { - return $data; - } + if(is_object($data)) return $data; - if (is_string($data)) { + if(is_string($data)) + { $decoded = json_decode($data); - - if (json_last_error() === JSON_ERROR_NONE) { - return $decoded; - } + if(json_last_error() === JSON_ERROR_NONE) return $decoded; } return $data;