aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorC. Scott Ananian <cscott@cscott.net>2024-10-18 18:18:34 -0400
committerC. Scott Ananian <cscott@cscott.net>2024-10-18 18:45:00 -0400
commit4d4715326a3c03086982e7890e5082b595a32d9f (patch)
tree31d2dcb021939aff2d63d8ac6761d4505178423e
parentc49d9199a5880939028ffb1b52f2e52f04706719 (diff)
downloadmediawikicore-4d4715326a3c03086982e7890e5082b595a32d9f.tar.gz
mediawikicore-4d4715326a3c03086982e7890e5082b595a32d9f.zip
Deprecate ::setMetrics() calls with StatsdDataFactoryInterface
HtmlInputTransformHelper::setMetrics() and HtmlToContentTransform::setMetrics() take a StatsFactory now; deprecate passing a StatsdDataFactoryInterface. Depends-On: I0d8eb6cacd761fa4959419b10d59046e61c714ff Change-Id: I2374731f6d37a191fc4a865d2665f2ca18182db1
-rw-r--r--RELEASE-NOTES-1.433
-rw-r--r--includes/Rest/Handler/Helper/HtmlInputTransformHelper.php5
-rw-r--r--includes/parser/Parsoid/HtmlToContentTransform.php8
3 files changed, 13 insertions, 3 deletions
diff --git a/RELEASE-NOTES-1.43 b/RELEASE-NOTES-1.43
index f63acaed5ff2..43eef1bb3203 100644
--- a/RELEASE-NOTES-1.43
+++ b/RELEASE-NOTES-1.43
@@ -950,6 +950,9 @@ because of Phabricator reports.
* HtmlInputTransformHelper::init()
Similarly, calling the constructor method in PageRestHelperFactory
without the appropriate initialization arguments is now deprecated.
+* Calling HtmlToContentTransform::setMetrics() and
+ HtmlInputTransformHelper::setMetrics() with a StatsdDataFactoryInterface
+ is deprecated and emits warnings. Pass a StatsFactory instead.
* HTMLForm methods getPreText, setPreText, addPreText, getPostText,
setPostText, addPostText, getHeaderText, setHeaderText, addHeaderText,
getFooterText, setFooterText and addFooterText, deprecated since 1.38, now
diff --git a/includes/Rest/Handler/Helper/HtmlInputTransformHelper.php b/includes/Rest/Handler/Helper/HtmlInputTransformHelper.php
index fd25ec2270e9..abe1fe0178a7 100644
--- a/includes/Rest/Handler/Helper/HtmlInputTransformHelper.php
+++ b/includes/Rest/Handler/Helper/HtmlInputTransformHelper.php
@@ -438,13 +438,16 @@ class HtmlInputTransformHelper {
/**
* Set metrics sink.
*
+ * @note Passing a StatsdDataFactoryInterface here has been deprecated
+ * since 1.43.
+ *
* @param StatsFactory|StatsdDataFactoryInterface $statsFactory
*/
public function setMetrics( $statsFactory ) {
if ( $statsFactory instanceof StatsdDataFactoryInterface ) {
// Uncomment this once all WMF code has been transitioned, but
// leave it in for the 1.43 release.
- // wfDeprecated( __METHOD__ . ' with StatsdDataFactoryInterface' );
+ wfDeprecated( __METHOD__ . ' with StatsdDataFactoryInterface', '1.43' );
return;
}
$this->statsFactory = $statsFactory;
diff --git a/includes/parser/Parsoid/HtmlToContentTransform.php b/includes/parser/Parsoid/HtmlToContentTransform.php
index ea6d4a5646cb..180e136fb932 100644
--- a/includes/parser/Parsoid/HtmlToContentTransform.php
+++ b/includes/parser/Parsoid/HtmlToContentTransform.php
@@ -86,12 +86,16 @@ class HtmlToContentTransform {
}
/**
+ * Set metrics sink.
+ *
+ * @note Passing a StatsdDataFactoryInterface here has been deprecated
+ * since 1.43.
+ *
* @param StatsFactory|StatsdDataFactoryInterface $metrics
*/
public function setMetrics( $metrics ): void {
if ( $metrics instanceof StatsdDataFactoryInterface ) {
- // Uncomment this once all WMF code has been transitioned
- // wfDeprecated( __METHOD__ . ' with StatsdDataFactoryInterface' );
+ wfDeprecated( __METHOD__ . ' with StatsdDataFactoryInterface', '1.43' );
return;
}
$this->metrics = $metrics;