Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with PHP 8.1 #253

Closed
itsAnuga opened this issue Jan 11, 2022 · 1 comment
Closed

Compatibility with PHP 8.1 #253

itsAnuga opened this issue Jan 11, 2022 · 1 comment

Comments

@itsAnuga
Copy link
Contributor

itsAnuga commented Jan 11, 2022

Fresh install on a brand new machine, with PHP 8.1 (8.1.11)

> phpunit
PHPUnit 8.5.22 by Sebastian Bergmann and contributors.

PHP Deprecated:  Return type of App\Application\Actions\ActionPayload::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ./src/Application/Actions/ActionPayload.php on line 68
R
Deprecated: Return type of App\Application\Actions\ActionPayload::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ./src/Application/Actions/ActionPayload.php on line 68
.PHP Deprecated:  Return type of App\Domain\User\User::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ./src/Domain/User/User.php on line 80
R
Deprecated: Return type of App\Domain\User\User::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ./src/Domain/User/User.php on line 80
.PHP Deprecated:  Return type of App\Application\Actions\ActionError::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ./src/Application/Actions/ActionError.php on line 80
R
Deprecated: Return type of App\Application\Actions\ActionError::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ./src/Application/Actions/ActionError.php on line 80
..............                                               19 / 19 (100%)

Time: 218 ms, Memory: 8.00 MB

There were 3 risky tests:

1) Tests\Application\Actions\ActionTest::testActionSetsHttpCodeInRespond
This test printed output: 
Deprecated: Return type of App\Application\Actions\ActionPayload::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ./src/Application/Actions/ActionPayload.php on line 68

2) Tests\Application\Actions\User\ListUserActionTest::testAction
This test printed output: 
Deprecated: Return type of App\Domain\User\User::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ./src/Domain/User/User.php on line 80

3) Tests\Application\Actions\User\ViewUserActionTest::testActionThrowsUserNotFoundException
This test printed output: 
Deprecated: Return type of App\Application\Actions\ActionError::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ./src/Application/Actions/ActionError.php on line 80

OK, but incomplete, skipped, or risky tests!
Tests: 19, Assertions: 37, Risky: 3.

Solved with pull request: #252

More information about the suggested solution can be found at: https://php.watch/versions/8.1/ReturnTypeWillChange

@itsAnuga
Copy link
Contributor Author

itsAnuga commented Jan 11, 2022

Probably the same issue as #250.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants