Since PHP 7.4 classes that implement the "serializable interface" have had some changes in the way they are implemented.
The code has been updated in the repository on this task T301223: [M] Handle deprecation of Serializable interface in WikibaseMediaInfo, but the fallback methods have been left in place as they require the migration of the live PHP servers before they can be changed.
This ticket is a cleanup ticket required to remove the redundant code after the following two tickets have been completed: