From 84297d029d2606fbb07329710b35adbfe8043b5c Mon Sep 17 00:00:00 2001 From: dcooperdalrymple Date: Tue, 10 Sep 2024 13:05:00 -0500 Subject: [PATCH] Allow null returns. --- includes/class-api.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/includes/class-api.php b/includes/class-api.php index c1a36f8..561af9c 100644 --- a/includes/class-api.php +++ b/includes/class-api.php @@ -22,11 +22,11 @@ class Api { private Issuu $client; public function __construct() { - if (!Settings::exists('token')) return; - $this->client = new Issuu(Settings::get('token')); + if (!Settings::exists('client_id')) return; + $this->client = new Issuu(Settings::get('client_id')); } - public function get_publications(array $args = []):stdClass { + public function get_publications(array $args = []):?stdClass { if (!isset($this->client)) return null; $args = wp_parse_args($args, [ @@ -45,7 +45,7 @@ class Api { } } - public function get_publication(string $slug):stdClass { + public function get_publication(string $slug):?stdClass { if (!isset($this->client)) return null; $publications = new Publications($this->client); @@ -57,7 +57,7 @@ class Api { } } - public function get_publication_assets(string $slug, array $args = []):stdClass { + public function get_publication_assets(string $slug, array $args = []):?stdClass { if (!isset($this->client)) return null; $publications = new ApiPublications($this->client); @@ -69,7 +69,7 @@ class Api { } } - public function get_publication_embed(string $slug, array $args = []):stdClass { + public function get_publication_embed(string $slug, array $args = []):?stdClass { if (!isset($this->client)) return null; $publications = new ApiPublications($this->client);