From 5f9c219db9b64d551cb39760bf1a3e991c619a35 Mon Sep 17 00:00:00 2001 From: Thomas David Baker Date: Sat, 28 Oct 2023 20:12:48 -0700 Subject: [PATCH 1/2] Force maindeck and sideboard to be {} not [] when empty --- gatherling/api_lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gatherling/api_lib.php b/gatherling/api_lib.php index 0cfde6558..9bb720b9f 100644 --- a/gatherling/api_lib.php +++ b/gatherling/api_lib.php @@ -187,8 +187,8 @@ function repr_json_deck($deck) if ($deck->id != 0) { $json['found'] = 1; $json = populate($json, $deck, ['playername', 'name', 'archetype', 'notes']); - $json['maindeck'] = $deck->maindeck_cards; - $json['sideboard'] = $deck->sideboard_cards; + $json['maindeck'] = (object)$deck->maindeck_cards; + $json['sideboard'] = (object)$deck->sideboard_cards; } else { $json['found'] = 0; } From bb07cdf64cf92c4c9f1e7d9d47ef8d17a520adff Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Sun, 29 Oct 2023 03:13:05 +0000 Subject: [PATCH 2/2] Apply fixes from StyleCI --- gatherling/api_lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gatherling/api_lib.php b/gatherling/api_lib.php index 9bb720b9f..30df98bcf 100644 --- a/gatherling/api_lib.php +++ b/gatherling/api_lib.php @@ -187,8 +187,8 @@ function repr_json_deck($deck) if ($deck->id != 0) { $json['found'] = 1; $json = populate($json, $deck, ['playername', 'name', 'archetype', 'notes']); - $json['maindeck'] = (object)$deck->maindeck_cards; - $json['sideboard'] = (object)$deck->sideboard_cards; + $json['maindeck'] = (object) $deck->maindeck_cards; + $json['sideboard'] = (object) $deck->sideboard_cards; } else { $json['found'] = 0; }