aboutsummaryrefslogtreecommitdiff
path: root/lib/exTpl/TemplateParserException.php
blob: 2c7abf88f7227ead22c66161d3904c829aa61c89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php

namespace exTpl;

use Exception;

/**
 * Exception class used to report template parse errors.
 */
class TemplateParserException extends Exception
{
    public function __construct(string $message, Scanner $scanner)
    {
        $type  = $scanner->tokenType();
        $value = is_int($type) ? $scanner->tokenValue() : $type;

        return parent::__construct("$message at \"$value\"");
    }
}