r98969 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98968‎ | r98969 | r98970 >
Date:01:39, 5 October 2011
Author:reedy
Status:ok
Tags:
Comment:
execute() doesn't return anything

Hencel, call the parent::execute() then return nothing

Clearer code!
Modified paths:
  • /trunk/extensions/OpenSearchXml/ApiOpenSearchXml.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OpenSearchXml/ApiOpenSearchXml.php
@@ -58,13 +58,14 @@
5959
6060 protected function inXmlMode() {
6161 $format = $this->validateFormat();
62 - return ($format == 'xml' || $format == 'xmlfm');
 62+ return ( $format == 'xml' || $format == 'xmlfm' );
6363 }
6464
6565 public function execute() {
66 - if (!$this->inXmlMode()) {
 66+ if ( !$this->inXmlMode() ) {
6767 // Pass back to the JSON defaults
68 - return parent::execute();
 68+ parent::execute();
 69+ return;
6970 }
7071
7172 $params = $this->extractRequestParams();
@@ -87,7 +88,6 @@
8889 $result->addValue( null, 'Section', $items );
8990 }
9091
91 -
9292 public function getAllowedParams() {
9393 $params = parent::getAllowedParams();
9494 $params['format'] = array(

Status & tagging log