Skip to content

Commit

Permalink
chore(php) bump version to >= 7.4 and <= 8.1 (#9)
Browse files Browse the repository at this point in the history
* chore(php) bump version to >= 7.4 and <= 8.x

* fix(build) adjust static analysis for PHP 8.1

* chore(deps) update libris to ^2.3.0

* chore(deps) add php ^8.1 to deps
  • Loading branch information
nawarian authored Jun 17, 2022
1 parent a4d4f8a commit 78cf6be
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: [ '7.3', '7.4', '8.0' ]
php-versions: [ '7.4', '8.0', '8.1' ]

steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
}
],
"require": {
"php": ">=7.3.0",
"php": "^7.4 | ^8.0 | ^8.1",
"ext-json": "*",
"researchgate/libris": "^2.1.1"
"researchgate/libris": "^2.3.0"
},
"require-dev": {
"phpunit/phpunit": "^9.3",
Expand Down
19 changes: 7 additions & 12 deletions src/Model/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Geissler\Converter\Model;

use ReturnTypeWillChange;
use Geissler\Converter\Model\Entry;

/**
Expand All @@ -23,14 +24,7 @@ public function __construct()
$this->data = [];
}

/**
* (PHP 5 &gt;= 5.0.0)<br/>
* Retrieve an external iterator
* @link http://php.net/manual/en/iteratoraggregate.getiterator.php
* @return \Traversable An instance of an object implementing <b>Iterator</b> or
* <b>Traversable</b>
*/
public function getIterator()
public function getIterator(): \ArrayIterator
{
return new \ArrayIterator($this->data);
}
Expand All @@ -47,7 +41,7 @@ public function getIterator()
* <p>
* The return value will be casted to boolean if non-boolean was returned.
*/
public function offsetExists($offset)
public function offsetExists($offset): bool
{
return isset($this->data[$offset]);
}
Expand All @@ -61,6 +55,7 @@ public function offsetExists($offset)
* </p>
* @return mixed Can return all value types.
*/
#[ReturnTypeWillChange]
public function offsetGet($offset)
{
return $this->data[$offset] ?? null;
Expand All @@ -80,7 +75,7 @@ public function offsetGet($offset)
* @throws \ErrorException
* @return void
*/
public function offsetSet($offset, $value)
public function offsetSet($offset, $value): void
{
if (is_object($value) == false) {
throw new \ErrorException('Only objects are allowed!');
Expand All @@ -102,7 +97,7 @@ public function offsetSet($offset, $value)
* </p>
* @return void
*/
public function offsetUnset($offset)
public function offsetUnset($offset): void
{
unset($this->data[$offset]);
}
Expand All @@ -117,7 +112,7 @@ public function offsetUnset($offset)
* <p>
* The return value is cast to an integer.
*/
public function count()
public function count(): int
{
return count($this->data);
}
Expand Down

0 comments on commit 78cf6be

Please sign in to comment.