Skip to content

Fix jsonSerialize Deprecation Notice#74

Merged
othercorey merged 1 commit intocakephp:masterfrom
amayer5125:json-serialize
Mar 13, 2022
Merged

Fix jsonSerialize Deprecation Notice#74
othercorey merged 1 commit intocakephp:masterfrom
amayer5125:json-serialize

Conversation

@amayer5125
Copy link
Copy Markdown
Contributor

This fixes the notice I get when running the queue worker on PHP 8.1.

Notice: Deprecated (8192): Return type of Cake\Queue\Job\Message::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

* @return mixed
*/
public function jsonSerialize()
public function jsonSerialize(): mixed
Copy link
Copy Markdown
Contributor

@othercorey othercorey Mar 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to add the \ReturnTypeWillChange attribute instead to support PHP 7.

@othercorey othercorey added this to the 1.0.0 milestone Mar 13, 2022
@othercorey othercorey merged commit aed83ab into cakephp:master Mar 13, 2022
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.

2 participants