r79197 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79196‎ | r79197 | r79198 >
Date:20:09, 29 December 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Added a bunch of docs
Modified paths:
  • /trunk/extensions/Validator/includes/parserHooks/Validator_Describe.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Validator/includes/parserHooks/Validator_Describe.php
@@ -91,6 +91,7 @@
9292 public function render( array $parameters ) {
9393 $parts = array();
9494
 95+ // Loop over the hooks for which the docs should be added.
9596 foreach ( $parameters['hooks'] as $hookName ) {
9697 $parserHook = $this->getParserHookInstance( $hookName );
9798
@@ -102,6 +103,7 @@
103104 }
104105 }
105106
 107+ // Parse the wikitext to HTML.
106108 $output = $this->parser->parse(
107109 implode( "\n\n", $parts ),
108110 $this->parser->mTitle,
@@ -114,6 +116,17 @@
115117 return str_replace( 'pre!>', 'pre>', $output->getText() );
116118 }
117119
 120+ /**
 121+ * Returns the wikitext description for a single parser hook.
 122+ *
 123+ * @since 0.4.3
 124+ *
 125+ * @param string $hookName
 126+ * @param array $parameters
 127+ * @param ParserHook $parserHook
 128+ *
 129+ * @return string
 130+ */
118131 protected function getParserHookDescription( $hookName, array $parameters, ParserHook $parserHook ) {
119132 $descriptionData = $parserHook->getDescriptionData( ParserHook::TYPE_TAG ); // TODO
120133
@@ -133,6 +146,15 @@
134147 return $description;
135148 }
136149
 150+ /**
 151+ * Returns the wikitext for a table listing the provided parameters.
 152+ *
 153+ * @since 0.4.3
 154+ *
 155+ * @param array $parameters
 156+ *
 157+ * @return string
 158+ */
137159 protected function getParameterTable( array $parameters ) {
138160 $tableRows = array();
139161
@@ -159,6 +181,15 @@
160182 return $table; // TODO
161183 }
162184
 185+ /**
 186+ * Returns the wikitext for a table row describing a single parameter.
 187+ *
 188+ * @since 0.4.3
 189+ *
 190+ * @param Parameter $parameter
 191+ *
 192+ * @return string
 193+ */
163194 protected function getDescriptionRow( Parameter $parameter ) {
164195 $aliases = $parameter->getAliases();
165196 $aliases = count( $aliases ) > 0 ? implode( ', ', $aliases ) : '-';

Status & tagging log