From 2b25aaf8f8ca2155066c7f01e9eb210da9e0f4dc Mon Sep 17 00:00:00 2001 From: Erwan Loisant Date: Mon, 1 Dec 2014 13:40:13 +0100 Subject: [PATCH] Cast ApiData elements as array --- src/Prismic/Api.php | 10 +++++----- src/Prismic/ApiData.php | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Prismic/Api.php b/src/Prismic/Api.php index 4d7b7600..ae7220a0 100644 --- a/src/Prismic/Api.php +++ b/src/Prismic/Api.php @@ -130,8 +130,8 @@ public function bookmarks() */ public function bookmark($name) { - if (isset($this->bookmarks()->{$name})) { - return $this->bookmarks()->{$name}; + if (isset($this->bookmarks()[$name])) { + return $this->bookmarks()[$name]; } return null; @@ -316,10 +316,10 @@ function ($ref) { }, $response->refs ), - $response->bookmarks, - $response->types, + (array)$response->bookmarks, + (array)$response->types, $response->tags, - $response->forms, + (array)$response->forms, $experiments, $response->oauth_initiate, $response->oauth_token diff --git a/src/Prismic/ApiData.php b/src/Prismic/ApiData.php index c2912189..7eabd9d4 100644 --- a/src/Prismic/ApiData.php +++ b/src/Prismic/ApiData.php @@ -53,20 +53,20 @@ class ApiData * A constructor to build the object when you've retrieved all the data you need. * * @param array $refs - * @param \stdClass $bookmarks - * @param \stdClass $types + * @param array $bookmarks + * @param array $types * @param array $tags - * @param \stdClass $forms + * @param array $forms * @param \Prismic\Experiments $experiments * @param string $oauth_initiate * @param string $oauth_token */ public function __construct( array $refs, - \stdClass $bookmarks, - \stdClass $types, + array $bookmarks, + array $types, array $tags, - \stdClass $forms, + array $forms, Experiments $experiments, $oauth_initiate, $oauth_token