value(); return is_array($data) ? $data : []; } if (is_string($value)) { $decoded = json_decode($value, true); return (json_last_error() === JSON_ERROR_NONE && is_array($decoded)) ? $decoded : []; } return []; } }