summaryrefslogtreecommitdiff
path: root/src/ste/ParseCompileError.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/ste/ParseCompileError.php')
-rw-r--r--src/ste/ParseCompileError.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/ste/ParseCompileError.php b/src/ste/ParseCompileError.php
index 33fd612..f5f0272 100644
--- a/src/ste/ParseCompileError.php
+++ b/src/ste/ParseCompileError.php
@@ -2,19 +2,22 @@
namespace kch42\ste;
-class ParseCompileError extends \Exception {
+class ParseCompileError extends \Exception
+{
public $msg;
public $tpl;
public $off;
- public function __construct($msg, $tpl, $offset, $code = 0, $previous = NULL) {
+ public function __construct($msg, $tpl, $offset, $code = 0, $previous = null)
+ {
$this->msg = $msg;
$this->tpl = $tpl;
$this->off = $offset;
$this->message = "$msg (Template $tpl, Offset $offset)";
}
- public function rewrite($code) {
+ public function rewrite($code)
+ {
$line = substr_count(str_replace("\r\n", "\n", substr($code, 0, $this->off)), "\n") + 1;
$this->message = "{$this->msg} (Template {$this->tpl}, Line $line)";
$this->is_rewritten = true;