Skip to content

Commit 7045ea0

Browse files
committed
Rename iLineNum to iLineNo
1 parent ec657c2 commit 7045ea0

24 files changed

+132
-132
lines changed

lib/Sabberworm/CSS/CSSList/AtRuleBlockList.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ class AtRuleBlockList extends CSSBlockList implements AtRule {
1212
private $sType;
1313
private $sArgs;
1414

15-
public function __construct($sType, $sArgs = '', $iLineNum = 0) {
16-
parent::__construct($iLineNum);
15+
public function __construct($sType, $sArgs = '', $iLineNo = 0) {
16+
parent::__construct($iLineNo);
1717
$this->sType = $sType;
1818
$this->sArgs = $sArgs;
1919
}

lib/Sabberworm/CSS/CSSList/CSSBlockList.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* Most CSSLists conform to this category but some at-rules (such as @keyframes) do not.
1515
*/
1616
abstract class CSSBlockList extends CSSList {
17-
public function __construct($iLineNum = 0) {
18-
parent::__construct($iLineNum);
17+
public function __construct($iLineNo = 0) {
18+
parent::__construct($iLineNo);
1919
}
2020

2121
protected function allDeclarationBlocks(&$aResult) {

lib/Sabberworm/CSS/CSSList/CSSList.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,27 @@
1414
abstract class CSSList implements Renderable {
1515

1616
protected $aContents;
17-
protected $iLineNum;
17+
protected $iLineNo;
1818

19-
public function __construct($iLineNum = 0) {
19+
public function __construct($iLineNo = 0) {
2020
$this->aContents = array();
21-
$this->iLineNum = $iLineNum;
21+
$this->iLineNo = $iLineNo;
2222
}
2323

2424
/**
2525
* @return int
2626
*/
2727
public function getLineNo()
2828
{
29-
return $this->iLineNum;
29+
return $this->iLineNo;
3030
}
3131

3232
/**
33-
* @param int $iLineNum
33+
* @param int $iLineNo
3434
*/
35-
public function setLineNo($iLineNum = 0)
35+
public function setLineNo($iLineNo = 0)
3636
{
37-
$this->iLineNum = $iLineNum;
37+
$this->iLineNo = $iLineNo;
3838
}
3939

4040
public function append($oItem) {

lib/Sabberworm/CSS/CSSList/Document.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
class Document extends CSSBlockList {
99
/**
1010
* Document constructor.
11-
* @param int $iLineNum
11+
* @param int $iLineNo
1212
*/
13-
public function __construct($iLineNum = 0)
13+
public function __construct($iLineNo = 0)
1414
{
15-
parent::__construct($iLineNum);
15+
parent::__construct($iLineNo);
1616
}
1717

1818
/**

lib/Sabberworm/CSS/CSSList/KeyFrame.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ class KeyFrame extends CSSList implements AtRule {
99
private $vendorKeyFrame;
1010
private $animationName;
1111

12-
public function __construct($iLineNum = 0) {
13-
parent::__construct($iLineNum);
12+
public function __construct($iLineNo = 0) {
13+
parent::__construct($iLineNo);
1414
$this->vendorKeyFrame = null;
1515
$this->animationName = null;
1616
}

lib/Sabberworm/CSS/Parser.php

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ class Parser {
3434
private $iLength;
3535
private $blockRules;
3636
private $aSizeUnits;
37-
private $iLineNum;
37+
private $iLineNo;
3838

39-
public function __construct($sText, Settings $oParserSettings = null, $iLineNum = 0) {
39+
public function __construct($sText, Settings $oParserSettings = null, $iLineNo = 0) {
4040
$this->sText = $sText;
4141
$this->iCurrentPosition = 0;
42-
$this->iLineNum = $iLineNum;
42+
$this->iLineNo = $iLineNo;
4343
if ($oParserSettings === null) {
4444
$oParserSettings = Settings::create();
4545
}
@@ -68,7 +68,7 @@ public function getCharset() {
6868

6969
public function parse() {
7070
$this->setCharset($this->oParserSettings->sDefaultCharset);
71-
$oResult = new Document($this->iLineNum);
71+
$oResult = new Document($this->iLineNo);
7272
$this->parseDocument($oResult);
7373
return $oResult;
7474
}
@@ -109,10 +109,10 @@ private function parseListItem(CSSList $oList, $bIsRoot = false) {
109109
$oAtRule = $this->parseAtRule();
110110
if($oAtRule instanceof Charset) {
111111
if(!$bIsRoot) {
112-
throw new UnexpectedTokenException('@charset may only occur in root document', '', 'custom', $this->iLineNum);
112+
throw new UnexpectedTokenException('@charset may only occur in root document', '', 'custom', $this->iLineNo);
113113
}
114114
if(count($oList->getContents()) > 0) {
115-
throw new UnexpectedTokenException('@charset must be the first parseable token in a document', '', 'custom', $this->iLineNum);
115+
throw new UnexpectedTokenException('@charset must be the first parseable token in a document', '', 'custom', $this->iLineNo);
116116
}
117117
$this->setCharset($oAtRule->getCharset()->getString());
118118
}
@@ -132,7 +132,7 @@ private function parseListItem(CSSList $oList, $bIsRoot = false) {
132132
private function parseAtRule() {
133133
$this->consume('@');
134134
$sIdentifier = $this->parseIdentifier();
135-
$iIdentifierLineNum = $this->iLineNum;
135+
$iIdentifierLineNum = $this->iLineNo;
136136
$this->consumeWhiteSpace();
137137
if ($sIdentifier === 'import') {
138138
$oLocation = $this->parseURLValue();
@@ -195,7 +195,7 @@ private function parseAtRule() {
195195
private function parseIdentifier($bAllowFunctions = true, $bIgnoreCase = true) {
196196
$sResult = $this->parseCharacter(true);
197197
if ($sResult === null) {
198-
throw new UnexpectedTokenException($sResult, $this->peek(5), 'identifier', $this->iLineNum);
198+
throw new UnexpectedTokenException($sResult, $this->peek(5), 'identifier', $this->iLineNo);
199199
}
200200
$sCharacter = null;
201201
while (($sCharacter = $this->parseCharacter(true)) !== null) {
@@ -207,7 +207,7 @@ private function parseIdentifier($bAllowFunctions = true, $bIgnoreCase = true) {
207207
if ($bAllowFunctions && $this->comes('(')) {
208208
$this->consume('(');
209209
$aArguments = $this->parseValue(array('=', ' ', ','));
210-
$sResult = new CSSFunction($sResult, $aArguments, ',', $this->iLineNum);
210+
$sResult = new CSSFunction($sResult, $aArguments, ',', $this->iLineNo);
211211
$this->consume(')');
212212
}
213213
return $sResult;
@@ -241,7 +241,7 @@ private function parseStringValue() {
241241
}
242242
$this->consume($sQuote);
243243
}
244-
return new CSSString($sResult, $this->iLineNum);
244+
return new CSSString($sResult, $this->iLineNo);
245245
}
246246

247247
private function parseCharacter($bIsForIdentifier) {
@@ -290,7 +290,7 @@ private function parseCharacter($bIsForIdentifier) {
290290
}
291291

292292
private function parseSelector() {
293-
$oResult = new DeclarationBlock($this->iLineNum);
293+
$oResult = new DeclarationBlock($this->iLineNo);
294294
$oResult->setSelector($this->consumeUntil('{', false, true));
295295
$this->consumeWhiteSpace();
296296
$this->parseRuleSet($oResult);
@@ -336,7 +336,7 @@ private function parseRuleSet($oRuleSet) {
336336
}
337337

338338
private function parseRule() {
339-
$oRule = new Rule($this->parseIdentifier(), $this->iLineNum);
339+
$oRule = new Rule($this->parseIdentifier(), $this->iLineNo);
340340
$this->consumeWhiteSpace();
341341
$this->consume(':');
342342
$oValue = $this->parseValue(self::listDelimiterForRule($oRule->getRule()));
@@ -390,7 +390,7 @@ private function parseValue($aListDelimiters) {
390390
break;
391391
}
392392
}
393-
$oList = new RuleValueList($sDelimiter, $this->iLineNum);
393+
$oList = new RuleValueList($sDelimiter, $this->iLineNo);
394394
for ($i = $iStartPosition - 1; $i - $iStartPosition + 1 < $iLength * 2; $i+=2) {
395395
$oList->addListComponent($aStack[$i]);
396396
}
@@ -448,7 +448,7 @@ private function parseNumericValue($bForColor = false) {
448448
}
449449
}
450450
}
451-
return new Size(floatval($sSize), $sUnit, $bForColor, $this->iLineNum);
451+
return new Size(floatval($sSize), $sUnit, $bForColor, $this->iLineNo);
452452
}
453453

454454
private function parseColorValue() {
@@ -459,7 +459,7 @@ private function parseColorValue() {
459459
if ($this->strlen($sValue) === 3) {
460460
$sValue = $sValue[0] . $sValue[0] . $sValue[1] . $sValue[1] . $sValue[2] . $sValue[2];
461461
}
462-
$aColor = array('r' => new Size(intval($sValue[0] . $sValue[1], 16), null, true, $this->iLineNum), 'g' => new Size(intval($sValue[2] . $sValue[3], 16), null, true, $this->iLineNum), 'b' => new Size(intval($sValue[4] . $sValue[5], 16), null, true, $this->iLineNum));
462+
$aColor = array('r' => new Size(intval($sValue[0] . $sValue[1], 16), null, true, $this->iLineNo), 'g' => new Size(intval($sValue[2] . $sValue[3], 16), null, true, $this->iLineNo), 'b' => new Size(intval($sValue[4] . $sValue[5], 16), null, true, $this->iLineNo));
463463
} else {
464464
$sColorMode = $this->parseIdentifier(false);
465465
$this->consumeWhiteSpace();
@@ -475,7 +475,7 @@ private function parseColorValue() {
475475
}
476476
$this->consume(')');
477477
}
478-
return new Color($aColor, $this->iLineNum);
478+
return new Color($aColor, $this->iLineNo);
479479
}
480480

481481
private function parseURLValue() {
@@ -486,7 +486,7 @@ private function parseURLValue() {
486486
$this->consume('(');
487487
}
488488
$this->consumeWhiteSpace();
489-
$oResult = new URL($this->parseStringValue(), $this->iLineNum);
489+
$oResult = new URL($this->parseStringValue(), $this->iLineNo);
490490
if ($bUseUrl) {
491491
$this->consumeWhiteSpace();
492492
$this->consume(')');
@@ -522,18 +522,18 @@ private function consume($mValue = 1) {
522522
$iLineCount = substr_count($mValue, "\n");
523523
$iLength = $this->strlen($mValue);
524524
if (!$this->streql($this->substr($this->iCurrentPosition, $iLength), $mValue)) {
525-
throw new UnexpectedTokenException($mValue, $this->peek(max($iLength, 5)), $this->iLineNum);
525+
throw new UnexpectedTokenException($mValue, $this->peek(max($iLength, 5)), $this->iLineNo);
526526
}
527-
$this->iLineNum += $iLineCount;
527+
$this->iLineNo += $iLineCount;
528528
$this->iCurrentPosition += $this->strlen($mValue);
529529
return $mValue;
530530
} else {
531531
if ($this->iCurrentPosition + $mValue > $this->iLength) {
532-
throw new UnexpectedTokenException($mValue, $this->peek(5), 'count', $this->iLineNum);
532+
throw new UnexpectedTokenException($mValue, $this->peek(5), 'count', $this->iLineNo);
533533
}
534534
$sResult = $this->substr($this->iCurrentPosition, $mValue);
535535
$iLineCount = substr_count($sResult, "\n");
536-
$this->iLineNum += $iLineCount;
536+
$this->iLineNo += $iLineCount;
537537
$this->iCurrentPosition += $mValue;
538538
return $sResult;
539539
}
@@ -544,7 +544,7 @@ private function consumeExpression($mExpression) {
544544
if (preg_match($mExpression, $this->inputLeft(), $aMatches, PREG_OFFSET_CAPTURE) === 1) {
545545
return $this->consume($aMatches[0][0]);
546546
}
547-
throw new UnexpectedTokenException($mExpression, $this->peek(5), 'expression', $this->iLineNum);
547+
throw new UnexpectedTokenException($mExpression, $this->peek(5), 'expression', $this->iLineNo);
548548
}
549549

550550
private function consumeWhiteSpace() {
@@ -602,7 +602,7 @@ private function consumeUntil($aEnd, $bIncludeEnd = false, $consumeEnd = false)
602602
}
603603

604604
$this->iCurrentPosition = $start;
605-
throw new UnexpectedTokenException('One of ("'.implode('","', $aEnd).'")', $this->peek(5), 'search', $this->iLineNum);
605+
throw new UnexpectedTokenException('One of ("'.implode('","', $aEnd).'")', $this->peek(5), 'search', $this->iLineNo);
606606
}
607607

608608
private function inputLeft() {

lib/Sabberworm/CSS/Parsing/OutputException.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
* Thrown if the CSS parsers attempts to print something invalid
77
*/
88
class OutputException extends \Exception {
9-
private $iLineNum;
10-
public function __construct($sMessage, $iLineNum = 0)
9+
private $iLineNo;
10+
public function __construct($sMessage, $iLineNo = 0)
1111
{
12-
$this->$iLineNum = $iLineNum;
13-
if (!empty($iLineNum)) {
14-
$sMessage .= " [line no: $iLineNum]";
12+
$this->$iLineNo = $iLineNo;
13+
if (!empty($iLineNo)) {
14+
$sMessage .= " [line no: $iLineNo]";
1515
}
1616
parent::__construct($sMessage);
1717
}

lib/Sabberworm/CSS/Parsing/UnexpectedTokenException.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ class UnexpectedTokenException extends \Exception {
1010
private $sFound;
1111
// Possible values: literal, identifier, count, expression, search
1212
private $sMatchType;
13-
private $iLineNum;
13+
private $iLineNo;
1414

15-
public function __construct($sExpected, $sFound, $sMatchType = 'literal', $iLineNum = 0) {
15+
public function __construct($sExpected, $sFound, $sMatchType = 'literal', $iLineNo = 0) {
1616
$this->sExpected = $sExpected;
1717
$this->sFound = $sFound;
1818
$this->sMatchType = $sMatchType;
19-
$this->iLineNum = $iLineNum;
19+
$this->iLineNo = $iLineNo;
2020
$sMessage = "Token “{$sExpected}” ({$sMatchType}) not found. Got “{$sFound}”.";
2121
if($this->sMatchType === 'search') {
2222
$sMessage = "Search for “{$sExpected}” returned no results. Context: “{$sFound}”.";
@@ -28,8 +28,8 @@ public function __construct($sExpected, $sFound, $sMatchType = 'literal', $iLine
2828
$sMessage = trim("$sExpected $sFound");
2929
}
3030

31-
if (!empty($iLineNum)) {
32-
$sMessage .= " [line no: $iLineNum]";
31+
if (!empty($iLineNo)) {
32+
$sMessage .= " [line no: $iLineNo]";
3333
}
3434

3535
parent::__construct($sMessage);

lib/Sabberworm/CSS/Property/CSSNamespace.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,27 @@
88
class CSSNamespace implements AtRule {
99
private $mUrl;
1010
private $sPrefix;
11-
private $iLineNum;
11+
private $iLineNo;
1212

13-
public function __construct($mUrl, $sPrefix = null, $iLineNum = 0) {
13+
public function __construct($mUrl, $sPrefix = null, $iLineNo = 0) {
1414
$this->mUrl = $mUrl;
1515
$this->sPrefix = $sPrefix;
16-
$this->iLineNum = $iLineNum;
16+
$this->iLineNo = $iLineNo;
1717
}
1818

1919
/**
2020
* @return int
2121
*/
2222
public function getLineNo() {
23-
return $this->iLineNum;
23+
return $this->iLineNo;
2424
}
2525

2626
/**
27-
* @param int $iLineNum
27+
* @param int $iLineNo
2828
*/
29-
public function setLineNo($iLineNum = 0)
29+
public function setLineNo($iLineNo = 0)
3030
{
31-
$this->iLineNum = $iLineNum;
31+
$this->iLineNo = $iLineNo;
3232
}
3333

3434
public function __toString() {

lib/Sabberworm/CSS/Property/Charset.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,26 @@
1212
class Charset implements AtRule {
1313

1414
private $sCharset;
15-
protected $iLineNum;
15+
protected $iLineNo;
1616

17-
public function __construct($sCharset, $iLineNum = 0) {
17+
public function __construct($sCharset, $iLineNo = 0) {
1818
$this->sCharset = $sCharset;
19-
$this->iLineNum = $iLineNum;
19+
$this->iLineNo = $iLineNo;
2020
}
2121

2222
/**
2323
* @return int
2424
*/
2525
public function getLineNo() {
26-
return $this->iLineNum;
26+
return $this->iLineNo;
2727
}
2828

2929
/**
30-
* @param int $iLineNum
30+
* @param int $iLineNo
3131
*/
32-
public function setLineNo($iLineNum = 0)
32+
public function setLineNo($iLineNo = 0)
3333
{
34-
$this->iLineNum = $iLineNum;
34+
$this->iLineNo = $iLineNo;
3535
}
3636

3737
public function setCharset($sCharset) {

0 commit comments

Comments
 (0)