@@ -37,7 +37,7 @@ class ParserState
37
37
/**
38
38
* @var int
39
39
*/
40
- private $ iCurrentPosition = 0 ;
40
+ private $ currentPosition = 0 ;
41
41
42
42
/**
43
43
* will only be used if the CSS does not contain an `@charset` declaration
@@ -95,7 +95,7 @@ public function currentLine()
95
95
*/
96
96
public function currentColumn ()
97
97
{
98
- return $ this ->iCurrentPosition ;
98
+ return $ this ->currentPosition ;
99
99
}
100
100
101
101
/**
@@ -108,15 +108,15 @@ public function getSettings()
108
108
109
109
public function anchor (): Anchor
110
110
{
111
- return new Anchor ($ this ->iCurrentPosition , $ this );
111
+ return new Anchor ($ this ->currentPosition , $ this );
112
112
}
113
113
114
114
/**
115
115
* @param int $position
116
116
*/
117
117
public function setPosition ($ position ): void
118
118
{
119
- $ this ->iCurrentPosition = $ position ;
119
+ $ this ->currentPosition = $ position ;
120
120
}
121
121
122
122
/**
@@ -233,7 +233,7 @@ public function consumeWhiteSpace(): array
233
233
try {
234
234
$ oComment = $ this ->consumeComment ();
235
235
} catch (UnexpectedEOFException $ e ) {
236
- $ this ->iCurrentPosition = $ this ->iLength ;
236
+ $ this ->currentPosition = $ this ->iLength ;
237
237
return $ comments ;
238
238
}
239
239
} else {
@@ -264,7 +264,7 @@ public function comes($sString, $bCaseInsensitive = false): bool
264
264
*/
265
265
public function peek ($ iLength = 1 , $ iOffset = 0 ): string
266
266
{
267
- $ iOffset += $ this ->iCurrentPosition ;
267
+ $ iOffset += $ this ->currentPosition ;
268
268
if ($ iOffset >= $ this ->iLength ) {
269
269
return '' ;
270
270
}
@@ -282,7 +282,7 @@ public function consume($mValue = 1): string
282
282
if (\is_string ($ mValue )) {
283
283
$ iLineCount = \substr_count ($ mValue , "\n" );
284
284
$ iLength = $ this ->strlen ($ mValue );
285
- if (!$ this ->streql ($ this ->substr ($ this ->iCurrentPosition , $ iLength ), $ mValue )) {
285
+ if (!$ this ->streql ($ this ->substr ($ this ->currentPosition , $ iLength ), $ mValue )) {
286
286
throw new UnexpectedTokenException (
287
287
$ mValue ,
288
288
$ this ->peek (\max ($ iLength , 5 )),
@@ -291,16 +291,16 @@ public function consume($mValue = 1): string
291
291
);
292
292
}
293
293
$ this ->lineNumber += $ iLineCount ;
294
- $ this ->iCurrentPosition += $ this ->strlen ($ mValue );
294
+ $ this ->currentPosition += $ this ->strlen ($ mValue );
295
295
return $ mValue ;
296
296
} else {
297
- if ($ this ->iCurrentPosition + $ mValue > $ this ->iLength ) {
297
+ if ($ this ->currentPosition + $ mValue > $ this ->iLength ) {
298
298
throw new UnexpectedEOFException ((string ) $ mValue , $ this ->peek (5 ), 'count ' , $ this ->lineNumber );
299
299
}
300
- $ result = $ this ->substr ($ this ->iCurrentPosition , $ mValue );
300
+ $ result = $ this ->substr ($ this ->currentPosition , $ mValue );
301
301
$ iLineCount = \substr_count ($ result , "\n" );
302
302
$ this ->lineNumber += $ iLineCount ;
303
- $ this ->iCurrentPosition += $ mValue ;
303
+ $ this ->currentPosition += $ mValue ;
304
304
return $ result ;
305
305
}
306
306
}
@@ -351,7 +351,7 @@ public function consumeComment()
351
351
352
352
public function isEnd (): bool
353
353
{
354
- return $ this ->iCurrentPosition >= $ this ->iLength ;
354
+ return $ this ->currentPosition >= $ this ->iLength ;
355
355
}
356
356
357
357
/**
@@ -367,15 +367,15 @@ public function consumeUntil($aEnd, $bIncludeEnd = false, $consumeEnd = false, a
367
367
{
368
368
$ aEnd = \is_array ($ aEnd ) ? $ aEnd : [$ aEnd ];
369
369
$ out = '' ;
370
- $ start = $ this ->iCurrentPosition ;
370
+ $ start = $ this ->currentPosition ;
371
371
372
372
while (!$ this ->isEnd ()) {
373
373
$ char = $ this ->consume (1 );
374
374
if (\in_array ($ char , $ aEnd , true )) {
375
375
if ($ bIncludeEnd ) {
376
376
$ out .= $ char ;
377
377
} elseif (!$ consumeEnd ) {
378
- $ this ->iCurrentPosition -= $ this ->strlen ($ char );
378
+ $ this ->currentPosition -= $ this ->strlen ($ char );
379
379
}
380
380
return $ out ;
381
381
}
@@ -389,7 +389,7 @@ public function consumeUntil($aEnd, $bIncludeEnd = false, $consumeEnd = false, a
389
389
return $ out ;
390
390
}
391
391
392
- $ this ->iCurrentPosition = $ start ;
392
+ $ this ->currentPosition = $ start ;
393
393
throw new UnexpectedEOFException (
394
394
'One of (" ' . \implode ('"," ' , $ aEnd ) . '") ' ,
395
395
$ this ->peek (5 ),
@@ -400,7 +400,7 @@ public function consumeUntil($aEnd, $bIncludeEnd = false, $consumeEnd = false, a
400
400
401
401
private function inputLeft (): string
402
402
{
403
- return $ this ->substr ($ this ->iCurrentPosition , -1 );
403
+ return $ this ->substr ($ this ->currentPosition , -1 );
404
404
}
405
405
406
406
/**
@@ -422,7 +422,7 @@ public function streql($sString1, $sString2, $bCaseInsensitive = true): bool
422
422
*/
423
423
public function backtrack ($ iAmount ): void
424
424
{
425
- $ this ->iCurrentPosition -= $ iAmount ;
425
+ $ this ->currentPosition -= $ iAmount ;
426
426
}
427
427
428
428
/**
0 commit comments