r96654 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96653‎ | r96654 | r96655 >
Date:11:11, 9 September 2011
Author:reedy
Status:ok
Tags:
Comment:
Fix member variable from category to categories (as what is used in the code)

Add some documentation
Modified paths:
  • /trunk/extensions/Gadgets/ApiQueryGadgets.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Gadgets/ApiQueryGadgets.php
@@ -21,7 +21,7 @@
2222
2323 class ApiQueryGadgets extends ApiQueryBase {
2424 private $props,
25 - $category,
 25+ $categories,
2626 $neededNames,
2727 $listAllowed,
2828 $listEnabled;
@@ -48,6 +48,9 @@
4949 $this->applyList( $this->getList() );
5050 }
5151
 52+ /**
 53+ * @return array
 54+ */
5255 private function getList() {
5356 $gadgets = Gadget::loadStructuredList();
5457
@@ -88,7 +91,7 @@
8992 }
9093
9194 /**
92 - *
 95+ * @return bool
9396 */
9497 private function isNeeded( Gadget $gadget ) {
9598 global $wgUser;
@@ -97,7 +100,7 @@
98101 && ( !$this->listAllowed || $gadget->isAllowed( $wgUser ) )
99102 && ( !$this->listEnabled || $gadget->isEnabled( $wgUser ) );
100103 }
101 -
 104+
102105 private function fakeMetadata( Gadget $g ) {
103106 return array(
104107 'settings' => array(
@@ -124,9 +127,9 @@
125128 'dependencies' => 'dependency',
126129 'messages' => 'message',
127130 );
128 -
 131+
129132 $result = $this->getResult();
130 - foreach ( $metadata as $type => &$data ) {
 133+ foreach ( $metadata as &$data ) {
131134 foreach ( $data as $key => &$value ) {
132135 if ( is_array( $value ) ) {
133136 $tag = isset( $tagNames[$key] ) ? $tagNames[$key] : $key;

Status & tagging log