Code Duplication    Length = 12-12 lines in 2 locations

view/SSTemplateParser.php 1 location

@@ 27-38 (lines=12) @@
24
 * @package framework
25
 * @subpackage view
26
 */
27
class SSTemplateParseException extends Exception {
28
29
	function __construct($message, $parser) {
30
		$prior = substr($parser->string, 0, $parser->pos);
31
32
		preg_match_all('/\r\n|\r|\n/', $prior, $matches);
33
		$line = count($matches[0])+1;
34
35
		parent::__construct("Parse error in template on line $line. Error was: $message");
36
	}
37
38
}
39
40
/**
41
  * This is the parser for the SilverStripe template language. It gets called on a string and uses a php-peg parser

view/SSTemplateParser.php.inc 1 location

@@ 48-59 (lines=12) @@
45
 * @package framework
46
 * @subpackage view
47
 */
48
class SSTemplateParseException extends Exception {
49
50
	function __construct($message, $parser) {
51
		$prior = substr($parser->string, 0, $parser->pos);
52
53
		preg_match_all('/\r\n|\r|\n/', $prior, $matches);
54
		$line = count($matches[0])+1;
55
56
		parent::__construct("Parse error in template on line $line. Error was: $message");
57
	}
58
59
}
60
61
/**
62
  * This is the parser for the SilverStripe template language. It gets called on a string and uses a php-peg parser