Skip to content

Commit

Permalink
Make trait ArrayLikeTrait compatible with PHP 8.1 (#1105)
Browse files Browse the repository at this point in the history
  • Loading branch information
endelwar authored Nov 19, 2022
1 parent adfb322 commit 3c02caa
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/InstagramScraper/Traits/ArrayLikeTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ trait ArrayLikeTrait
*
* @return bool
*/
public function offsetExists($offset)
public function offsetExists($offset): bool
{
return $this->isMethod($offset, 'get') || \property_exists($this, $offset);
}
Expand Down Expand Up @@ -49,6 +49,7 @@ protected function isMethod($method, $case)
*
* @return mixed
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
if ($run = $this->isMethod($offset, 'get')) {
Expand Down Expand Up @@ -87,7 +88,7 @@ protected function run($method)
*
* @return void
*/
public function offsetSet($offset, $value)
public function offsetSet($offset, $value): void
{
if ($run = $this->isMethod($offset, 'set')) {
$this->run($run);
Expand All @@ -101,7 +102,7 @@ public function offsetSet($offset, $value)
*
* @return void
*/
public function offsetUnset($offset)
public function offsetUnset($offset): void
{
if ($run = $this->isMethod($offset, 'unset')) {
$this->run($run);
Expand Down

0 comments on commit 3c02caa

Please sign in to comment.