Skip to content

Commit faa6dc7

Browse files
committed
Add method setLineNo() which will be useful for synthetically setting line no or during testing
1 parent b55cee9 commit faa6dc7

File tree

8 files changed

+57
-0
lines changed

8 files changed

+57
-0
lines changed

lib/Sabberworm/CSS/CSSList/CSSList.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ public function getLineNo()
2929
return $this->iLineNum;
3030
}
3131

32+
/**
33+
* @param int $iLineNum
34+
*/
35+
public function setLineNo($iLineNum = 0)
36+
{
37+
$this->iLineNum = $iLineNum;
38+
}
39+
3240
public function append($oItem) {
3341
$this->aContents[] = $oItem;
3442
}

lib/Sabberworm/CSS/Property/CSSNamespace.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ public function getLineNo() {
2323
return $this->iLineNum;
2424
}
2525

26+
/**
27+
* @param int $iLineNum
28+
*/
29+
public function setLineNo($iLineNum = 0)
30+
{
31+
$this->iLineNum = $iLineNum;
32+
}
33+
2634
public function __toString() {
2735
return $this->render(new \Sabberworm\CSS\OutputFormat());
2836
}

lib/Sabberworm/CSS/Property/Charset.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ public function getLineNo() {
2626
return $this->iLineNum;
2727
}
2828

29+
/**
30+
* @param int $iLineNum
31+
*/
32+
public function setLineNo($iLineNum = 0)
33+
{
34+
$this->iLineNum = $iLineNum;
35+
}
36+
2937
public function setCharset($sCharset) {
3038
$this->sCharset = $sCharset;
3139
}

lib/Sabberworm/CSS/Property/Import.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ public function getLineNo() {
2525
return $this->iLineNum;
2626
}
2727

28+
/**
29+
* @param int $iLineNum
30+
*/
31+
public function setLineNo($iLineNum = 0)
32+
{
33+
$this->iLineNum = $iLineNum;
34+
}
35+
2836
public function setLocation($oLocation) {
2937
$this->oLocation = $oLocation;
3038
}

lib/Sabberworm/CSS/Renderable.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ interface Renderable {
66
public function __toString();
77
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat);
88
public function getLineNo();
9+
public function setLineNo();
910
}

lib/Sabberworm/CSS/Rule/Rule.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ public function getLineNo()
3232
return $this->iLineNum;
3333
}
3434

35+
/**
36+
* @param int $iLineNum
37+
*/
38+
public function setLineNo($iLineNum = 0)
39+
{
40+
$this->iLineNum = $iLineNum;
41+
}
42+
3543
public function setRule($sRule) {
3644
$this->sRule = $sRule;
3745
}

lib/Sabberworm/CSS/RuleSet/RuleSet.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ public function getLineNo()
2727
return $this->iLineNum;
2828
}
2929

30+
/**
31+
* @param int $iLineNum
32+
*/
33+
public function setLineNo($iLineNum = 0)
34+
{
35+
$this->iLineNum = $iLineNum;
36+
}
37+
3038
public function addRule(Rule $oRule) {
3139
$sRule = $oRule->getRule();
3240
if(!isset($this->aRules[$sRule])) {

lib/Sabberworm/CSS/Value/Value.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ public function getLineNo()
1919
return $this->iLineNum;
2020
}
2121

22+
/**
23+
* @param int $iLineNum
24+
*/
25+
public function setLineNo($iLineNum = 0)
26+
{
27+
$this->iLineNum = $iLineNum;
28+
}
29+
2230
//Methods are commented out because re-declaring them here is a fatal error in PHP < 5.3.9
2331
//public abstract function __toString();
2432
//public abstract function render(\Sabberworm\CSS\OutputFormat $oOutputFormat);

0 commit comments

Comments
 (0)