forked from spoon/template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSyntaxError.php
More file actions
42 lines (37 loc) · 785 Bytes
/
SyntaxError.php
File metadata and controls
42 lines (37 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/*
* This file is part of Spoon Library.
*
* (c) Davy Hellemans <davy@spoon-library.com>
*
* For the full copyright and license information, please view the license
* file that was distributed with this source code.
*/
namespace Spoon\Template;
/**
* Exception for syntax errors.
*
* @author Davy Hellemans <davy@spoon-library.com>
*/
class SyntaxError extends \Exception
{
/**
* @param string $message
* @param int[optional] $line
* @param string[optional] $filename
*/
public function __construct($message, $line = null, $filename = null)
{
// add line number
if($line !== null)
{
$message .= " on line $line";
}
// add optional filename
if($filename !== null)
{
$message .= ' in ' . $filename;
}
parent::__construct($message);
}
}