Add deprecation messages to static methods in Article.php
authorwithoutaname <drevitchi@gmail.com>
Mon, 23 Jun 2014 23:13:32 +0000 (16:13 -0700)
committerwithoutaname <drevitchi@gmail.com>
Tue, 24 Jun 2014 19:47:58 +0000 (12:47 -0700)
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
tests/phpunit/includes/ArticleTest.php

index c68c675..394c50d 100644 (file)
@@ -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 );
        }
 
index b07c013..ae069ea 100644 (file)
@@ -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