diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml
index b60478ab..607c866e 100644
--- a/.github/workflows/php.yml
+++ b/.github/workflows/php.yml
@@ -19,6 +19,7 @@ jobs:
- "7.3"
- "7.4"
- "8.0"
+ - "8.1"
dependencies:
- "lowest"
- "highest"
@@ -48,6 +49,8 @@ jobs:
# symfony/yaml v3.4 is not compatible with PHP 8.0 but has no upper-bound, so it installs on it
- php: '8.0'
symfony-yaml: '^3.4'
+ - php: '8.1'
+ symfony-yaml: '^3.4'
runs-on: ${{ matrix.os }}
@@ -62,7 +65,11 @@ jobs:
tools: composer:v2
- name: Require specific symfony/yaml version
- run: "composer require symfony/yaml:'${{ matrix.symfony-yaml }}' --prefer-dist --no-interaction --ansi --no-install"
+ run: "composer require symfony/yaml:'${{ matrix.symfony-yaml }}' --no-interaction --ansi --no-install"
+
+ - name: Require newer phpunit/phpunit version
+ run: "composer require phpunit/phpunit '^9.5' --dev --no-interaction --ansi --no-install"
+ if: matrix.php == '8.1'
- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v2"
diff --git a/src/json/JsonReference.php b/src/json/JsonReference.php
index fe27ced1..5f248881 100644
--- a/src/json/JsonReference.php
+++ b/src/json/JsonReference.php
@@ -126,7 +126,8 @@ public function getReference(): string
* @return mixed data which can be serialized by json_encode,
* which is a value of any type other than a resource.
*/
- public function jsonSerialize()
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize() //: mixed
{
return (object)['$ref' => $this->getReference()];
}
diff --git a/src/spec/Paths.php b/src/spec/Paths.php
index a2da8a10..e504a90a 100644
--- a/src/spec/Paths.php
+++ b/src/spec/Paths.php
@@ -183,7 +183,7 @@ public function getErrors(): array
* @return boolean true on success or false on failure.
* The return value will be casted to boolean if non-boolean was returned.
*/
- public function offsetExists($offset)
+ public function offsetExists($offset): bool
{
return $this->hasPath($offset);
}
@@ -194,7 +194,8 @@ public function offsetExists($offset)
* @param mixed $offset The offset to retrieve.
* @return PathItem Can return all value types.
*/
- public function offsetGet($offset)
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset) //: mixed
{
return $this->getPath($offset);
}
@@ -205,7 +206,7 @@ public function offsetGet($offset)
* @param mixed $offset The offset to assign the value to.
* @param mixed $value The value to set.
*/
- public function offsetSet($offset, $value)
+ public function offsetSet($offset, $value): void
{
$this->addPath($offset, $value);
}
@@ -215,7 +216,7 @@ public function offsetSet($offset, $value)
* @link http://php.net/manual/en/arrayaccess.offsetunset.php
* @param mixed $offset The offset to unset.
*/
- public function offsetUnset($offset)
+ public function offsetUnset($offset): void
{
$this->removePath($offset);
}
@@ -226,7 +227,7 @@ public function offsetUnset($offset)
* @return int The custom count as an integer.
* The return value is cast to an integer.
*/
- public function count()
+ public function count(): int
{
return count($this->_paths);
}
@@ -236,7 +237,7 @@ public function count()
* @link http://php.net/manual/en/iteratoraggregate.getiterator.php
* @return Traversable An instance of an object implementing Iterator or Traversable
*/
- public function getIterator()
+ public function getIterator(): Traversable
{
return new ArrayIterator($this->_paths);
}
diff --git a/src/spec/Responses.php b/src/spec/Responses.php
index a3623ae4..a6db447d 100644
--- a/src/spec/Responses.php
+++ b/src/spec/Responses.php
@@ -173,7 +173,7 @@ public function getErrors(): array
* @return boolean true on success or false on failure.
* The return value will be casted to boolean if non-boolean was returned.
*/
- public function offsetExists($offset)
+ public function offsetExists($offset): bool
{
return $this->hasResponse($offset);
}
@@ -184,7 +184,8 @@ public function offsetExists($offset)
* @param mixed $offset The offset to retrieve.
* @return mixed Can return all value types.
*/
- public function offsetGet($offset)
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset) //: mixed
{
return $this->getResponse($offset);
}
@@ -195,7 +196,7 @@ public function offsetGet($offset)
* @param mixed $offset The offset to assign the value to.
* @param mixed $value The value to set.
*/
- public function offsetSet($offset, $value)
+ public function offsetSet($offset, $value): void
{
$this->addResponse($offset, $value);
}
@@ -205,7 +206,7 @@ public function offsetSet($offset, $value)
* @link http://php.net/manual/en/arrayaccess.offsetunset.php
* @param mixed $offset The offset to unset.
*/
- public function offsetUnset($offset)
+ public function offsetUnset($offset): void
{
$this->removeResponse($offset);
}
@@ -216,7 +217,7 @@ public function offsetUnset($offset)
* @return int The custom count as an integer.
* The return value is cast to an integer.
*/
- public function count()
+ public function count(): int
{
return count($this->_responses);
}
@@ -226,7 +227,7 @@ public function count()
* @link http://php.net/manual/en/iteratoraggregate.getiterator.php
* @return Traversable An instance of an object implementing Iterator or Traversable
*/
- public function getIterator()
+ public function getIterator(): Traversable
{
return new ArrayIterator($this->_responses);
}