Allow null returns.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user