1010final class Token
1111{
1212 // From Twig\Token
13- public const EOF_TYPE = - 1 ;
14- public const TEXT_TYPE = 0 ;
15- public const BLOCK_START_TYPE = 1 ;
16- public const VAR_START_TYPE = 2 ;
17- public const BLOCK_END_TYPE = 3 ;
18- public const VAR_END_TYPE = 4 ;
19- public const NAME_TYPE = 5 ;
20- public const NUMBER_TYPE = 6 ;
21- public const STRING_TYPE = 7 ;
22- public const OPERATOR_TYPE = 8 ;
23- public const PUNCTUATION_TYPE = 9 ;
24- public const INTERPOLATION_START_TYPE = 10 ;
25- public const INTERPOLATION_END_TYPE = 11 ;
26- public const ARROW_TYPE = 12 ;
27- public const SPREAD_TYPE = 13 ;
13+ public const EOF_TYPE = ' EOF_TYPE ' ;
14+ public const TEXT_TYPE = ' TEXT_TYPE ' ;
15+ public const BLOCK_START_TYPE = ' BLOCK_START_TYPE ' ;
16+ public const VAR_START_TYPE = ' VAR_START_TYPE ' ;
17+ public const BLOCK_END_TYPE = ' BLOCK_END_TYPE ' ;
18+ public const VAR_END_TYPE = ' VAR_END_TYPE ' ;
19+ public const NAME_TYPE = ' NAME_TYPE ' ;
20+ public const NUMBER_TYPE = ' NUMBER_TYPE ' ;
21+ public const STRING_TYPE = ' STRING_TYPE ' ;
22+ public const OPERATOR_TYPE = ' OPERATOR_TYPE ' ;
23+ public const PUNCTUATION_TYPE = ' PUNCTUATION_TYPE ' ;
24+ public const INTERPOLATION_START_TYPE = ' INTERPOLATION_START_TYPE ' ;
25+ public const INTERPOLATION_END_TYPE = ' INTERPOLATION_END_TYPE ' ;
26+ public const ARROW_TYPE = ' ARROW_TYPE ' ;
27+ public const SPREAD_TYPE = ' SPREAD_TYPE ' ;
2828 // New constants
2929 public const DQ_STRING_START_TYPE = 'DQ_STRING_START_TYPE ' ;
3030 public const DQ_STRING_END_TYPE = 'DQ_STRING_END_TYPE ' ;
@@ -94,7 +94,7 @@ final class Token
9494 ];
9595
9696 public function __construct (
97- private int | string $ type ,
97+ private string $ type ,
9898 private int $ line ,
9999 private int $ linePosition ,
100100 private string $ filename ,
@@ -103,12 +103,12 @@ public function __construct(
103103 ) {
104104 }
105105
106- public function getType (): int | string
106+ public function getType (): string
107107 {
108108 return $ this ->type ;
109109 }
110110
111- public function setType (int | string $ type ): void
111+ public function setType (string $ type ): void
112112 {
113113 $ this ->type = $ type ;
114114 }
@@ -144,10 +144,10 @@ public function setRelatedToken(self $token): void
144144 }
145145
146146 /**
147- * @param int| string|array<int| string> $type
148- * @param string|string[] $value
147+ * @param string|string[] $type
148+ * @param string|string[] $value
149149 */
150- public function isMatching (int | string |array $ type , string |array $ value = []): bool
150+ public function isMatching (string |array $ type , string |array $ value = []): bool
151151 {
152152 if (!\is_array ($ type )) {
153153 $ type = [$ type ];
0 commit comments