Skip to content

Commit 40ee752

Browse files
authored
fix(php-8.1): Ensure JsonSerializable implementation follows interface
1 parent 9a7fd3b commit 40ee752

5 files changed

Lines changed: 7 additions & 6 deletions

File tree

.github/workflows/test.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: true
1515
matrix:
16-
php: [7.1, 7.2, 7.3, 7.4, 8.0]
16+
php: [7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2]
1717

1818
name: P${{ matrix.php }}
1919

@@ -32,9 +32,10 @@ jobs:
3232
with:
3333
php-version: ${{ matrix.php }}
3434
coverage: none
35+
ini-values: error_reporting=E_ALL
3536

3637
- name: Install dependencies
37-
run: composer install --prefer-dist --no-interaction --no-suggest
38+
run: composer install --prefer-dist --no-interaction
3839

3940
- name: Execute tests
4041
run: composer run-script test

phpunit.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" bootstrap="vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" bootstrap="vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" convertDeprecationsToExceptions="true">
33
<coverage>
44
<include>
55
<directory suffix=".php">./src/</directory>

src/Exceptions/ValidationException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class ValidationException extends Exception
1616
*/
1717
protected $errors;
1818

19-
public function __construct($message = "", $code = 0, Throwable $previous = null, $errors)
19+
public function __construct($message = "", $code = 0, Throwable $previous = null, $errors = null)
2020
{
2121
$this->errors = $errors;
2222
parent::__construct($message, $code, $previous);

src/Options.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public function resolveConfig(Config $config)
212212
* Convert options to json
213213
* @return array
214214
*/
215-
public function jsonSerialize()
215+
public function jsonSerialize(): mixed
216216
{
217217
return $this->toArray();
218218
}

src/Support/Response.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Response
1717
* Status of the
1818
* @var int
1919
*/
20-
protected $status = 422;
20+
protected $status_code = 422;
2121

2222
/**
2323
* Response data

0 commit comments

Comments
 (0)