Skip to content

Commit

Permalink
Support PHP 8.1 (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
Firehed committed Oct 8, 2021
1 parent a10f879 commit 31c7e8e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ jobs:
- '7.3'
- '7.4'
- '8.0'
- '8.1'
exclude:
# PHPUnit prefer-lowest on 8.1 fails because the 8.x line doesn't
# specifiy compatibility correctly. Doubt that'll get fixed.
- php: '8.1'
dependencies: low

steps:
- name: Check out code
Expand Down
4 changes: 4 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
beStrictAboutCoversAnnotation="false"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
convertDeprecationsToExceptions="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
verbose="true">
<testsuite name="default">
<directory suffix="Test.php">tests</directory>
Expand Down
14 changes: 11 additions & 3 deletions src/Containers/ParsedInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,10 @@ public function asArray(): array

/**
* Invoked via `isset` and `empty`
*
* @return never
*/
public function offsetExists($offset)
public function offsetExists($offset): bool
{
throw new BadMethodCallException(
"ParsedInput is already validated, and contains all expected " .
Expand All @@ -161,8 +163,10 @@ public function offsetExists($offset)

/**
* Invoked by array access of the object
*
* @return mixed
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
$data = $this->getData();
Expand All @@ -181,16 +185,20 @@ public function offsetGet($offset)

/**
* Invoked by setting an array value on the object
*
* @return never
*/
public function offsetSet($offset, $value)
public function offsetSet($offset, $value): void
{
throw new BadMethodCallException("ParsedInput is read-only");
}

/**
* Invoked via `unset`
*
* @return never
*/
public function offsetUnset($offset)
public function offsetUnset($offset): void
{
throw new BadMethodCallException("ParsedInput is read-only");
}
Expand Down

0 comments on commit 31c7e8e

Please sign in to comment.