r82067 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82066‎ | r82067 | r82068 >
Date:19:02, 13 February 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Fixed some issues with describe
Modified paths:
  • /trunk/extensions/Validator/includes/ParserHook.php (modified) (history)
  • /trunk/extensions/Validator/includes/parserHooks/Validator_Describe.php (modified) (history)
  • /trunk/extensions/Validator/includes/parserHooks/Validator_ListErrors.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Validator/includes/parserHooks/Validator_ListErrors.php
@@ -29,7 +29,7 @@
3030 );
3131
3232 /**
33 - * No LST in pre-5.3 PHP *sigh*.
 33+ * No LSB in pre-5.3 PHP *sigh*.
3434 * This is to be refactored as soon as php >=5.3 becomes acceptable.
3535 */
3636 public static function staticMagic( array &$magicWords, $langCode ) {
@@ -39,7 +39,7 @@
4040 }
4141
4242 /**
43 - * No LST in pre-5.3 PHP *sigh*.
 43+ * No LSB in pre-5.3 PHP *sigh*.
4444 * This is to be refactored as soon as php >=5.3 becomes acceptable.
4545 */
4646 public static function staticInit( Parser &$wgParser ) {
Index: trunk/extensions/Validator/includes/parserHooks/Validator_Describe.php
@@ -15,7 +15,7 @@
1616 class ValidatorDescribe extends ParserHook {
1717
1818 /**
19 - * No LST in pre-5.3 PHP *sigh*.
 19+ * No LSB in pre-5.3 PHP *sigh*.
2020 * This is to be refactored as soon as php >=5.3 becomes acceptable.
2121 */
2222 public static function staticMagic( array &$magicWords, $langCode ) {
@@ -25,7 +25,7 @@
2626 }
2727
2828 /**
29 - * No LST in pre-5.3 PHP *sigh*.
 29+ * No LSB in pre-5.3 PHP *sigh*.
3030 * This is to be refactored as soon as php >=5.3 becomes acceptable.
3131 */
3232 public static function staticInit( Parser &$wgParser ) {
@@ -106,8 +106,7 @@
107107 }
108108 }
109109
110 - // This str_replace is a hack to allow for placing <pre>s into <pre>s, without breaking the outer ones.
111 - return str_replace( 'pre!&gt;', 'pre&gt;', $this->parseWikitext( implode( "\n\n", $parts ) ) );
 110+ return $this->parseWikitext( implode( "\n\n", $parts ) );
112111 }
113112
114113 /**
@@ -229,7 +228,6 @@
230229 ( $pre ? '=== ' : '<h3>' ) .
231230 wfMsg( 'validator-describe-syntax' ) .
232231 ( $pre ? ' ===' : '</h3>' );
233 - $result .= "\n\n";
234232
235233 $params = array();
236234 $requiredParams = array();
@@ -245,56 +243,56 @@
246244 }
247245
248246 if ( $parserHook->forTagExtensions ) {
249 - $result .= "'''" . wfMsg( 'validator-describe-tagmin' ) . "'''\n\n";
 247+ $result .= "\n\n'''" . wfMsg( 'validator-describe-tagmin' ) . "'''\n\n";
250248
251 - $result .= "<pre!><nowiki>\n" . Xml::element(
 249+ $result .= "&lt;pre&gt;<nowiki>\n" . Xml::element(
252250 $hookName,
253251 $requiredParams
254 - ) . "</nowiki></pre!>";
 252+ ) . "\n</nowiki>&lt;/pre&gt;";
255253
256 - $result .= "'''" . wfMsg( 'validator-describe-tagmax' ) . "'''\n\n";
 254+ $result .= "\n\n'''" . wfMsg( 'validator-describe-tagmax' ) . "'''\n\n";
257255
258256 // TODO: multiline when long
259 - $result .= "<pre!><nowiki>\n" . Xml::element(
 257+ $result .= "&lt;pre&gt;<nowiki>\n" . Xml::element(
260258 $hookName,
261259 $params
262 - ) . "</nowiki></pre!>";
 260+ ) . "\n</nowiki>&lt;/pre&gt;";
263261
264262 if ( count( $defaults ) > 0 ) {
265 - $result .= "'''" . wfMsg( 'validator-describe-tagdefault' ) . "'''\n\n";
 263+ $result .= "\n\n'''" . wfMsg( 'validator-describe-tagdefault' ) . "'''\n\n";
266264
267265 foreach ( $plainParams as $name => $type ) {
268266 $contents = '{' . $name . ', ' . $type . '}';
269267 break;
270268 }
271269
272 - $result .= "<pre!><nowiki>\n" . Xml::element(
 270+ $result .= "&lt;pre&gt;<nowiki>\n" . Xml::element(
273271 $hookName,
274272 array_slice( $params, 1 ),
275273 $contents
276 - ) . "</nowiki></pre!>";
 274+ ) . "\n</nowiki>&lt;/pre&gt;";
277275 }
278276 }
279277
280278 if ( $parserHook->forParserFunctions ) {
281 - $result .= "'''" . wfMsg( 'validator-describe-pfmin' ) . "'''\n\n";
 279+ $result .= "\n\n'''" . wfMsg( 'validator-describe-pfmin' ) . "'''\n\n";
282280
283 - $result .= "<pre!><nowiki>\n" .
 281+ $result .= "&lt;pre&gt;<nowiki>\n" .
284282 $this->buildParserFunctionSyntax( $hookName, $requiredParams )
285 - . "</nowiki></pre!>";
 283+ . "\n</nowiki>&lt;/pre&gt;";
286284
287 - $result .= "'''" . wfMsg( 'validator-describe-pfmax' ) . "'''\n\n";
 285+ $result .= "\n\n'''" . wfMsg( 'validator-describe-pfmax' ) . "'''\n\n";
288286
289 - $result .= "<pre!><nowiki>\n" .
 287+ $result .= "&lt;pre&gt;<nowiki>\n" .
290288 $this->buildParserFunctionSyntax( $hookName, $params )
291 - . "</nowiki></pre!>";
 289+ . "\n</nowiki>&lt;/pre&gt;";
292290
293291 if ( count( $defaults ) > 0 ) {
294 - $result .= "'''" . wfMsg( 'validator-describe-pfdefault' ) . "'''\n\n";
 292+ $result .= "\n\n'''" . wfMsg( 'validator-describe-pfdefault' ) . "'''\n\n";
295293
296 - $result .= "<pre!><nowiki>\n" .
 294+ $result .= "&lt;pre&gt;<nowiki>\n" .
297295 $this->buildParserFunctionSyntax( $hookName, $plainParams, $defaults )
298 - . "</nowiki></pre!>";
 296+ . "\n</nowiki>&lt;/pre&gt;";
299297 }
300298 }
301299
Index: trunk/extensions/Validator/includes/ParserHook.php
@@ -236,7 +236,7 @@
237237 $args = func_get_args();
238238
239239 $this->parser = array_shift( $args );
240 -
 240+
241241 return array_merge(
242242 array( $this->validateAndRender( $args, self::TYPE_FUNCTION ) ),
243243 $this->getFunctionOptions()

Status & tagging log