Merge "Delete autoload.ide.php"
[lhc/web/wiklou.git] / includes / actions / Action.php
index 88382b6..66f4d59 100644 (file)
@@ -19,6 +19,8 @@
  * @file
  */
 
+use MediaWiki\MediaWikiServices;
+
 /**
  * @defgroup Actions Action done on pages
  */
@@ -104,7 +106,7 @@ abstract class Action implements MessageLocalizer {
                }
 
                if ( is_callable( $classOrCallable ) ) {
-                       return call_user_func_array( $classOrCallable, [ $page, $context ] );
+                       return $classOrCallable( $page, $context );
                }
 
                return $classOrCallable;
@@ -151,7 +153,7 @@ abstract class Action implements MessageLocalizer {
                        return 'view';
                }
 
-               $action = Action::factory( $actionName, $context->getWikiPage(), $context );
+               $action = self::factory( $actionName, $context->getWikiPage(), $context );
                if ( $action instanceof Action ) {
                        return $action->getName();
                }
@@ -255,7 +257,7 @@ abstract class Action implements MessageLocalizer {
         */
        final public function msg( $key ) {
                $params = func_get_args();
-               return call_user_func_array( [ $this->getContext(), 'msg' ], $params );
+               return $this->getContext()->msg( ...$params );
        }
 
        /**
@@ -386,9 +388,8 @@ abstract class Action implements MessageLocalizer {
         * @since 1.25
         */
        public function addHelpLink( $to, $overrideBaseUrl = false ) {
-               global $wgContLang;
-               $msg = wfMessage( $wgContLang->lc(
-                       Action::getActionName( $this->getContext() )
+               $msg = wfMessage( MediaWikiServices::getInstance()->getContentLanguage()->lc(
+                       self::getActionName( $this->getContext() )
                        ) . '-helppage' );
 
                if ( !$msg->isDisabled() ) {