Legoktm has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/250723

Change subject: Don't implement IContextSource directly
......................................................................

Don't implement IContextSource directly

Instead just extend ContextSource, so whenever the interface changes
this class doesn't need updating.

Change-Id: Ia6dc90fc682aaecf83010c3be9eaf0fd3e726d2c
---
M includes/pages/EducationPage.php
1 file changed, 3 insertions(+), 65 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EducationProgram 
refs/changes/23/250723/1

diff --git a/includes/pages/EducationPage.php b/includes/pages/EducationPage.php
index 66f0baa..7360b1b 100644
--- a/includes/pages/EducationPage.php
+++ b/includes/pages/EducationPage.php
@@ -1,7 +1,7 @@
 <?php
 
 namespace EducationProgram;
-use IContextSource, Title, WikiPage, Exception, Language;
+use ContextSource, Title, WikiPage, Exception, Language;
 
 /**
  * Abstract Page for interacting with a PageObject.
@@ -18,7 +18,7 @@
  * @licence GNU GPL v2+
  * @author Jeroen De Dauw < jeroended...@gmail.com >
  */
-abstract class EducationPage implements \Page, IContextSource {
+abstract class EducationPage extends ContextSource implements \Page {
 
        /**
         * Returns a list of actions this page can handle.
@@ -41,7 +41,7 @@
 
        /**
         * @since 0.1
-        * @var IContextSource
+        * @var \IContextSource
         */
        protected $context;
 
@@ -80,14 +80,6 @@
 
        }
 
-       public function setContext( IContextSource $context ) {
-               $this->context = $context;
-       }
-
-       public function getContext() {
-               return $this->context;
-       }
-
        public function getPage() {
                return $this->page;
        }
@@ -98,51 +90,6 @@
 
        public function getTitle() {
                return $this->page->getTitle();
-       }
-
-       public function getRequest() {
-               return $this->getContext()->getRequest();
-       }
-
-       public function canUseWikiPage() {
-               return $this->getContext()->canUseWikiPage();
-       }
-
-       public function getWikiPage() {
-               return $this->getContext()->getWikiPage();
-       }
-
-       public function getOutput() {
-               return $this->getContext()->getOutput();
-       }
-
-       public function getUser() {
-               return $this->getContext()->getUser();
-       }
-
-       public function getLanguage() {
-               return $this->getContext()->getLanguage();
-       }
-
-       public function getSkin() {
-               return $this->getContext()->getSkin();
-       }
-
-       public function getConfig() {
-               return $this->getContext()->getConfig();
-       }
-
-       public function exportSession() {
-               return $this->getContext()->exportSession();
-       }
-
-       public function msg( /* $args */ ) {
-               $args = func_get_args();
-               return call_user_func_array( array( $this->getContext(), 'msg' 
), $args );
-       }
-
-       public function getStats() {
-               return $this->getContext()->getStats();
        }
 
        public function getActionOverrides() {
@@ -159,15 +106,6 @@
 
        public function getTouched() {
                return '19700101000000';
-       }
-
-       /**
-        * @deprecated
-        * @return Language
-        */
-       public function getLang() {
-               wfDeprecated( __METHOD__, '1.19' );
-               return $this->getLanguage();
        }
 
        public function getEditRight() {

-- 
To view, visit https://gerrit.wikimedia.org/r/250723
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia6dc90fc682aaecf83010c3be9eaf0fd3e726d2c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EducationProgram
Gerrit-Branch: master
Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to