Skip to content

Commit

Permalink
ArrayDatasource: use array_shift in fetchRow() instead of index access
Browse files Browse the repository at this point in the history
Since associative arrays are supported, the numeric index 0 might not be
the first entry in the result.
  • Loading branch information
Johannes Meyer committed May 6, 2015
1 parent 7b2ed3b commit cfa9176
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion library/Icinga/Data/DataArray/ArrayDatasource.php
Expand Up @@ -138,7 +138,8 @@ public function fetchRow(SimpleQuery $query)
if (empty($result)) {
return false;
}
return $result[0];

return array_shift($result);
}

/**
Expand Down

0 comments on commit cfa9176

Please sign in to comment.