TagCollection: serialize and deprecated errors

Created on 28 January 2025, 2 months ago

We are seeing these errors in multiple places.
One way to reproduce: register and select subsribe to newspaper.

In that case, we are seeing these errors (there are other related issues on deprecated code, but none that deal with TagCollection Class"

Deprecated function: Return type of CleverReach\BusinessLogic\Entity\TagCollection::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in require_once() (line 10 of modules\contrib\clever_reach\lib\BusinessLogic\Entity\TagCollection.php).

Deprecated function: Return type of CleverReach\BusinessLogic\Entity\TagCollection::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in require_once() (line 10 of modules\contrib\clever_reach\lib\BusinessLogic\Entity\TagCollection.php).

Deprecated function: Return type of CleverReach\BusinessLogic\Entity\TagCollection::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in require_once() (line 10 of modules\contrib\clever_reach\lib\BusinessLogic\Entity\TagCollection.php).

Deprecated function: Return type of CleverReach\BusinessLogic\Entity\TagCollection::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in require_once() (line 10 of modules\contrib\clever_reach\lib\BusinessLogic\Entity\TagCollection.php).

Deprecated function: Return type of CleverReach\BusinessLogic\Entity\TagCollection::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in require_once() (line 10 of modules\contrib\clever_reach\lib\BusinessLogic\Entity\TagCollection.php).

Deprecated function: Return type of CleverReach\BusinessLogic\Entity\TagCollection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in require_once() (line 10 of modules\contrib\clever_reach\lib\BusinessLogic\Entity\TagCollection.php).

Deprecated function: CleverReach\BusinessLogic\Entity\TagCollection implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in require_once() (line 10 of modules\contrib\clever_reach\lib\BusinessLogic\Entity\TagCollection.php).

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @hoporr
  • First patch below. Code changes similar to other fixes, fairly straightforward.
    This installs clean for me (with patch on my local filesystem), and the errors do not come.
    However, not entirely sure if this does not maybe break functionality, I see now way to test this?

Production build 0.71.5 2024