Skip to content

Commit 819a0af

Browse files
committed
[CLEANUP] Avoid Hungarian notation for iLineNo
Part of #756
1 parent 98e4204 commit 819a0af

25 files changed

+113
-113
lines changed

src/CSSList/CSSList.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,16 @@ abstract class CSSList implements Renderable, Commentable
4646
/**
4747
* @var int
4848
*/
49-
protected $iLineNo;
49+
protected $lineNumber;
5050

5151
/**
52-
* @param int $iLineNo
52+
* @param int $lineNumber
5353
*/
54-
public function __construct($iLineNo = 0)
54+
public function __construct($lineNumber = 0)
5555
{
5656
$this->comments = [];
5757
$this->aContents = [];
58-
$this->iLineNo = $iLineNo;
58+
$this->lineNumber = $lineNumber;
5959
}
6060

6161
/**
@@ -255,7 +255,7 @@ private static function identifierIs($sIdentifier, string $sMatch): bool
255255
*/
256256
public function getLineNo()
257257
{
258-
return $this->iLineNo;
258+
return $this->lineNumber;
259259
}
260260

261261
/**

src/CSSList/Document.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
class Document extends CSSBlockList
2020
{
2121
/**
22-
* @param int $iLineNo
22+
* @param int $lineNumber
2323
*/
24-
public function __construct($iLineNo = 0)
24+
public function __construct($lineNumber = 0)
2525
{
26-
parent::__construct($iLineNo);
26+
parent::__construct($lineNumber);
2727
}
2828

2929
/**

src/CSSList/KeyFrame.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ class KeyFrame extends CSSList implements AtRule
2020
private $animationName;
2121

2222
/**
23-
* @param int $iLineNo
23+
* @param int $lineNumber
2424
*/
25-
public function __construct($iLineNo = 0)
25+
public function __construct($lineNumber = 0)
2626
{
27-
parent::__construct($iLineNo);
27+
parent::__construct($lineNumber);
2828
$this->vendorKeyFrame = null;
2929
$this->animationName = null;
3030
}

src/Parser.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ class Parser
2121
/**
2222
* @param string $sText the complete CSS as text (i.e., usually the contents of a CSS file)
2323
* @param Settings|null $oParserSettings
24-
* @param int $iLineNo the line number (starting from 1, not from 0)
24+
* @param int $lineNumber the line number (starting from 1, not from 0)
2525
*/
26-
public function __construct($sText, ?Settings $oParserSettings = null, $iLineNo = 1)
26+
public function __construct($sText, ?Settings $oParserSettings = null, $lineNumber = 1)
2727
{
2828
if ($oParserSettings === null) {
2929
$oParserSettings = Settings::create();
3030
}
31-
$this->oParserState = new ParserState($sText, $oParserSettings, $iLineNo);
31+
$this->oParserState = new ParserState($sText, $oParserSettings, $lineNumber);
3232
}
3333

3434
/**

src/Parsing/OutputException.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ final class OutputException extends SourceException
1111
{
1212
/**
1313
* @param string $sMessage
14-
* @param int $iLineNo
14+
* @param int $lineNumber
1515
*/
16-
public function __construct($sMessage, $iLineNo = 0)
16+
public function __construct($sMessage, $lineNumber = 0)
1717
{
18-
parent::__construct($sMessage, $iLineNo);
18+
parent::__construct($sMessage, $lineNumber);
1919
}
2020
}

src/Parsing/ParserState.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,18 @@ class ParserState
5454
/**
5555
* @var int
5656
*/
57-
private $iLineNo;
57+
private $lineNumber;
5858

5959
/**
6060
* @param string $sText the complete CSS as text (i.e., usually the contents of a CSS file)
61-
* @param int $iLineNo
61+
* @param int $lineNumber
6262
*/
63-
public function __construct($sText, Settings $oParserSettings, $iLineNo = 1)
63+
public function __construct($sText, Settings $oParserSettings, $lineNumber = 1)
6464
{
6565
$this->oParserSettings = $oParserSettings;
6666
$this->sText = $sText;
6767
$this->iCurrentPosition = 0;
68-
$this->iLineNo = $iLineNo;
68+
$this->lineNumber = $lineNumber;
6969
$this->setCharset($this->oParserSettings->sDefaultCharset);
7070
}
7171

@@ -98,7 +98,7 @@ public function getCharset()
9898
*/
9999
public function currentLine()
100100
{
101-
return $this->iLineNo;
101+
return $this->lineNumber;
102102
}
103103

104104
/**
@@ -140,11 +140,11 @@ public function setPosition($iPosition): void
140140
public function parseIdentifier($bIgnoreCase = true)
141141
{
142142
if ($this->isEnd()) {
143-
throw new UnexpectedEOFException('', '', 'identifier', $this->iLineNo);
143+
throw new UnexpectedEOFException('', '', 'identifier', $this->lineNumber);
144144
}
145145
$sResult = $this->parseCharacter(true);
146146
if ($sResult === null) {
147-
throw new UnexpectedTokenException($sResult, $this->peek(5), 'identifier', $this->iLineNo);
147+
throw new UnexpectedTokenException($sResult, $this->peek(5), 'identifier', $this->lineNumber);
148148
}
149149
$sCharacter = null;
150150
while (!$this->isEnd() && ($sCharacter = $this->parseCharacter(true)) !== null) {
@@ -290,18 +290,18 @@ public function consume($mValue = 1): string
290290
$iLineCount = \substr_count($mValue, "\n");
291291
$iLength = $this->strlen($mValue);
292292
if (!$this->streql($this->substr($this->iCurrentPosition, $iLength), $mValue)) {
293-
throw new UnexpectedTokenException($mValue, $this->peek(\max($iLength, 5)), $this->iLineNo);
293+
throw new UnexpectedTokenException($mValue, $this->peek(\max($iLength, 5)), $this->lineNumber);
294294
}
295-
$this->iLineNo += $iLineCount;
295+
$this->lineNumber += $iLineCount;
296296
$this->iCurrentPosition += $this->strlen($mValue);
297297
return $mValue;
298298
} else {
299299
if ($this->iCurrentPosition + $mValue > $this->iLength) {
300-
throw new UnexpectedEOFException($mValue, $this->peek(5), 'count', $this->iLineNo);
300+
throw new UnexpectedEOFException($mValue, $this->peek(5), 'count', $this->lineNumber);
301301
}
302302
$sResult = $this->substr($this->iCurrentPosition, $mValue);
303303
$iLineCount = \substr_count($sResult, "\n");
304-
$this->iLineNo += $iLineCount;
304+
$this->lineNumber += $iLineCount;
305305
$this->iCurrentPosition += $mValue;
306306
return $sResult;
307307
}
@@ -321,7 +321,7 @@ public function consumeExpression($mExpression, $iMaxLength = null): string
321321
if (\preg_match($mExpression, $sInput, $aMatches, PREG_OFFSET_CAPTURE) === 1) {
322322
return $this->consume($aMatches[0][0]);
323323
}
324-
throw new UnexpectedTokenException($mExpression, $this->peek(5), 'expression', $this->iLineNo);
324+
throw new UnexpectedTokenException($mExpression, $this->peek(5), 'expression', $this->lineNumber);
325325
}
326326

327327
/**
@@ -331,7 +331,7 @@ public function consumeComment()
331331
{
332332
$mComment = false;
333333
if ($this->comes('/*')) {
334-
$iLineNo = $this->iLineNo;
334+
$lineNumber = $this->lineNumber;
335335
$this->consume(1);
336336
$mComment = '';
337337
while (($char = $this->consume(1)) !== '') {
@@ -345,7 +345,7 @@ public function consumeComment()
345345

346346
if ($mComment !== false) {
347347
// We skip the * which was included in the comment.
348-
return new Comment(\substr($mComment, 1), $iLineNo);
348+
return new Comment(\substr($mComment, 1), $lineNumber);
349349
}
350350

351351
return $mComment;
@@ -396,7 +396,7 @@ public function consumeUntil($aEnd, $bIncludeEnd = false, $consumeEnd = false, a
396396
'One of ("' . \implode('","', $aEnd) . '")',
397397
$this->peek(5),
398398
'search',
399-
$this->iLineNo
399+
$this->lineNumber
400400
);
401401
}
402402

src/Parsing/SourceException.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ class SourceException extends \Exception
99
/**
1010
* @var int
1111
*/
12-
private $iLineNo;
12+
private $lineNumber;
1313

1414
/**
1515
* @param string $sMessage
16-
* @param int $iLineNo
16+
* @param int $lineNumber
1717
*/
18-
public function __construct($sMessage, $iLineNo = 0)
18+
public function __construct($sMessage, $lineNumber = 0)
1919
{
20-
$this->iLineNo = $iLineNo;
21-
if ($iLineNo !== 0) {
22-
$sMessage .= " [line no: $iLineNo]";
20+
$this->lineNumber = $lineNumber;
21+
if ($lineNumber !== 0) {
22+
$sMessage .= " [line no: $lineNumber]";
2323
}
2424
parent::__construct($sMessage);
2525
}
@@ -29,6 +29,6 @@ public function __construct($sMessage, $iLineNo = 0)
2929
*/
3030
public function getLineNo()
3131
{
32-
return $this->iLineNo;
32+
return $this->lineNumber;
3333
}
3434
}

src/Parsing/UnexpectedTokenException.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ class UnexpectedTokenException extends SourceException
3030
* @param string $sExpected
3131
* @param string $sFound
3232
* @param string $sMatchType
33-
* @param int $iLineNo
33+
* @param int $lineNumber
3434
*/
35-
public function __construct($sExpected, $sFound, $sMatchType = 'literal', $iLineNo = 0)
35+
public function __construct($sExpected, $sFound, $sMatchType = 'literal', $lineNumber = 0)
3636
{
3737
$this->sExpected = $sExpected;
3838
$this->sFound = $sFound;
@@ -48,6 +48,6 @@ public function __construct($sExpected, $sFound, $sMatchType = 'literal', $iLine
4848
$sMessage = \trim("$sExpected $sFound");
4949
}
5050

51-
parent::__construct($sMessage, $iLineNo);
51+
parent::__construct($sMessage, $lineNumber);
5252
}
5353
}

src/Property/CSSNamespace.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class CSSNamespace implements AtRule
2525
/**
2626
* @var int
2727
*/
28-
private $iLineNo;
28+
private $lineNumber;
2929

3030
/**
3131
* @var array<array-key, Comment>
@@ -35,13 +35,13 @@ class CSSNamespace implements AtRule
3535
/**
3636
* @param string $mUrl
3737
* @param string|null $sPrefix
38-
* @param int $iLineNo
38+
* @param int $lineNumber
3939
*/
40-
public function __construct($mUrl, $sPrefix = null, $iLineNo = 0)
40+
public function __construct($mUrl, $sPrefix = null, $lineNumber = 0)
4141
{
4242
$this->mUrl = $mUrl;
4343
$this->sPrefix = $sPrefix;
44-
$this->iLineNo = $iLineNo;
44+
$this->lineNumber = $lineNumber;
4545
$this->comments = [];
4646
}
4747

@@ -50,7 +50,7 @@ public function __construct($mUrl, $sPrefix = null, $iLineNo = 0)
5050
*/
5151
public function getLineNo()
5252
{
53-
return $this->iLineNo;
53+
return $this->lineNumber;
5454
}
5555

5656
public function __toString(): string

src/Property/Charset.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Charset implements AtRule
2626
/**
2727
* @var int
2828
*/
29-
protected $iLineNo;
29+
protected $lineNumber;
3030

3131
/**
3232
* @var array<array-key, Comment>
@@ -35,12 +35,12 @@ class Charset implements AtRule
3535

3636
/**
3737
* @param CSSString $oCharset
38-
* @param int $iLineNo
38+
* @param int $lineNumber
3939
*/
40-
public function __construct(CSSString $oCharset, $iLineNo = 0)
40+
public function __construct(CSSString $oCharset, $lineNumber = 0)
4141
{
4242
$this->oCharset = $oCharset;
43-
$this->iLineNo = $iLineNo;
43+
$this->lineNumber = $lineNumber;
4444
$this->comments = [];
4545
}
4646

@@ -49,7 +49,7 @@ public function __construct(CSSString $oCharset, $iLineNo = 0)
4949
*/
5050
public function getLineNo()
5151
{
52-
return $this->iLineNo;
52+
return $this->lineNumber;
5353
}
5454

5555
/**

src/Property/Import.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Import implements AtRule
2626
/**
2727
* @var int
2828
*/
29-
protected $iLineNo;
29+
protected $lineNumber;
3030

3131
/**
3232
* @var array<array-key, Comment>
@@ -36,13 +36,13 @@ class Import implements AtRule
3636
/**
3737
* @param URL $oLocation
3838
* @param string $sMediaQuery
39-
* @param int $iLineNo
39+
* @param int $lineNumber
4040
*/
41-
public function __construct(URL $oLocation, $sMediaQuery, $iLineNo = 0)
41+
public function __construct(URL $oLocation, $sMediaQuery, $lineNumber = 0)
4242
{
4343
$this->oLocation = $oLocation;
4444
$this->sMediaQuery = $sMediaQuery;
45-
$this->iLineNo = $iLineNo;
45+
$this->lineNumber = $lineNumber;
4646
$this->comments = [];
4747
}
4848

@@ -51,7 +51,7 @@ public function __construct(URL $oLocation, $sMediaQuery, $iLineNo = 0)
5151
*/
5252
public function getLineNo()
5353
{
54-
return $this->iLineNo;
54+
return $this->lineNumber;
5555
}
5656

5757
/**

0 commit comments

Comments
 (0)