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

PHP 8.1 compatibility #47

Closed

Conversation

Tjitse-E
Copy link

@Tjitse-E Tjitse-E commented Oct 13, 2022

Also see #46

kingIZZZY and others added 2 commits June 22, 2022 17:45
PHP Deprecated: Return type of PrintNode\Entity::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in .../vendor/printnode/printnode-php/src/PrintNode/Entity.php on line 105

Explanation: https://stackoverflow.com/a/71133750
PrintNode's class Entity implements \JsonSerializable: https://www.php.net/manual/en/class.jsonserializable.php
@Tjitse-E Tjitse-E changed the title Feature/php8.1 compatibility PHP 8.1 compatibility Oct 13, 2022
@Tjitse-E
Copy link
Author

It doesn't seem like Printnode will ever merge this PR, so I created a new release in the forked repo: https://github.com/Vendic/PrintNode-PHP/releases/tag/2.2.0.

@tomaszdurda
Copy link
Contributor

This was done as part of a7616cf.

@njovin
Copy link

njovin commented Jan 19, 2023

@tomaszdurda That commit completely breaks the library for PHP7. The mixed return type is only supported in PHP8+ and throws an error in PHP7.

The PHP version specified in composer.json needs to be updated to reflect that. This PR included that change but your commit does not.

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

Successfully merging this pull request may close these issues.

4 participants