Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
/**
4
 * Smarty compiler exception class
5
 *
6
 * @package Smarty
7
 */
8
class SmartyCompilerException extends SmartyException
9
{
10
    /**
11
     * The constructor of the exception
12
     *
13
     * @param string         $message  The Exception message to throw.
14
     * @param int            $code     The Exception code.
15
     * @param string|null    $filename The filename where the exception is thrown.
16
     * @param int|null       $line     The line number where the exception is thrown.
17
     * @param Throwable|null $previous The previous exception used for the exception chaining.
18
     */
19
    public function __construct(
20
        string $message = "",
21
        int $code = 0,
22
        ?string $filename = null,
23
        ?int $line = null,
24
        Throwable $previous = null
25
    ) {
26
        parent::__construct($message, $code, $previous);
27
 
28
        // These are optional parameters, should be be overridden only when present!
29
        if ($filename) {
30
            $this->file = $filename;
31
        }
32
        if ($line) {
33
            $this->line = $line;
34
        }
35
    }
36
 
37
    /**
38
     * @return string
39
     */
40
    public function __toString()
41
    {
42
        return ' --> Smarty Compiler: ' . $this->message . ' <-- ';
43
    }
44
 
45
    /**
46
     * @param int $line
47
     */
48
    public function setLine($line)
49
    {
50
        $this->line = $line;
51
    }
52
 
53
    /**
54
     * The template source snippet relating to the error
55
     *
56
     * @type string|null
57
     */
58
    public $source = null;
59
 
60
    /**
61
     * The raw text of the error message
62
     *
63
     * @type string|null
64
     */
65
    public $desc = null;
66
 
67
    /**
68
     * The resource identifier or template name
69
     *
70
     * @type string|null
71
     */
72
    public $template = null;
73
}