1 | <?php |
||
5 | abstract class AbstractToken implements Token |
||
6 | { |
||
7 | /** @var int */ |
||
8 | private $depth; |
||
9 | |||
10 | /** @var int */ |
||
11 | protected $line; |
||
12 | |||
13 | /** @var null|Token */ |
||
14 | private $parent; |
||
15 | |||
16 | /** @var int */ |
||
17 | protected $position; |
||
18 | |||
19 | /** @var boolean */ |
||
20 | private $throwOnError; |
||
21 | |||
22 | /** @var string */ |
||
23 | private $type; |
||
24 | |||
25 | /** @var string */ |
||
26 | protected $value; |
||
27 | |||
28 | /** |
||
29 | * Constructor |
||
30 | */ |
||
31 | public function __construct(string $type, Token $parent = null, bool $throwOnError = false) |
||
49 | |||
50 | public function getDepth() : int |
||
54 | |||
55 | /** |
||
56 | * Getter for 'line'. |
||
57 | */ |
||
58 | public function getLine() : int |
||
62 | |||
63 | public function isClosingElementImplied(string $html) : bool |
||
67 | |||
68 | public function getParent() |
||
72 | |||
73 | /** |
||
74 | * Getter for 'position'. |
||
75 | */ |
||
76 | public function getPosition() : int |
||
80 | |||
81 | /** |
||
82 | * Getter for 'throwOnError'. |
||
83 | * |
||
84 | * @return boolean |
||
85 | */ |
||
86 | protected function getThrowOnError() |
||
90 | |||
91 | /** |
||
92 | * Getter for 'type'. |
||
93 | * |
||
94 | * @return string |
||
95 | */ |
||
96 | public function getType() : string |
||
100 | |||
101 | /** |
||
102 | * Getter for "value" |
||
103 | * |
||
104 | * @return string |
||
105 | */ |
||
106 | public function getValue() : string |
||
110 | |||
111 | public function isCDATA() : bool |
||
115 | |||
116 | public function isComment() : bool |
||
120 | |||
121 | public function isDocType() : bool |
||
125 | |||
126 | public function isElement() : bool |
||
130 | |||
131 | public function isPhp() : bool |
||
135 | |||
136 | public function isText() : bool |
||
140 | |||
141 | protected function isValidType(string $type) : bool |
||
150 | } |
||
151 |