@@ -49,7 +49,7 @@ class ParserState
4949 /**
5050 * @var int
5151 */
52- private $ iLength ;
52+ private $ length ;
5353
5454 /**
5555 * @var int
@@ -78,7 +78,7 @@ public function setCharset($charset): void
7878 $ this ->charset = $ charset ;
7979 $ this ->characters = $ this ->strsplit ($ this ->text );
8080 if (\is_array ($ this ->characters )) {
81- $ this ->iLength = \count ($ this ->characters );
81+ $ this ->length = \count ($ this ->characters );
8282 }
8383 }
8484
@@ -233,7 +233,7 @@ public function consumeWhiteSpace(): array
233233 try {
234234 $ oComment = $ this ->consumeComment ();
235235 } catch (UnexpectedEOFException $ e ) {
236- $ this ->currentPosition = $ this ->iLength ;
236+ $ this ->currentPosition = $ this ->length ;
237237 return $ comments ;
238238 }
239239 } else {
@@ -259,16 +259,16 @@ public function comes($sString, $bCaseInsensitive = false): bool
259259 }
260260
261261 /**
262- * @param int $iLength
262+ * @param int $length
263263 * @param int $iOffset
264264 */
265- public function peek ($ iLength = 1 , $ iOffset = 0 ): string
265+ public function peek ($ length = 1 , $ iOffset = 0 ): string
266266 {
267267 $ iOffset += $ this ->currentPosition ;
268- if ($ iOffset >= $ this ->iLength ) {
268+ if ($ iOffset >= $ this ->length ) {
269269 return '' ;
270270 }
271- return $ this ->substr ($ iOffset , $ iLength );
271+ return $ this ->substr ($ iOffset , $ length );
272272 }
273273
274274 /**
@@ -281,11 +281,11 @@ public function consume($mValue = 1): string
281281 {
282282 if (\is_string ($ mValue )) {
283283 $ iLineCount = \substr_count ($ mValue , "\n" );
284- $ iLength = $ this ->strlen ($ mValue );
285- if (!$ this ->streql ($ this ->substr ($ this ->currentPosition , $ iLength ), $ mValue )) {
284+ $ length = $ this ->strlen ($ mValue );
285+ if (!$ this ->streql ($ this ->substr ($ this ->currentPosition , $ length ), $ mValue )) {
286286 throw new UnexpectedTokenException (
287287 $ mValue ,
288- $ this ->peek (\max ($ iLength , 5 )),
288+ $ this ->peek (\max ($ length , 5 )),
289289 'literal ' ,
290290 $ this ->lineNumber
291291 );
@@ -294,7 +294,7 @@ public function consume($mValue = 1): string
294294 $ this ->currentPosition += $ this ->strlen ($ mValue );
295295 return $ mValue ;
296296 } else {
297- if ($ this ->currentPosition + $ mValue > $ this ->iLength ) {
297+ if ($ this ->currentPosition + $ mValue > $ this ->length ) {
298298 throw new UnexpectedEOFException ((string ) $ mValue , $ this ->peek (5 ), 'count ' , $ this ->lineNumber );
299299 }
300300 $ result = $ this ->substr ($ this ->currentPosition , $ mValue );
@@ -351,7 +351,7 @@ public function consumeComment()
351351
352352 public function isEnd (): bool
353353 {
354- return $ this ->currentPosition >= $ this ->iLength ;
354+ return $ this ->currentPosition >= $ this ->length ;
355355 }
356356
357357 /**
@@ -439,21 +439,21 @@ public function strlen($sString): int
439439
440440 /**
441441 * @param int $iStart
442- * @param int $iLength
442+ * @param int $length
443443 */
444- private function substr ($ iStart , $ iLength ): string
444+ private function substr ($ iStart , $ length ): string
445445 {
446- if ($ iLength < 0 ) {
447- $ iLength = $ this ->iLength - $ iStart + $ iLength ;
446+ if ($ length < 0 ) {
447+ $ length = $ this ->length - $ iStart + $ length ;
448448 }
449- if ($ iStart + $ iLength > $ this ->iLength ) {
450- $ iLength = $ this ->iLength - $ iStart ;
449+ if ($ iStart + $ length > $ this ->length ) {
450+ $ length = $ this ->length - $ iStart ;
451451 }
452452 $ result = '' ;
453- while ($ iLength > 0 ) {
453+ while ($ length > 0 ) {
454454 $ result .= $ this ->characters [$ iStart ];
455455 $ iStart ++;
456- $ iLength --;
456+ $ length --;
457457 }
458458 return $ result ;
459459 }
@@ -481,9 +481,9 @@ private function strsplit($sString)
481481 if ($ this ->streql ($ this ->charset , 'utf-8 ' )) {
482482 return \preg_split ('//u ' , $ sString , -1 , PREG_SPLIT_NO_EMPTY );
483483 } else {
484- $ iLength = \mb_strlen ($ sString , $ this ->charset );
484+ $ length = \mb_strlen ($ sString , $ this ->charset );
485485 $ result = [];
486- for ($ i = 0 ; $ i < $ iLength ; ++$ i ) {
486+ for ($ i = 0 ; $ i < $ length ; ++$ i ) {
487487 $ result [] = \mb_substr ($ sString , $ i , 1 , $ this ->charset );
488488 }
489489 return $ result ;
0 commit comments