Skip to content

Commit

Permalink
Cast ApiData elements as array
Browse files Browse the repository at this point in the history
  • Loading branch information
erwan committed Dec 1, 2014
1 parent be218b5 commit 2b25aaf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions src/Prismic/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions src/Prismic/ApiData.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2b25aaf

Please sign in to comment.