Skip to content

Commit

Permalink
fix(php-8.1): Ensure JsonSerializable implementation follows interface
Browse files Browse the repository at this point in the history
  • Loading branch information
sudkumar committed Jan 17, 2023
1 parent 9a7fd3b commit 40ee752
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [7.1, 7.2, 7.3, 7.4, 8.0]
php: [7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2]

name: P${{ matrix.php }}

Expand All @@ -32,9 +32,10 @@ jobs:
with:
php-version: ${{ matrix.php }}
coverage: none
ini-values: error_reporting=E_ALL

- name: Install dependencies
run: composer install --prefer-dist --no-interaction --no-suggest
run: composer install --prefer-dist --no-interaction

- name: Execute tests
run: composer run-script test
2 changes: 1 addition & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<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">
<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">
<coverage>
<include>
<directory suffix=".php">./src/</directory>
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/ValidationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ValidationException extends Exception
*/
protected $errors;

public function __construct($message = "", $code = 0, Throwable $previous = null, $errors)
public function __construct($message = "", $code = 0, Throwable $previous = null, $errors = null)
{
$this->errors = $errors;
parent::__construct($message, $code, $previous);
Expand Down
2 changes: 1 addition & 1 deletion src/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public function resolveConfig(Config $config)
* Convert options to json
* @return array
*/
public function jsonSerialize()
public function jsonSerialize(): mixed
{
return $this->toArray();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Support/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Response
* Status of the
* @var int
*/
protected $status = 422;
protected $status_code = 422;

/**
* Response data
Expand Down

0 comments on commit 40ee752

Please sign in to comment.