|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
/** |
|
6
|
|
|
* Hoa |
|
7
|
|
|
* |
|
8
|
|
|
* |
|
9
|
|
|
* |
|
10
|
|
|
* |
|
11
|
|
|
* BSD 3-Clause License |
|
12
|
|
|
* |
|
13
|
|
|
* Copyright © 2007-2017, Hoa community. All rights reserved. |
|
14
|
|
|
* |
|
15
|
|
|
* Redistribution and use in source and binary forms, with or without |
|
16
|
|
|
* modification, are permitted provided that the following conditions are met: |
|
17
|
|
|
* |
|
18
|
|
|
* 1. Redistributions of source code must retain the above copyright notice, this |
|
19
|
|
|
* list of conditions and the following disclaimer. |
|
20
|
|
|
* |
|
21
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright notice, |
|
22
|
|
|
* this list of conditions and the following disclaimer in the documentation |
|
23
|
|
|
* and/or other materials provided with the distribution. |
|
24
|
|
|
* |
|
25
|
|
|
* 3. Neither the name of the copyright holder nor the names of its |
|
26
|
|
|
* contributors may be used to endorse or promote products derived from |
|
27
|
|
|
* this software without specific prior written permission. |
|
28
|
|
|
* |
|
29
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
|
30
|
|
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
|
31
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
|
32
|
|
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
|
33
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
|
34
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
|
35
|
|
|
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
|
36
|
|
|
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
|
37
|
|
|
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
|
38
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
39
|
|
|
*/ |
|
40
|
|
|
|
|
41
|
|
|
namespace JMS\Serializer\Type\Compiler\Exception; |
|
42
|
|
|
|
|
43
|
|
|
use JMS\Serializer\Type\Compiler\Exception; |
|
44
|
|
|
|
|
45
|
|
|
/** |
|
46
|
|
|
* Class \JMS\Serializer\Type\Compiler\Exception\UnrecognizedToken. |
|
47
|
|
|
* |
|
48
|
|
|
* Extending the \JMS\Serializer\Type\Compiler\Exception class. |
|
49
|
|
|
*/ |
|
50
|
|
|
class UnrecognizedToken extends Exception |
|
51
|
|
|
{ |
|
52
|
|
|
/** |
|
53
|
|
|
* Column. |
|
54
|
|
|
* |
|
55
|
|
|
* @var int |
|
56
|
|
|
*/ |
|
57
|
|
|
protected $column = 0; |
|
58
|
|
|
|
|
59
|
|
|
|
|
60
|
|
|
|
|
61
|
|
|
/** |
|
62
|
|
|
* Override line and add column support. |
|
63
|
|
|
* |
|
64
|
|
|
* @param string $message Formatted message. |
|
65
|
|
|
* @param int $code Code (the ID). |
|
66
|
|
|
* @param array $arg RaiseError string arguments. |
|
67
|
|
|
* @param int $line Line. |
|
68
|
|
|
* @param int $column Column. |
|
69
|
|
|
*/ |
|
70
|
|
|
public function __construct(string $message, int $code, array $arg, int $line, int $column) |
|
71
|
|
|
{ |
|
72
|
|
|
parent::__construct($message, $code, $arg); |
|
73
|
|
|
|
|
74
|
|
|
$this->line = $line; |
|
75
|
|
|
$this->column = $column; |
|
76
|
|
|
|
|
77
|
|
|
return; |
|
78
|
|
|
} |
|
79
|
|
|
|
|
80
|
|
|
/** |
|
81
|
|
|
* Get column. |
|
82
|
|
|
*/ |
|
83
|
|
|
public function getColumn(): int |
|
84
|
|
|
{ |
|
85
|
|
|
return $this->column; |
|
86
|
|
|
} |
|
87
|
|
|
} |
|
88
|
|
|
|