r92074 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92073‎ | r92074 | r92075 >
Date:18:26, 13 July 2011
Author:demon
Status:deferred
Tags:
Comment:
Resolve fixme on r56094: Cannot have abstract static functions in a class. Turned it to an interface--of course static interfaces are kind of debatable, but at least this doesn't give errors. Also moved global-scoped define to class constant.
Modified paths:
  • /trunk/extensions/PageObjectModel/POM/CommentParser.php (modified) (history)
  • /trunk/extensions/PageObjectModel/POM/LinkParser.php (modified) (history)
  • /trunk/extensions/PageObjectModel/POM/Parser.php (modified) (history)
  • /trunk/extensions/PageObjectModel/POM/TemplateParser.php (modified) (history)

Diff [purge]

Index: trunk/extensions/PageObjectModel/POM/LinkParser.php
@@ -3,7 +3,7 @@
44 # Parsing for internal links and annotations
55 #
66
7 -class POMLinkParser extends POMParser {
 7+class POMLinkParser implements POMParser {
88 #
99 # This function will parse all POMTextNodes in the page and add POMLink nodes if links are found
1010 #
Index: trunk/extensions/PageObjectModel/POM/Parser.php
@@ -4,7 +4,7 @@
55 # All parsers must subclass this class
66 #
77
8 -abstract class POMParser
 8+interface POMParser
99 {
1010 /**
1111 This is main method for parsers
Index: trunk/extensions/PageObjectModel/POM/CommentParser.php
@@ -3,7 +3,7 @@
44 # Comment parser looks for comments and puts them in their own elements
55 #
66
7 -class POMCommentParser extends POMParser {
 7+class POMCommentParser implements POMParser {
88 #
99 # This function will parse all POMTextNodes in the page and add POMComment nodes if comments are found
1010 #
Index: trunk/extensions/PageObjectModel/POM/TemplateParser.php
@@ -3,10 +3,10 @@
44 # Template class represents templates
55 #
66
7 -define( "MAX_TEMPLATE_NESTING_LEVEL", 50 );
 7+class POMTemplateParser implements POMParser
 8+{
 9+ const MAX_TEMPLATE_NESTING_LEVEL = 50;
810
9 -class POMTemplateParser extends POMParser
10 -{
1111 #
1212 # This function will parse all POMTextNodes in the page and add POMTemplate nodes if templates are found
1313 #
@@ -60,9 +60,9 @@
6161 }
6262
6363 // In case something is wrong and we recursed too deep, die.
64 - if ( $balance > MAX_TEMPLATE_NESTING_LEVEL )
 64+ if ( $balance > self::MAX_TEMPLATE_NESTING_LEVEL )
6565 {
66 - die( '[ERROR] Reached maximum template nesting level of ' . MAX_TEMPLATE_NESTING_LEVEL . ". Something is probably wrong with POM, please report this problem to developers.\n" );
 66+ die( '[ERROR] Reached maximum template nesting level of ' . self::MAX_TEMPLATE_NESTING_LEVEL . ". Something is probably wrong with POM, please report this problem to developers.\n" );
6767 }
6868 } while ( $balance > 0 ); // we'll be done with the loop only when found matching chunk
6969

Follow-up revisions

RevisionCommit summaryAuthorDate
r93432* (bug 30107) [PageObjectModel] Error "Access type for interface method POMPa...reedy21:25, 28 July 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r56094Moved extension over from Google Code (http://mediawiki-page-object-model.goo...sergeychernyshev14:59, 9 September 2009

Status & tagging log