diff --git a/.travis.yml b/.travis.yml index edf1451..2c21772 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,9 @@ php: - 7.1 - 7.2 - 7.3 + - 7.4 + - 8.0 + - 8.1 branches: only: - master @@ -16,4 +19,4 @@ script: after_script: - travis_retry vendor/bin/php-coveralls # or enable logging - - travis_retry vendor/bin/php-coveralls -v \ No newline at end of file + - travis_retry vendor/bin/php-coveralls -v diff --git a/composer.json b/composer.json index fff8c67..a43a1e4 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "php" : ">=7.1" }, "require-dev" : { - "phpunit/phpunit" : "^7.0", + "phpunit/phpunit" : "^9.0", "php-coveralls/php-coveralls": "^2.1" }, "autoload" : { diff --git a/src/ArrObj.php b/src/ArrObj.php index 6925302..b91796c 100644 --- a/src/ArrObj.php +++ b/src/ArrObj.php @@ -274,35 +274,58 @@ public function setArray($array): self return $this; } - public function offsetExists($offset) + /** + * @param mixed $offset + * @return bool + */ + public function offsetExists($offset): bool { return array_key_exists($offset, $this->array); } - public function offsetGet($offset) + /** + * @param mixed $offset + * @return mixed|null + */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->array[$offset] ?? null; } - public function offsetSet($offset, $value) + /** + * @param mixed $offset + * @param mixed $value + * @return void + */ + public function offsetSet($offset, $value): void { - return $this->array[$offset] = $value; + $this->array[$offset] = $value; } - public function offsetUnset($offset) + /** + * @param mixed $offset + * @return void + */ + public function offsetUnset($offset): void { if (isset($this->array[$offset])) { unset($this->array[$offset]); } } - public function getIterator() + /** + * @return ArrayIterator + */ + public function getIterator(): ArrayIterator { return new ArrayIterator($this->array); } - public function count() + /** + * @return int + */ + public function count(): int { return count($this->array); } -} \ No newline at end of file +} diff --git a/tests/ArrObj/ArrObjTest.php b/tests/ArrObj/ArrObjTest.php index 91d0342..71117df 100644 --- a/tests/ArrObj/ArrObjTest.php +++ b/tests/ArrObj/ArrObjTest.php @@ -13,7 +13,7 @@ class ArrObjTest extends ArrTestCase /** @var ArrObj */ private $obj; - public function setUp() + public function setUp(): void { $this->obj = new ArrObj(); }