1414class TokenStreamTest extends TestCase
1515{
1616 private const SOURCE = 'tokens.php ' ;
17- private const PHP_7_SIZE = 116 ;
1817 private const PHP_8_SIZE = 105 ;
1918
2019 /**
@@ -29,7 +28,6 @@ protected function setUp(): void
2928
3029 public function typeProvider (): array
3130 {
32- if (version_compare (PHP_VERSION , '8.0.0 ' ) >= 0 ) {
3331 return [
3432 [0 , T_OPEN_TAG ],
3533 [1 , T_NAMESPACE ],
@@ -38,17 +36,6 @@ public function typeProvider(): array
3836 [self ::PHP_8_SIZE , null , \OutOfBoundsException::class],
3937 [32 , T_PRIVATE ],
4038 ];
41- }
42-
43- // before php7
44- return [
45- [0 , T_OPEN_TAG ],
46- [1 , T_NAMESPACE ],
47- [10 , '; ' ],
48- [-1 , null , \OutOfBoundsException::class],
49- [self ::PHP_7_SIZE , null , \OutOfBoundsException::class],
50- [42 , T_PRIVATE ],
51- ];
5239 }
5340
5441 /**
@@ -78,7 +65,6 @@ public function testType($loc, $type, $exception = null): void
7865
7966 public function valueProvider (): array
8067 {
81- if (version_compare (PHP_VERSION , '8.0.0 ' ) >= 0 ) {
8268 return [
8369 [0 , "<?php \n" ],
8470 [1 , 'namespace ' ],
@@ -88,17 +74,6 @@ public function valueProvider(): array
8874 [self ::PHP_8_SIZE , null , \OutOfBoundsException::class],
8975 [32 , 'private ' ],
9076 ];
91- }
92- // before php7
93- return [
94- [0 , "<?php \n" ],
95- [1 , 'namespace ' ],
96- [7 , 'AccessorGenerator ' ],
97- [10 , '; ' ],
98- [-1 , null , \OutOfBoundsException::class],
99- [self ::PHP_7_SIZE , null , \OutOfBoundsException::class],
100- [42 , 'private ' ],
101- ];
10277 }
10378
10479 /**
@@ -115,7 +90,6 @@ public function testValue($loc, $value, $exception = null): void
11590
11691 public function scanProvider (): array
11792 {
118- if (version_compare (PHP_VERSION , '8.0.0 ' ) >= 0 ) {
11993 return [
12094 // Boundary Checks
12195 [[], -2 , null , \OutOfBoundsException::class],
@@ -134,26 +108,6 @@ public function scanProvider(): array
134108 // Test a token that is there to find
135109 [[T_PRIVATE ], 0 , 32 ],
136110 ];
137- }
138- // before php8
139- return [
140- // Boundary Checks
141- [[], -2 , null , \OutOfBoundsException::class],
142- [[], -1 , null ],
143- [[], 0 , null ],
144- [[], self ::PHP_7_SIZE , null , \OutOfBoundsException::class],
145- [[], self ::PHP_7_SIZE - 1 , null ],
146-
147- // Scan does not probe current value.
148- [[T_OPEN_TAG ], -1 , 0 ],
149- [[T_OPEN_TAG ], 0 , null ],
150-
151- // Able to find last item
152- [[T_WHITESPACE ], self ::PHP_7_SIZE - 2 , self ::PHP_7_SIZE - 1 ],
153-
154- // Test a token that is there to find
155- [[T_PRIVATE ], 0 , 42 ],
156- ];
157111 }
158112
159113 /**
@@ -171,7 +125,6 @@ public function testScan(array $tokens, $input_loc, $output_loc, $exception = nu
171125
172126 public function nextProvider (): array
173127 {
174- if (version_compare (PHP_VERSION , '8.0.0 ' ) >= 0 ) {
175128 return [
176129 // Boundary checks
177130 [-2 , null , [], \OutOfBoundsException::class],
@@ -188,25 +141,6 @@ public function nextProvider(): array
188141 // Scan when no available maches can be found
189142 [self ::PHP_8_SIZE - 2 , null ],
190143 ];
191- }
192-
193- // Before php8
194- return [
195- // Boundary checks
196- [-2 , null , [], \OutOfBoundsException::class],
197- [-1 , 0 , []],
198- [0 , 1 , []],
199- [self ::PHP_7_SIZE , null , [], \OutOfBoundsException::class],
200- [self ::PHP_7_SIZE - 1 , null , []],
201- [self ::PHP_7_SIZE - 2 , self ::PHP_7_SIZE - 1 , []],
202-
203- // Scan from private keyword on line 9
204- [42 , 44 ],
205- [42 , 46 , [T_WHITESPACE , T_CONST ]],
206-
207- // Scan when no available maches can be found
208- [self ::PHP_7_SIZE - 2 , null ],
209- ];
210144 }
211145
212146 /**
@@ -228,7 +162,6 @@ public function testNext($input_loc, $output_loc, array $tokens = null, $excepti
228162
229163 public function previousProvider (): array
230164 {
231- if (version_compare (PHP_VERSION , '8.0.0 ' ) >= 0 ) {
232165 return [
233166 // Boundary checks
234167 [-1 , null , [], \OutOfBoundsException::class],
@@ -246,26 +179,6 @@ public function previousProvider(): array
246179 [3 , null , [T_NAMESPACE , T_NS_SEPARATOR , T_WHITESPACE , T_STRING , T_OPEN_TAG ]],
247180
248181 ];
249- }
250-
251- // before php8
252- return [
253- // Boundary checks
254- [-1 , null , [], \OutOfBoundsException::class],
255- [0 , null , []],
256- [1 , 0 , []],
257- [self ::PHP_7_SIZE + 1 , null , [], \OutOfBoundsException::class],
258- [self ::PHP_7_SIZE , self ::PHP_7_SIZE - 1 , []],
259- [self ::PHP_7_SIZE - 1 , self ::PHP_7_SIZE - 2 , []],
260-
261- // Scan from private keyword on line 9
262- [44 , 42 ], // Skip white space
263- [46 , 42 , [T_WHITESPACE , T_CONST ]],
264- [41 , 40 , [T_PUBLIC , T_PRIVATE ]],
265-
266- // Scan when no available maches can be found
267- [5 , null , [T_NAMESPACE , T_NS_SEPARATOR , T_WHITESPACE , T_STRING , T_OPEN_TAG ]],
268- ];
269182 }
270183
271184 /**
0 commit comments