Umherirrender has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/61605


Change subject: ApiResult::setContent is static
......................................................................

ApiResult::setContent is static

Change-Id: Ifee10208e8b79928ecaa47f541bb61dd6e9c29e4
---
M includes/api/ApiExpandTemplates.php
M includes/api/ApiParamInfo.php
M includes/api/ApiParse.php
M includes/api/ApiQueryAllCategories.php
4 files changed, 22 insertions(+), 22 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/05/61605/1

diff --git a/includes/api/ApiExpandTemplates.php 
b/includes/api/ApiExpandTemplates.php
index f5898fb..d5c789c 100644
--- a/includes/api/ApiExpandTemplates.php
+++ b/includes/api/ApiExpandTemplates.php
@@ -65,14 +65,14 @@
                                $xml = $dom->__toString();
                        }
                        $xml_result = array();
-                       $result->setContent( $xml_result, $xml );
+                       ApiResult::setContent( $xml_result, $xml );
                        $result->addValue( null, 'parsetree', $xml_result );
                }
                $retval = $wgParser->preprocess( $params['text'], $title_obj, 
$options );
 
                // Return result
                $retval_array = array();
-               $result->setContent( $retval_array, $retval );
+               ApiResult::setContent( $retval_array, $retval );
                $result->addValue( null, $this->getModuleName(), $retval_array 
);
        }
 
diff --git a/includes/api/ApiParamInfo.php b/includes/api/ApiParamInfo.php
index 042396e..3e1a753 100644
--- a/includes/api/ApiParamInfo.php
+++ b/includes/api/ApiParamInfo.php
@@ -149,7 +149,7 @@
                                $item = array();
                                if ( is_numeric( $k ) ) {
                                        $retval['examples'] .= $v;
-                                       $result->setContent( $item, $v );
+                                       ApiResult::setContent( $item, $v );
                                } else {
                                        if ( !is_array( $v ) ) {
                                                $item['description'] = $v;
@@ -157,7 +157,7 @@
                                                $item['description'] = implode( 
$v, "\n" );
                                        }
                                        $retval['examples'] .= 
$item['description'] . ' ' . $k;
-                                       $result->setContent( $item, $k );
+                                       ApiResult::setContent( $item, $k );
                                }
                                $retval['allexamples'][] = $item;
                        }
diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php
index defdade..bde1d99 100644
--- a/includes/api/ApiParse.php
+++ b/includes/api/ApiParse.php
@@ -194,10 +194,10 @@
                                // Build a result and bail out
                                $result_array = array();
                                $result_array['text'] = array();
-                               $result->setContent( $result_array['text'], 
$this->pstContent->serialize( $format ) );
+                               ApiResult::setContent( $result_array['text'], 
$this->pstContent->serialize( $format ) );
                                if ( isset( $prop['wikitext'] ) ) {
                                        $result_array['wikitext'] = array();
-                                       $result->setContent( 
$result_array['wikitext'], $this->content->serialize( $format ) );
+                                       ApiResult::setContent( 
$result_array['wikitext'], $this->content->serialize( $format ) );
                                }
                                $result->addValue( null, 
$this->getModuleName(), $result_array );
                                return;
@@ -225,12 +225,12 @@
 
                if ( isset( $prop['text'] ) ) {
                        $result_array['text'] = array();
-                       $result->setContent( $result_array['text'], 
$p_result->getText() );
+                       ApiResult::setContent( $result_array['text'], 
$p_result->getText() );
                }
 
                if ( !is_null( $params['summary'] ) ) {
                        $result_array['parsedsummary'] = array();
-                       $result->setContent( $result_array['parsedsummary'], 
Linker::formatComment( $params['summary'], $titleObj ) );
+                       ApiResult::setContent( $result_array['parsedsummary'], 
Linker::formatComment( $params['summary'], $titleObj ) );
                }
 
                if ( isset( $prop['langlinks'] ) || isset( 
$prop['languageshtml'] ) ) {
@@ -253,7 +253,7 @@
                        $languagesHtml = $this->languagesHtml( $langlinks );
 
                        $result_array['languageshtml'] = array();
-                       $result->setContent( $result_array['languageshtml'], 
$languagesHtml );
+                       ApiResult::setContent( $result_array['languageshtml'], 
$languagesHtml );
                }
                if ( isset( $prop['categories'] ) ) {
                        $result_array['categories'] = 
$this->formatCategoryLinks( $p_result->getCategories() );
@@ -261,7 +261,7 @@
                if ( isset( $prop['categorieshtml'] ) ) {
                        $categoriesHtml = $this->categoriesHtml( 
$p_result->getCategories() );
                        $result_array['categorieshtml'] = array();
-                       $result->setContent( $result_array['categorieshtml'], 
$categoriesHtml );
+                       ApiResult::setContent( $result_array['categorieshtml'], 
$categoriesHtml );
                }
                if ( isset( $prop['links'] ) ) {
                        $result_array['links'] = $this->formatLinks( 
$p_result->getLinks() );
@@ -302,7 +302,7 @@
 
                        if ( isset( $prop['headhtml'] ) ) {
                                $result_array['headhtml'] = array();
-                               $result->setContent( $result_array['headhtml'], 
$context->getOutput()->headElement( $context->getSkin() ) );
+                               ApiResult::setContent( 
$result_array['headhtml'], $context->getOutput()->headElement( 
$context->getSkin() ) );
                        }
                }
 
@@ -312,10 +312,10 @@
 
                if ( isset( $prop['wikitext'] ) ) {
                        $result_array['wikitext'] = array();
-                       $result->setContent( $result_array['wikitext'], 
$this->content->serialize( $format ) );
+                       ApiResult::setContent( $result_array['wikitext'], 
$this->content->serialize( $format ) );
                        if ( !is_null( $this->pstContent ) ) {
                                $result_array['psttext'] = array();
-                               $result->setContent( $result_array['psttext'], 
$this->pstContent->serialize( $format ) );
+                               ApiResult::setContent( 
$result_array['psttext'], $this->pstContent->serialize( $format ) );
                        }
                }
                if ( isset( $prop['properties'] ) ) {
@@ -335,7 +335,7 @@
                                $xml = $dom->__toString();
                        }
                        $result_array['parsetree'] = array();
-                       $result->setContent( $result_array['parsetree'], $xml );
+                       ApiResult::setContent( $result_array['parsetree'], $xml 
);
                }
 
                $result_mapping = array(
@@ -414,7 +414,7 @@
                        if ( $title ) {
                                $entry['url'] = wfExpandUrl( 
$title->getFullURL(), PROTO_CURRENT );
                        }
-                       $this->getResult()->setContent( $entry, $bits[1] );
+                       ApiResult::setContent( $entry, $bits[1] );
                        $result[] = $entry;
                }
                return $result;
@@ -425,7 +425,7 @@
                foreach ( $links as $link => $sortkey ) {
                        $entry = array();
                        $entry['sortkey'] = $sortkey;
-                       $this->getResult()->setContent( $entry, $link );
+                       ApiResult::setContent( $entry, $link );
                        $result[] = $entry;
                }
                return $result;
@@ -479,7 +479,7 @@
                        foreach ( $nslinks as $title => $id ) {
                                $entry = array();
                                $entry['ns'] = $ns;
-                               $this->getResult()->setContent( $entry, 
Title::makeTitle( $ns, $title )->getFullText() );
+                               ApiResult::setContent( $entry, 
Title::makeTitle( $ns, $title )->getFullText() );
                                if ( $id != 0 ) {
                                        $entry['exists'] = '';
                                }
@@ -501,7 +501,7 @@
                                        $entry['url'] = wfExpandUrl( 
$title->getFullURL(), PROTO_CURRENT );
                                }
 
-                               $this->getResult()->setContent( $entry, 
$title->getFullText() );
+                               ApiResult::setContent( $entry, 
$title->getFullText() );
                                $result[] = $entry;
                        }
                }
@@ -513,7 +513,7 @@
                foreach ( $headItems as $tag => $content ) {
                        $entry = array();
                        $entry['tag'] = $tag;
-                       $this->getResult()->setContent( $entry, $content );
+                       ApiResult::setContent( $entry, $content );
                        $result[] = $entry;
                }
                return $result;
@@ -524,7 +524,7 @@
                foreach ( $properties as $name => $value ) {
                        $entry = array();
                        $entry['name'] = $name;
-                       $this->getResult()->setContent( $entry, $value );
+                       ApiResult::setContent( $entry, $value );
                        $result[] = $entry;
                }
                return $result;
@@ -535,7 +535,7 @@
                foreach ( $css as $file => $link ) {
                        $entry = array();
                        $entry['file'] = $file;
-                       $this->getResult()->setContent( $entry, $link );
+                       ApiResult::setContent( $entry, $link );
                        $result[] = $entry;
                }
                return $result;
diff --git a/includes/api/ApiQueryAllCategories.php 
b/includes/api/ApiQueryAllCategories.php
index 952c2dc..3f5c6ee 100644
--- a/includes/api/ApiQueryAllCategories.php
+++ b/includes/api/ApiQueryAllCategories.php
@@ -121,7 +121,7 @@
                                $pages[] = $titleObj;
                        } else {
                                $item = array();
-                               $result->setContent( $item, 
$titleObj->getText() );
+                               ApiResult::setContent( $item, 
$titleObj->getText() );
                                if ( isset( $prop['size'] ) ) {
                                        $item['size'] = intval( $row->cat_pages 
);
                                        $item['pages'] = $row->cat_pages - 
$row->cat_subcats - $row->cat_files;

-- 
To view, visit https://gerrit.wikimedia.org/r/61605
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifee10208e8b79928ecaa47f541bb61dd6e9c29e4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <umherirrender_de...@web.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to