[4][com_finder] - php 8.1 serializable-deprecated#36473
[4][com_finder] - php 8.1 serializable-deprecated#36473alikon wants to merge 1 commit intojoomla:4.0-devfrom alikon:patch-2
Conversation
This comment was marked as abuse.
This comment was marked as abuse.
|
|
||
| /** | ||
| * Magic method used for serializing. | ||
| */ | ||
| public function __serialize() | ||
| { | ||
| } | ||
|
|
||
| /** | ||
| * Magic method used for unserializing. | ||
| */ | ||
| public function __unserialize($serialized) | ||
| { | ||
| } | ||
|
|
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
There was a problem hiding this comment.
@PhilETaylor public function __serialize(): array ... shouldn't that be public function __serialize(): string?
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
There was a problem hiding this comment.
serialize() checks if the class has a function with the magic name __serialize(). If so, that function is executed prior to any serialization. It must construct and return an associative array of key/value pairs that represent the serialized form of the object. If no array is returned a TypeError will be thrown.
Gulp. I am confused.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
@PhilETaylor It should be enough if they call the |
This comment was marked as abuse.
This comment was marked as abuse.
|
closing in favour of #36482 |
https://php.watch/versions/8.1/serializable-deprecated
Summary of Changes
added magic method
Testing Instructions
php 8.1
on frontend do a search
check the log
Actual result BEFORE applying this Pull Request
PHP Deprecated: The Serializable interface is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary)Expected result AFTER applying this Pull Request
no more deprecation