Replace wfRunHooks calls with direct Hooks::run calls
[lhc/web/wiklou.git] / includes / api / ApiBase.php
index 99c0fb4..9cb895d 100644 (file)
@@ -284,7 +284,8 @@ abstract class ApiBase extends ContextSource {
        }
 
        /**
-        * Indicates whether this module is "internal" or unstable
+        * Indicates whether this module is "internal"
+        * Internal API modules are not (yet) intended for 3rd party use and may be unstable.
         * @since 1.25
         * @return bool
         */
@@ -1042,7 +1043,7 @@ abstract class ApiBase extends ContextSource {
         * @param array $params All supplied parameters for the module
         * @return bool
         */
-       public final function validateToken( $token, array $params ) {
+       final public function validateToken( $token, array $params ) {
                $tokenType = $this->needsToken();
                $salts = ApiQueryTokens::getTokenTypeSalts();
                if ( !isset( $salts[$tokenType] ) ) {
@@ -1638,6 +1639,10 @@ abstract class ApiBase extends ContextSource {
                        'code' => 'missingtitle',
                        'info' => "The article you tried to edit doesn't exist"
                ),
+               'cantchangecontentmodel' => array(
+                       'code' => 'cantchangecontentmodel',
+                       'info' => "You don't have permission to change the content model of a page"
+               ),
                'nosuchrcid' => array(
                        'code' => 'nosuchrcid',
                        'info' => "There is no change with rcid \"\$1\""
@@ -1952,7 +1957,7 @@ abstract class ApiBase extends ContextSource {
         */
        public function getFinalDescription() {
                $desc = $this->getDescription();
-               wfRunHooks( 'APIGetDescription', array( &$this, &$desc ) );
+               Hooks::run( 'APIGetDescription', array( &$this, &$desc ) );
                $desc = self::escapeWikiText( $desc );
                if ( is_array( $desc ) ) {
                        $desc = join( "\n", $desc );
@@ -1970,7 +1975,7 @@ abstract class ApiBase extends ContextSource {
                }
                $msgs = array( $msg );
 
-               wfRunHooks( 'APIGetDescriptionMessages', array( $this, &$msgs ) );
+               Hooks::run( 'APIGetDescriptionMessages', array( $this, &$msgs ) );
 
                return $msgs;
        }
@@ -2000,7 +2005,7 @@ abstract class ApiBase extends ContextSource {
                        ) + ( isset( $params['token'] ) ? $params['token'] : array() );
                }
 
-               wfRunHooks( 'APIGetAllowedParams', array( &$this, &$params, $flags ) );
+               Hooks::run( 'APIGetAllowedParams', array( &$this, &$params, $flags ) );
 
                return $params;
        }
@@ -2014,7 +2019,7 @@ abstract class ApiBase extends ContextSource {
         */
        public function getFinalParamDescription() {
                $desc = $this->getParamDescription();
-               wfRunHooks( 'APIGetParamDescription', array( &$this, &$desc ) );
+               Hooks::run( 'APIGetParamDescription', array( &$this, &$desc ) );
 
                if ( !$desc ) {
                        $desc = array();
@@ -2082,7 +2087,7 @@ abstract class ApiBase extends ContextSource {
                        }
                }
 
-               wfRunHooks( 'APIGetParamDescriptionMessages', array( $this, &$msgs ) );
+               Hooks::run( 'APIGetParamDescriptionMessages', array( $this, &$msgs ) );
 
                return $msgs;
        }