From b3b491d292ea2541fa010b7fd09f25328475fbf4 Mon Sep 17 00:00:00 2001 From: Derick Alangi Date: Tue, 19 Mar 2024 13:24:41 +0300 Subject: [PATCH] objectcache: Deprecate `SerializedValueContainer::isUnified()` Since the method for constructing a serialized value container via `newUnified()` has been removed in Id5179be032d45732db659d506d2781, its corresponding `isUnified()` method is now obsolete and this patch deprecates it to be removed in 1.43. Bug: T344521 Change-Id: I5a90028c2a596dfec9a1df306cc9d0ab90dfedd6 --- RELEASE-NOTES-1.42 | 2 ++ includes/libs/objectcache/MediumSpecificBagOStuff.php | 4 ---- .../libs/objectcache/serialized/SerializedValueContainer.php | 5 +++++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES-1.42 b/RELEASE-NOTES-1.42 index b623f9cd6ae..02acbcb2d42 100644 --- a/RELEASE-NOTES-1.42 +++ b/RELEASE-NOTES-1.42 @@ -621,6 +621,8 @@ because of Phabricator reports. Vuex 4 will remain accessible for the foreseeable future. Pinia should be used for new projects. * Linker::makeHeadline() has been deprecated. +* SerializedValueContainer::isUnified() has been deprecated and now emits + deprecation warnings since 1.42. * Linker::generateTOC(), Linker::tocIndent(), Linker::tocUnindent(), Linker::tocLine(), Linker::tocLineEnd(), Linker::tocList() are deprecated. * Title::getBrokenLinksFrom() has been deprecated. diff --git a/includes/libs/objectcache/MediumSpecificBagOStuff.php b/includes/libs/objectcache/MediumSpecificBagOStuff.php index d6ba87b332e..c169d3e2e1f 100644 --- a/includes/libs/objectcache/MediumSpecificBagOStuff.php +++ b/includes/libs/objectcache/MediumSpecificBagOStuff.php @@ -801,10 +801,6 @@ abstract class MediumSpecificBagOStuff extends BagOStuff { * @return string|null|bool The combined string, false if missing, null on error */ final protected function resolveSegments( $key, $mainValue ) { - if ( SerializedValueContainer::isUnified( $mainValue ) ) { - return $this->unserialize( $mainValue->{SerializedValueContainer::UNIFIED_DATA} ); - } - if ( SerializedValueContainer::isSegmented( $mainValue ) ) { $orderedKeys = array_map( function ( $segmentHash ) use ( $key ) { diff --git a/includes/libs/objectcache/serialized/SerializedValueContainer.php b/includes/libs/objectcache/serialized/SerializedValueContainer.php index 3203ef5abd1..4a6754bd2e9 100644 --- a/includes/libs/objectcache/serialized/SerializedValueContainer.php +++ b/includes/libs/objectcache/serialized/SerializedValueContainer.php @@ -12,6 +12,9 @@ class SerializedValueContainer { // 64 bit UID private const SCHEMA_SEGMENTED = 'CAYCDAgCDw4'; + /** + * @deprecated since 1.42 + */ public const UNIFIED_DATA = '__data__'; public const SEGMENTED_HASHES = '__hashes__'; @@ -27,10 +30,12 @@ class SerializedValueContainer { } /** + * @deprecated since 1.42. * @param mixed $value * @return bool */ public static function isUnified( $value ) { + wfDeprecated( __METHOD__, '1.42' ); return ( $value instanceof stdClass && ( $value->{self::SCHEMA} ?? null ) === self::SCHEMA_UNIFIED