From 052d2a82c630c448ca71404152a6d91703a0dd30 Mon Sep 17 00:00:00 2001 From: minwork <20630104+minwork@users.noreply.github.com> Date: Tue, 24 Jan 2023 23:42:00 +0100 Subject: [PATCH 1/4] fix(build): Deprecation issues in PHP 8.1 --- src/ArrObj.php | 39 +++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) 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 +} From b46b515db11c08f8db1554ab9714bea05605b722 Mon Sep 17 00:00:00 2001 From: minwork <20630104+minwork@users.noreply.github.com> Date: Tue, 24 Jan 2023 23:44:36 +0100 Subject: [PATCH 2/4] feat(build): Add support for new PHP versions --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 From 8ba7f17ff00c2916e0805ead1fe395738638e0b2 Mon Sep 17 00:00:00 2001 From: minwork <20630104+minwork@users.noreply.github.com> Date: Tue, 24 Jan 2023 23:53:27 +0100 Subject: [PATCH 3/4] fix(build): Bump PHPUnit to v9 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" : { From feea7fc7c5d1241b8452440530edef6dfa9f9ff1 Mon Sep 17 00:00:00 2001 From: minwork <20630104+minwork@users.noreply.github.com> Date: Tue, 24 Jan 2023 23:57:58 +0100 Subject: [PATCH 4/4] fix(build): ArrObj test --- tests/ArrObj/ArrObjTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(); }