From 3c02caa848872f38adc3b5d873851156f8cb69c9 Mon Sep 17 00:00:00 2001 From: Manuel Dalla Lana Date: Sat, 19 Nov 2022 20:24:54 +0100 Subject: [PATCH] Make trait ArrayLikeTrait compatible with PHP 8.1 (#1105) --- src/InstagramScraper/Traits/ArrayLikeTrait.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/InstagramScraper/Traits/ArrayLikeTrait.php b/src/InstagramScraper/Traits/ArrayLikeTrait.php index a03761b4..c220e479 100644 --- a/src/InstagramScraper/Traits/ArrayLikeTrait.php +++ b/src/InstagramScraper/Traits/ArrayLikeTrait.php @@ -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); } @@ -49,6 +49,7 @@ protected function isMethod($method, $case) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { if ($run = $this->isMethod($offset, 'get')) { @@ -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); @@ -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);