[MediaWiki-commits] [Gerrit] Remove unused local variables - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Remove unused local variables .. Remove unused local variables Change-Id: I9e5667d3b27c7685004e2f3215ea51176988d3b2 --- M includes/db/DatabasePostgres.php 1 file changed, 3 insertions(+), 6 deletions(-) Approvals: Aaron Schulz: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php index cfa2074..7410e49 100644 --- a/includes/db/DatabasePostgres.php +++ b/includes/db/DatabasePostgres.php @@ -765,11 +765,8 @@ if ( !$res ) { return null; } - foreach ( $res as $row ) { - return true; - } - return false; + return $res-numRows() 0; } /** @@ -880,7 +877,7 @@ } } if ( $savepoint ) { - $olde = error_reporting( $olde ); + error_reporting( $olde ); $savepoint-commit(); // Set the affected row count for the whole operation @@ -952,7 +949,7 @@ $savepoint-release(); $numrowsinserted++; } - $olde = error_reporting( $olde ); + error_reporting( $olde ); $savepoint-commit(); // Set the affected row count for the whole operation -- To view, visit https://gerrit.wikimedia.org/r/103882 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9e5667d3b27c7685004e2f3215ea51176988d3b2 Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Siebrand siebr...@wikimedia.org Gerrit-Reviewer: Aaron Schulz asch...@wikimedia.org Gerrit-Reviewer: Aude aude.w...@gmail.com Gerrit-Reviewer: Parent5446 tylerro...@gmail.com Gerrit-Reviewer: PleaseStand pleasest...@live.com Gerrit-Reviewer: Reedy re...@wikimedia.org Gerrit-Reviewer: Siebrand siebr...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove unused local variables - change (mediawiki/core)
Siebrand has uploaded a new change for review. https://gerrit.wikimedia.org/r/103882 Change subject: Remove unused local variables .. Remove unused local variables Change-Id: I9e5667d3b27c7685004e2f3215ea51176988d3b2 --- M includes/db/DatabasePostgres.php 1 file changed, 4 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/82/103882/1 diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php index a5a7a19..1ed782f 100644 --- a/includes/db/DatabasePostgres.php +++ b/includes/db/DatabasePostgres.php @@ -786,7 +786,8 @@ if ( !$res ) { return null; } - foreach ( $res as $row ) { + + if ( count( $res ) ) { return true; } @@ -901,7 +902,7 @@ } } if ( $savepoint ) { - $olde = error_reporting( $olde ); + error_reporting( $olde ); $savepoint-commit(); // Set the affected row count for the whole operation @@ -973,7 +974,7 @@ $savepoint-release(); $numrowsinserted++; } - $olde = error_reporting( $olde ); + error_reporting( $olde ); $savepoint-commit(); // Set the affected row count for the whole operation -- To view, visit https://gerrit.wikimedia.org/r/103882 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9e5667d3b27c7685004e2f3215ea51176988d3b2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Siebrand siebr...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove unused local variables - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Remove unused local variables .. Remove unused local variables Change-Id: I4162d45e68d65347108f94b3d80bc146f3393c1b --- M includes/api/ApiEditPage.php M includes/api/ApiQueryFileRepoInfo.php 2 files changed, 0 insertions(+), 3 deletions(-) Approvals: Chad: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/api/ApiEditPage.php b/includes/api/ApiEditPage.php index daa5d1f..4e1c871 100644 --- a/includes/api/ApiEditPage.php +++ b/includes/api/ApiEditPage.php @@ -348,7 +348,6 @@ if ( !is_null( $params['section'] ) $contentHandler-supportsSections() $titleObj-exists() ) { - $sectionTitle = ''; // If sectiontitle is set, use it, otherwise use the summary as the section title (for // backwards compatibility with old forms/bots). if ( $ep-sectiontitle !== '' ) { diff --git a/includes/api/ApiQueryFileRepoInfo.php b/includes/api/ApiQueryFileRepoInfo.php index 3d4d38f..da7e054 100644 --- a/includes/api/ApiQueryFileRepoInfo.php +++ b/includes/api/ApiQueryFileRepoInfo.php @@ -93,8 +93,6 @@ } public function getParamDescription() { - $p = $this-getModulePrefix(); - return array( 'prop' = array( 'Which repository properties to get (there may be more available on some wikis):', -- To view, visit https://gerrit.wikimedia.org/r/95816 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4162d45e68d65347108f94b3d80bc146f3393c1b Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Siebrand siebr...@wikimedia.org Gerrit-Reviewer: Chad ch...@wikimedia.org Gerrit-Reviewer: Hashar has...@free.fr Gerrit-Reviewer: IAlex coderev...@emsenhuber.ch Gerrit-Reviewer: Reedy re...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove unused local variables - change (mediawiki/core)
Siebrand has uploaded a new change for review. https://gerrit.wikimedia.org/r/95816 Change subject: Remove unused local variables .. Remove unused local variables Change-Id: I4162d45e68d65347108f94b3d80bc146f3393c1b --- M includes/api/ApiEditPage.php M includes/api/ApiQueryFileRepoInfo.php 2 files changed, 0 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/16/95816/1 diff --git a/includes/api/ApiEditPage.php b/includes/api/ApiEditPage.php index daa5d1f..4e1c871 100644 --- a/includes/api/ApiEditPage.php +++ b/includes/api/ApiEditPage.php @@ -348,7 +348,6 @@ if ( !is_null( $params['section'] ) $contentHandler-supportsSections() $titleObj-exists() ) { - $sectionTitle = ''; // If sectiontitle is set, use it, otherwise use the summary as the section title (for // backwards compatibility with old forms/bots). if ( $ep-sectiontitle !== '' ) { diff --git a/includes/api/ApiQueryFileRepoInfo.php b/includes/api/ApiQueryFileRepoInfo.php index 3d4d38f..da7e054 100644 --- a/includes/api/ApiQueryFileRepoInfo.php +++ b/includes/api/ApiQueryFileRepoInfo.php @@ -93,8 +93,6 @@ } public function getParamDescription() { - $p = $this-getModulePrefix(); - return array( 'prop' = array( 'Which repository properties to get (there may be more available on some wikis):', -- To view, visit https://gerrit.wikimedia.org/r/95816 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4162d45e68d65347108f94b3d80bc146f3393c1b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Siebrand siebr...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove unused local variables - change (mediawiki/core)
Siebrand has uploaded a new change for review. https://gerrit.wikimedia.org/r/56930 Change subject: Remove unused local variables .. Remove unused local variables Marked one as FIXME, because I'm not certain if there's maybe some magic depending on it. Should be removed by someone more familiar with this code, or a comment should be added on why it must be kept. Change-Id: I8eb774c2857dcc87404fd8a7e5fb66c5a4c9643e --- M includes/api/ApiCreateAccount.php M includes/api/ApiImageRotate.php M includes/api/ApiQuery.php 3 files changed, 1 insertion(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/30/56930/1 diff --git a/includes/api/ApiCreateAccount.php b/includes/api/ApiCreateAccount.php index 55c60cc..a521346 100644 --- a/includes/api/ApiCreateAccount.php +++ b/includes/api/ApiCreateAccount.php @@ -43,8 +43,6 @@ $params = $this-extractRequestParams(); - $result = array(); - // Init session if necessary if ( session_id() == '' ) { wfSetupSession(); diff --git a/includes/api/ApiImageRotate.php b/includes/api/ApiImageRotate.php index ebdbedd..5aa41ea 100644 --- a/includes/api/ApiImageRotate.php +++ b/includes/api/ApiImageRotate.php @@ -53,16 +53,13 @@ } } - public function execute() { $params = $this-extractRequestParams(); $rotation = $params['rotation']; - $user = $this-getUser(); $pageSet = $this-getPageSet(); $pageSet-execute(); - $result = array(); $result = array(); self::addValues( $result, $pageSet-getInvalidTitles(), 'invalid', 'title' ); @@ -181,7 +178,6 @@ } public function getAllowedParams( $flags = 0 ) { - $pageSet = $this-getPageSet(); $result = array( 'rotation' = array( ApiBase::PARAM_TYPE = array( '90', '180', '270' ), diff --git a/includes/api/ApiQuery.php b/includes/api/ApiQuery.php index 7c64996..2c497ef 100644 --- a/includes/api/ApiQuery.php +++ b/includes/api/ApiQuery.php @@ -382,6 +382,7 @@ $modules = $allModules; $tmp = $completeModules; $wasPosted = $this-getRequest()-wasPosted(); + // @todo FIXME: Unused local variable? $main = $this-getMain(); /** @var $module ApiQueryBase */ -- To view, visit https://gerrit.wikimedia.org/r/56930 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8eb774c2857dcc87404fd8a7e5fb66c5a4c9643e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Siebrand siebr...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove unused local variables - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Remove unused local variables .. Remove unused local variables Change-Id: I8eb774c2857dcc87404fd8a7e5fb66c5a4c9643e --- M includes/api/ApiCreateAccount.php M includes/api/ApiImageRotate.php M includes/api/ApiQuery.php 3 files changed, 0 insertions(+), 7 deletions(-) Approvals: Hoo man: Verified; Looks good to me, approved jenkins-bot: Verified diff --git a/includes/api/ApiCreateAccount.php b/includes/api/ApiCreateAccount.php index 55c60cc..a521346 100644 --- a/includes/api/ApiCreateAccount.php +++ b/includes/api/ApiCreateAccount.php @@ -43,8 +43,6 @@ $params = $this-extractRequestParams(); - $result = array(); - // Init session if necessary if ( session_id() == '' ) { wfSetupSession(); diff --git a/includes/api/ApiImageRotate.php b/includes/api/ApiImageRotate.php index ebdbedd..5aa41ea 100644 --- a/includes/api/ApiImageRotate.php +++ b/includes/api/ApiImageRotate.php @@ -53,16 +53,13 @@ } } - public function execute() { $params = $this-extractRequestParams(); $rotation = $params['rotation']; - $user = $this-getUser(); $pageSet = $this-getPageSet(); $pageSet-execute(); - $result = array(); $result = array(); self::addValues( $result, $pageSet-getInvalidTitles(), 'invalid', 'title' ); @@ -181,7 +178,6 @@ } public function getAllowedParams( $flags = 0 ) { - $pageSet = $this-getPageSet(); $result = array( 'rotation' = array( ApiBase::PARAM_TYPE = array( '90', '180', '270' ), diff --git a/includes/api/ApiQuery.php b/includes/api/ApiQuery.php index 7c64996..02c1b27 100644 --- a/includes/api/ApiQuery.php +++ b/includes/api/ApiQuery.php @@ -382,7 +382,6 @@ $modules = $allModules; $tmp = $completeModules; $wasPosted = $this-getRequest()-wasPosted(); - $main = $this-getMain(); /** @var $module ApiQueryBase */ foreach ( $allModules as $moduleName = $module ) { -- To view, visit https://gerrit.wikimedia.org/r/56930 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8eb774c2857dcc87404fd8a7e5fb66c5a4c9643e Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Siebrand siebr...@wikimedia.org Gerrit-Reviewer: Anomie bjor...@wikimedia.org Gerrit-Reviewer: Hoo man h...@online.de Gerrit-Reviewer: Ori.livneh o...@wikimedia.org Gerrit-Reviewer: Reedy re...@wikimedia.org Gerrit-Reviewer: Siebrand siebr...@wikimedia.org Gerrit-Reviewer: Yurik yu...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits