diff options
author | Laria Carolin Chabowski <laria@laria.me> | 2020-04-30 09:38:05 +0200 |
---|---|---|
committer | Laria Carolin Chabowski <laria@laria.me> | 2020-04-30 09:38:25 +0200 |
commit | 2381c52c690342f773a7cfa500387b6bfad76952 (patch) | |
tree | 340296ea529e40b81012c936703429a86481788e /src/ste/ParseCompileError.php | |
parent | 2d26169b367af60cbc03d417c09918f50aa3b882 (diff) | |
download | ste-2381c52c690342f773a7cfa500387b6bfad76952.tar.gz ste-2381c52c690342f773a7cfa500387b6bfad76952.tar.bz2 ste-2381c52c690342f773a7cfa500387b6bfad76952.zip |
Automatic code formatting
Also add git hooks that checks formatting
Diffstat (limited to 'src/ste/ParseCompileError.php')
-rw-r--r-- | src/ste/ParseCompileError.php | 9 |
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; |