Skip to content

Commit

Permalink
Fix PHP Notice on ArrayLikeTrait
Browse files Browse the repository at this point in the history
  • Loading branch information
shibby authored Nov 21, 2017
1 parent b84a101 commit 425790a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/InstagramScraper/Traits/ArrayLikeTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@ public function offsetGet($offset)
if ($run = $this->isMethod($offset, 'get')) {
return $this->run($run);
} elseif (\property_exists($this, $offset)) {
return $this->{$offset};
} else {
return null;
if (isset($this->{$offset})) {
return $this->{$offset};
} elseif (isset($this::$offset)) {
return $this::$offset;
}
}

return null;
}

/**
Expand Down Expand Up @@ -106,4 +110,4 @@ protected function run($method)
return \call_user_func([$this, $method]);
}

}
}

0 comments on commit 425790a

Please sign in to comment.