Skip to content
This repository was archived by the owner on Jan 13, 2022. It is now read-only.

Commit 29fda0e

Browse files
committed
minor bug fix about strpos function and minor optimization
1 parent 445a03e commit 29fda0e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Facebook/FacebookResponse.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ public function getGraphObject($type = 'Facebook\GraphObject') {
148148
public function getGraphObjectList($type = 'Facebook\GraphObject') {
149149
$out = array();
150150
$data = $this->responseData->data;
151-
for ($i = 0; $i < count($data); $i++) {
151+
$dataLength = count($data);
152+
for ($i = 0; $i < $dataLength; $i++) {
152153
$out[] = (new GraphObject($data[$i]))->cast($type);
153154
}
154155
return $out;
@@ -188,7 +189,7 @@ private function handlePagination($direction) {
188189
$url = parse_url($this->responseData->paging->$direction);
189190
parse_str($url['query'], $params);
190191

191-
if (isset($params['type']) && strpos($this->request->getPath(), $params['type']) != false){
192+
if (isset($params['type']) && strpos($this->request->getPath(), $params['type']) !== false){
192193
unset($params['type']);
193194
}
194195
return new FacebookRequest(

0 commit comments

Comments
 (0)