prismicio-community / php-kit

Community maintained development kit for Prismic and the PHP language
https://prismic.io
Other
108 stars 82 forks source link

Fix undefined offset notice in GroupDoc #81

Closed gsteel closed 9 years ago

gsteel commented 9 years ago
$group = $document->getGroup('article.group_name');
foreach($group->getArray() as $groupDoc) {
  if(isset($groupDoc['something'])) {
    // echo $groupDoc['something']->asText();
  }
}

This will raise a notice "undefined offset 'something' in GroupDoc on line ..." which shouldn't really happen if we're first testing to see if the index exists in the first place...

erwan commented 9 years ago

Thank you!