Index: trunk/extensions/PageObjectModel/POM/LinkParser.php |
— | — | @@ -3,7 +3,7 @@ |
4 | 4 | # Parsing for internal links and annotations |
5 | 5 | # |
6 | 6 | |
7 | | -class POMLinkParser extends POMParser { |
| 7 | +class POMLinkParser implements POMParser { |
8 | 8 | # |
9 | 9 | # This function will parse all POMTextNodes in the page and add POMLink nodes if links are found |
10 | 10 | # |
Index: trunk/extensions/PageObjectModel/POM/Parser.php |
— | — | @@ -4,7 +4,7 @@ |
5 | 5 | # All parsers must subclass this class |
6 | 6 | # |
7 | 7 | |
8 | | -abstract class POMParser |
| 8 | +interface POMParser |
9 | 9 | { |
10 | 10 | /** |
11 | 11 | This is main method for parsers |
Index: trunk/extensions/PageObjectModel/POM/CommentParser.php |
— | — | @@ -3,7 +3,7 @@ |
4 | 4 | # Comment parser looks for comments and puts them in their own elements |
5 | 5 | # |
6 | 6 | |
7 | | -class POMCommentParser extends POMParser { |
| 7 | +class POMCommentParser implements POMParser { |
8 | 8 | # |
9 | 9 | # This function will parse all POMTextNodes in the page and add POMComment nodes if comments are found |
10 | 10 | # |
Index: trunk/extensions/PageObjectModel/POM/TemplateParser.php |
— | — | @@ -3,10 +3,10 @@ |
4 | 4 | # Template class represents templates |
5 | 5 | # |
6 | 6 | |
7 | | -define( "MAX_TEMPLATE_NESTING_LEVEL", 50 ); |
| 7 | +class POMTemplateParser implements POMParser |
| 8 | +{ |
| 9 | + const MAX_TEMPLATE_NESTING_LEVEL = 50; |
8 | 10 | |
9 | | -class POMTemplateParser extends POMParser |
10 | | -{ |
11 | 11 | # |
12 | 12 | # This function will parse all POMTextNodes in the page and add POMTemplate nodes if templates are found |
13 | 13 | # |
— | — | @@ -60,9 +60,9 @@ |
61 | 61 | } |
62 | 62 | |
63 | 63 | // 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 ) |
65 | 65 | { |
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" ); |
67 | 67 | } |
68 | 68 | } while ( $balance > 0 ); // we'll be done with the loop only when found matching chunk |
69 | 69 | |