From b2fba3f27f2bb49eaa9d8e1d3857c9e67c883263 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Tue, 29 Jan 2013 09:38:17 +0100 Subject: [PATCH] api: remove duplicate __contruct calls For historical reasons, all our API class had a dummy __construct which simply calls their parent constructor. This patch removes all such occurences to save out some bytes. Change-Id: I667955d7821f780fc5ce23823d74dedb1729b9fa --- includes/api/ApiBlock.php | 4 ---- includes/api/ApiComparePages.php | 4 ---- includes/api/ApiDelete.php | 4 ---- includes/api/ApiDisabled.php | 4 ---- includes/api/ApiEditPage.php | 4 ---- includes/api/ApiEmailUser.php | 4 ---- includes/api/ApiExpandTemplates.php | 4 ---- includes/api/ApiFeedContributions.php | 4 ---- includes/api/ApiFeedWatchlist.php | 4 ---- includes/api/ApiFileRevert.php | 4 ---- includes/api/ApiFormatDbg.php | 4 ---- includes/api/ApiFormatDump.php | 4 ---- includes/api/ApiFormatNone.php | 4 ---- includes/api/ApiFormatPhp.php | 4 ---- includes/api/ApiFormatTxt.php | 4 ---- includes/api/ApiFormatWddx.php | 4 ---- includes/api/ApiFormatXml.php | 4 ---- includes/api/ApiHelp.php | 4 ---- includes/api/ApiImport.php | 4 ---- includes/api/ApiLogout.php | 4 ---- includes/api/ApiMove.php | 4 ---- includes/api/ApiOpenSearch.php | 4 ---- includes/api/ApiOptions.php | 4 ---- includes/api/ApiParse.php | 4 ---- includes/api/ApiPatrol.php | 4 ---- includes/api/ApiProtect.php | 4 ---- includes/api/ApiPurge.php | 4 ---- includes/api/ApiQueryDisabled.php | 4 ---- includes/api/ApiRollback.php | 4 ---- includes/api/ApiRsd.php | 4 ---- includes/api/ApiSetNotificationTimestamp.php | 4 ---- includes/api/ApiTokens.php | 4 ---- includes/api/ApiUnblock.php | 4 ---- includes/api/ApiUndelete.php | 4 ---- includes/api/ApiUpload.php | 4 ---- includes/api/ApiUserrights.php | 4 ---- includes/api/ApiWatch.php | 4 ---- 37 files changed, 148 deletions(-) diff --git a/includes/api/ApiBlock.php b/includes/api/ApiBlock.php index 8f71b1609d..2e4155a88e 100644 --- a/includes/api/ApiBlock.php +++ b/includes/api/ApiBlock.php @@ -32,10 +32,6 @@ */ class ApiBlock extends ApiBase { - public function __construct( $main, $action ) { - parent::__construct( $main, $action ); - } - /** * Blocks the user specified in the parameters for the given expiry, with the * given reason, and with all other settings provided in the params. If the block diff --git a/includes/api/ApiComparePages.php b/includes/api/ApiComparePages.php index 863b70b9b0..6b894c17f1 100644 --- a/includes/api/ApiComparePages.php +++ b/includes/api/ApiComparePages.php @@ -25,10 +25,6 @@ class ApiComparePages extends ApiBase { - public function __construct( $main, $action ) { - parent::__construct( $main, $action ); - } - public function execute() { $params = $this->extractRequestParams(); diff --git a/includes/api/ApiDelete.php b/includes/api/ApiDelete.php index cfa80352f9..422524db05 100644 --- a/includes/api/ApiDelete.php +++ b/includes/api/ApiDelete.php @@ -32,10 +32,6 @@ */ class ApiDelete extends ApiBase { - public function __construct( $main, $action ) { - parent::__construct( $main, $action ); - } - /** * Extracts the title, token, and reason from the request parameters and invokes * the local delete() function with these as arguments. It does not make use of diff --git a/includes/api/ApiDisabled.php b/includes/api/ApiDisabled.php index ebcfa011a4..e5ef3b7e0e 100644 --- a/includes/api/ApiDisabled.php +++ b/includes/api/ApiDisabled.php @@ -36,10 +36,6 @@ */ class ApiDisabled extends ApiBase { - public function __construct( $main, $action ) { - parent::__construct( $main, $action ); - } - public function execute() { $this->dieUsage( "The \"{$this->getModuleName()}\" module has been disabled.", 'moduledisabled' ); } diff --git a/includes/api/ApiEditPage.php b/includes/api/ApiEditPage.php index 74d3e14d82..f6e0679bf3 100644 --- a/includes/api/ApiEditPage.php +++ b/includes/api/ApiEditPage.php @@ -33,10 +33,6 @@ */ class ApiEditPage extends ApiBase { - public function __construct( $query, $moduleName ) { - parent::__construct( $query, $moduleName ); - } - public function execute() { $user = $this->getUser(); $params = $this->extractRequestParams(); diff --git a/includes/api/ApiEmailUser.php b/includes/api/ApiEmailUser.php index ba8edc08b9..5a5c572268 100644 --- a/includes/api/ApiEmailUser.php +++ b/includes/api/ApiEmailUser.php @@ -30,10 +30,6 @@ */ class ApiEmailUser extends ApiBase { - public function __construct( $main, $action ) { - parent::__construct( $main, $action ); - } - public function execute() { $params = $this->extractRequestParams(); diff --git a/includes/api/ApiExpandTemplates.php b/includes/api/ApiExpandTemplates.php index f740cf8ac5..826171b46f 100644 --- a/includes/api/ApiExpandTemplates.php +++ b/includes/api/ApiExpandTemplates.php @@ -33,10 +33,6 @@ */ class ApiExpandTemplates extends ApiBase { - public function __construct( $main, $action ) { - parent::__construct( $main, $action ); - } - public function execute() { // Cache may vary on $wgUser because ParserOptions gets data from it $this->getMain()->setCacheMode( 'anon-public-user-private' ); diff --git a/includes/api/ApiFeedContributions.php b/includes/api/ApiFeedContributions.php index 2f02674fe3..015a992258 100644 --- a/includes/api/ApiFeedContributions.php +++ b/includes/api/ApiFeedContributions.php @@ -29,10 +29,6 @@ */ class ApiFeedContributions extends ApiBase { - public function __construct( $main, $action ) { - parent::__construct( $main, $action ); - } - /** * This module uses a custom feed wrapper printer. * diff --git a/includes/api/ApiFeedWatchlist.php b/includes/api/ApiFeedWatchlist.php index 7a91641a77..a3b468213e 100644 --- a/includes/api/ApiFeedWatchlist.php +++ b/includes/api/ApiFeedWatchlist.php @@ -33,10 +33,6 @@ */ class ApiFeedWatchlist extends ApiBase { - public function __construct( $main, $action ) { - parent::__construct( $main, $action ); - } - /** * This module uses a custom feed wrapper printer. * diff --git a/includes/api/ApiFileRevert.php b/includes/api/ApiFileRevert.php index 1e463e5e12..91ab499d9d 100644 --- a/includes/api/ApiFileRevert.php +++ b/includes/api/ApiFileRevert.php @@ -37,10 +37,6 @@ class ApiFileRevert extends ApiBase { protected $params; - public function __construct( $main, $action ) { - parent::__construct( $main, $action ); - } - public function execute() { $this->params = $this->extractRequestParams(); // Extract the file and archiveName from the request parameters diff --git a/includes/api/ApiFormatDbg.php b/includes/api/ApiFormatDbg.php index f280a29009..1b2e02c9ad 100644 --- a/includes/api/ApiFormatDbg.php +++ b/includes/api/ApiFormatDbg.php @@ -30,10 +30,6 @@ */ class ApiFormatDbg extends ApiFormatBase { - public function __construct( $main, $format ) { - parent::__construct( $main, $format ); - } - public function getMimeType() { // This looks like it should be text/plain, but IE7 is so // brain-damaged it tries to parse text/plain as HTML if it diff --git a/includes/api/ApiFormatDump.php b/includes/api/ApiFormatDump.php index db6608374e..62253e1466 100644 --- a/includes/api/ApiFormatDump.php +++ b/includes/api/ApiFormatDump.php @@ -30,10 +30,6 @@ */ class ApiFormatDump extends ApiFormatBase { - public function __construct( $main, $format ) { - parent::__construct( $main, $format ); - } - public function getMimeType() { // This looks like it should be text/plain, but IE7 is so // brain-damaged it tries to parse text/plain as HTML if it diff --git a/includes/api/ApiFormatNone.php b/includes/api/ApiFormatNone.php index bee1ac964b..78023af3d7 100644 --- a/includes/api/ApiFormatNone.php +++ b/includes/api/ApiFormatNone.php @@ -30,10 +30,6 @@ */ class ApiFormatNone extends ApiFormatBase { - public function __construct( $main, $format ) { - parent::__construct( $main, $format ); - } - public function getMimeType() { return 'text/plain'; } diff --git a/includes/api/ApiFormatPhp.php b/includes/api/ApiFormatPhp.php index 99a047a55b..b2d1f044da 100644 --- a/includes/api/ApiFormatPhp.php +++ b/includes/api/ApiFormatPhp.php @@ -30,10 +30,6 @@ */ class ApiFormatPhp extends ApiFormatBase { - public function __construct( $main, $format ) { - parent::__construct( $main, $format ); - } - public function getMimeType() { return 'application/vnd.php.serialized'; } diff --git a/includes/api/ApiFormatTxt.php b/includes/api/ApiFormatTxt.php index 3e1f59235b..4130e70cf2 100644 --- a/includes/api/ApiFormatTxt.php +++ b/includes/api/ApiFormatTxt.php @@ -30,10 +30,6 @@ */ class ApiFormatTxt extends ApiFormatBase { - public function __construct( $main, $format ) { - parent::__construct( $main, $format ); - } - public function getMimeType() { // This looks like it should be text/plain, but IE7 is so // brain-damaged it tries to parse text/plain as HTML if it diff --git a/includes/api/ApiFormatWddx.php b/includes/api/ApiFormatWddx.php index fd1b32765d..62b69bb677 100644 --- a/includes/api/ApiFormatWddx.php +++ b/includes/api/ApiFormatWddx.php @@ -30,10 +30,6 @@ */ class ApiFormatWddx extends ApiFormatBase { - public function __construct( $main, $format ) { - parent::__construct( $main, $format ); - } - public function getMimeType() { return 'text/xml'; } diff --git a/includes/api/ApiFormatXml.php b/includes/api/ApiFormatXml.php index 8dbeae497b..6ad7ccd2dd 100644 --- a/includes/api/ApiFormatXml.php +++ b/includes/api/ApiFormatXml.php @@ -36,10 +36,6 @@ class ApiFormatXml extends ApiFormatBase { private $mIncludeNamespace = false; private $mXslt = null; - public function __construct( $main, $format ) { - parent::__construct( $main, $format ); - } - public function getMimeType() { return 'text/xml'; } diff --git a/includes/api/ApiHelp.php b/includes/api/ApiHelp.php index 28bb2e94e1..86f8112978 100644 --- a/includes/api/ApiHelp.php +++ b/includes/api/ApiHelp.php @@ -31,10 +31,6 @@ */ class ApiHelp extends ApiBase { - public function __construct( $main, $action ) { - parent::__construct( $main, $action ); - } - /** * Module for displaying help */ diff --git a/includes/api/ApiImport.php b/includes/api/ApiImport.php index f5636bd236..9657e12d1c 100644 --- a/includes/api/ApiImport.php +++ b/includes/api/ApiImport.php @@ -31,10 +31,6 @@ */ class ApiImport extends ApiBase { - public function __construct( $main, $action ) { - parent::__construct( $main, $action ); - } - public function execute() { $user = $this->getUser(); $params = $this->extractRequestParams(); diff --git a/includes/api/ApiLogout.php b/includes/api/ApiLogout.php index 00dd62563e..2ba92a63ba 100644 --- a/includes/api/ApiLogout.php +++ b/includes/api/ApiLogout.php @@ -32,10 +32,6 @@ */ class ApiLogout extends ApiBase { - public function __construct( $main, $action ) { - parent::__construct( $main, $action ); - } - public function execute() { $user = $this->getUser(); $oldName = $user->getName(); diff --git a/includes/api/ApiMove.php b/includes/api/ApiMove.php index bbf408911f..3f54fee428 100644 --- a/includes/api/ApiMove.php +++ b/includes/api/ApiMove.php @@ -30,10 +30,6 @@ */ class ApiMove extends ApiBase { - public function __construct( $main, $action ) { - parent::__construct( $main, $action ); - } - public function execute() { $user = $this->getUser(); $params = $this->extractRequestParams(); diff --git a/includes/api/ApiOpenSearch.php b/includes/api/ApiOpenSearch.php index 6403bd6931..caf361aca9 100644 --- a/includes/api/ApiOpenSearch.php +++ b/includes/api/ApiOpenSearch.php @@ -29,10 +29,6 @@ */ class ApiOpenSearch extends ApiBase { - public function __construct( $main, $action ) { - parent::__construct( $main, $action ); - } - public function getCustomPrinter() { return $this->getMain()->createPrinterByName( 'json' ); } diff --git a/includes/api/ApiOptions.php b/includes/api/ApiOptions.php index eff05debd3..faebcdc7d5 100644 --- a/includes/api/ApiOptions.php +++ b/includes/api/ApiOptions.php @@ -32,10 +32,6 @@ */ class ApiOptions extends ApiBase { - public function __construct( $main, $action ) { - parent::__construct( $main, $action ); - } - /** * Changes preferences of the current user. */ diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php index e86c91cb70..1e9e503292 100644 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@ -36,10 +36,6 @@ class ApiParse extends ApiBase { /** @var Content $pstContent */ private $pstContent = null; - public function __construct( $main, $action ) { - parent::__construct( $main, $action ); - } - public function execute() { // The data is hot but user-dependent, like page views, so we set vary cookies $this->getMain()->setCacheMode( 'anon-public-user-private' ); diff --git a/includes/api/ApiPatrol.php b/includes/api/ApiPatrol.php index 336068f376..4d4fbba987 100644 --- a/includes/api/ApiPatrol.php +++ b/includes/api/ApiPatrol.php @@ -30,10 +30,6 @@ */ class ApiPatrol extends ApiBase { - public function __construct( $main, $action ) { - parent::__construct( $main, $action ); - } - /** * Patrols the article or provides the reason the patrol failed. */ diff --git a/includes/api/ApiProtect.php b/includes/api/ApiProtect.php index fa6da526a6..95fdbce012 100644 --- a/includes/api/ApiProtect.php +++ b/includes/api/ApiProtect.php @@ -29,10 +29,6 @@ */ class ApiProtect extends ApiBase { - public function __construct( $main, $action ) { - parent::__construct( $main, $action ); - } - public function execute() { global $wgRestrictionLevels; $params = $this->extractRequestParams(); diff --git a/includes/api/ApiPurge.php b/includes/api/ApiPurge.php index e1ba759d32..fa888c9aaa 100644 --- a/includes/api/ApiPurge.php +++ b/includes/api/ApiPurge.php @@ -31,10 +31,6 @@ */ class ApiPurge extends ApiBase { - public function __construct( $main, $action ) { - parent::__construct( $main, $action ); - } - /** * Purges the cache of a page */ diff --git a/includes/api/ApiQueryDisabled.php b/includes/api/ApiQueryDisabled.php index c0929a07ec..cf0d841eaa 100644 --- a/includes/api/ApiQueryDisabled.php +++ b/includes/api/ApiQueryDisabled.php @@ -36,10 +36,6 @@ */ class ApiQueryDisabled extends ApiQueryBase { - public function __construct( $main, $action ) { - parent::__construct( $main, $action ); - } - public function execute() { $this->setWarning( "The \"{$this->getModuleName()}\" module has been disabled." ); } diff --git a/includes/api/ApiRollback.php b/includes/api/ApiRollback.php index 402bab1118..6e55a5eef1 100644 --- a/includes/api/ApiRollback.php +++ b/includes/api/ApiRollback.php @@ -29,10 +29,6 @@ */ class ApiRollback extends ApiBase { - public function __construct( $main, $action ) { - parent::__construct( $main, $action ); - } - /** * @var Title */ diff --git a/includes/api/ApiRsd.php b/includes/api/ApiRsd.php index 752a6beaf7..c4a1328ccb 100644 --- a/includes/api/ApiRsd.php +++ b/includes/api/ApiRsd.php @@ -31,10 +31,6 @@ */ class ApiRsd extends ApiBase { - public function __construct( $main, $action ) { - parent::__construct( $main, $action ); - } - public function execute() { $result = $this->getResult(); diff --git a/includes/api/ApiSetNotificationTimestamp.php b/includes/api/ApiSetNotificationTimestamp.php index 68160fa375..7a47a0ce88 100644 --- a/includes/api/ApiSetNotificationTimestamp.php +++ b/includes/api/ApiSetNotificationTimestamp.php @@ -31,10 +31,6 @@ */ class ApiSetNotificationTimestamp extends ApiBase { - public function __construct( $main, $action ) { - parent::__construct( $main, $action ); - } - public function execute() { $user = $this->getUser(); diff --git a/includes/api/ApiTokens.php b/includes/api/ApiTokens.php index 2be2b2416a..518bfce088 100644 --- a/includes/api/ApiTokens.php +++ b/includes/api/ApiTokens.php @@ -30,10 +30,6 @@ */ class ApiTokens extends ApiBase { - public function __construct( $main, $action ) { - parent::__construct( $main, $action ); - } - public function execute() { wfProfileIn( __METHOD__ ); $params = $this->extractRequestParams(); diff --git a/includes/api/ApiUnblock.php b/includes/api/ApiUnblock.php index 5802a982e5..bc7f6e7287 100644 --- a/includes/api/ApiUnblock.php +++ b/includes/api/ApiUnblock.php @@ -32,10 +32,6 @@ */ class ApiUnblock extends ApiBase { - public function __construct( $main, $action ) { - parent::__construct( $main, $action ); - } - /** * Unblocks the specified user or provides the reason the unblock failed. */ diff --git a/includes/api/ApiUndelete.php b/includes/api/ApiUndelete.php index b1eeff3fcc..f53f065a1b 100644 --- a/includes/api/ApiUndelete.php +++ b/includes/api/ApiUndelete.php @@ -29,10 +29,6 @@ */ class ApiUndelete extends ApiBase { - public function __construct( $main, $action ) { - parent::__construct( $main, $action ); - } - public function execute() { $params = $this->extractRequestParams(); diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php index 2d45b29fcc..03c10d0f51 100644 --- a/includes/api/ApiUpload.php +++ b/includes/api/ApiUpload.php @@ -36,10 +36,6 @@ class ApiUpload extends ApiBase { protected $mParams; - public function __construct( $main, $action ) { - parent::__construct( $main, $action ); - } - public function execute() { // Check whether upload is enabled if ( !UploadBase::isEnabled() ) { diff --git a/includes/api/ApiUserrights.php b/includes/api/ApiUserrights.php index 0c6ebb19d0..b9b1eeda68 100644 --- a/includes/api/ApiUserrights.php +++ b/includes/api/ApiUserrights.php @@ -30,10 +30,6 @@ */ class ApiUserrights extends ApiBase { - public function __construct( $main, $action ) { - parent::__construct( $main, $action ); - } - private $mUser = null; public function execute() { diff --git a/includes/api/ApiWatch.php b/includes/api/ApiWatch.php index 16da176723..2454e3373b 100644 --- a/includes/api/ApiWatch.php +++ b/includes/api/ApiWatch.php @@ -31,10 +31,6 @@ */ class ApiWatch extends ApiBase { - public function __construct( $main, $action ) { - parent::__construct( $main, $action ); - } - public function execute() { $user = $this->getUser(); if ( !$user->isLoggedIn() ) { -- 2.20.1