From 34b98c7b2c4d79da02da70886da32d3a5a5344a6 Mon Sep 17 00:00:00 2001 From: withoutaname Date: Mon, 23 Jun 2014 16:13:32 -0700 Subject: [PATCH] Add deprecation messages to static methods in Article.php The referenced hooks simply call the corresponding hooks in WikiPage.php, so it would be better to call them from WikiPage.php directly. Change-Id: Ia0cf526c625d38cd941a1166876c13697be87a86 --- includes/page/Article.php | 12 ++++++++++++ tests/phpunit/includes/ArticleTest.php | 1 + 2 files changed, 13 insertions(+) diff --git a/includes/page/Article.php b/includes/page/Article.php index c68c675dc9..394c50d5bf 100644 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@ -2060,29 +2060,41 @@ class Article implements Page { /** * @return array + * + * @deprecated since 1.24, use WikiPage::selectFields() instead */ public static function selectFields() { + wfDeprecated( __METHOD__, '1.24' ); return WikiPage::selectFields(); } /** * @param Title $title + * + * @deprecated since 1.24, use WikiPage::onArticleCreate() instead */ public static function onArticleCreate( $title ) { + wfDeprecated( __METHOD__, '1.24' ); WikiPage::onArticleCreate( $title ); } /** * @param Title $title + * + * @deprecated since 1.24, use WikiPage::onArticleDelete() instead */ public static function onArticleDelete( $title ) { + wfDeprecated( __METHOD__, '1.24' ); WikiPage::onArticleDelete( $title ); } /** * @param Title $title + * + * @deprecated since 1.24, use WikiPage::onArticleEdit() instead */ public static function onArticleEdit( $title ) { + wfDeprecated( __METHOD__, '1.24' ); WikiPage::onArticleEdit( $title ); } diff --git a/tests/phpunit/includes/ArticleTest.php b/tests/phpunit/includes/ArticleTest.php index b07c0136aa..ae069eaf42 100644 --- a/tests/phpunit/includes/ArticleTest.php +++ b/tests/phpunit/includes/ArticleTest.php @@ -76,6 +76,7 @@ class ArticleTest extends MediaWikiTestCase { * @covers Article::getAutosummary */ public function testStaticFunctions() { + $this->hideDeprecated( 'Article::selectFields' ); $this->hideDeprecated( 'Article::getAutosummary' ); $this->hideDeprecated( 'WikiPage::getAutosummary' ); $this->hideDeprecated( 'CategoryPage::getAutosummary' ); // Inherited from Article -- 2.20.1