Skip to content

Commit 0080be3

Browse files
authored
Merge pull request #270 from oliverklee/cleanup/imports
2 parents 65c0ed6 + 2fbcff0 commit 0080be3

28 files changed

+100
-67
lines changed

src/CSSList/AtRuleBlockList.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Sabberworm\CSS\CSSList;
44

5+
use Sabberworm\CSS\OutputFormat;
56
use Sabberworm\CSS\Property\AtRule;
67

78
/**
@@ -49,13 +50,13 @@ public function atRuleArgs()
4950

5051
public function __toString()
5152
{
52-
return $this->render(new \Sabberworm\CSS\OutputFormat());
53+
return $this->render(new OutputFormat());
5354
}
5455

5556
/**
5657
* @return string
5758
*/
58-
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat)
59+
public function render(OutputFormat $oOutputFormat)
5960
{
6061
$sArgs = $this->sArgs;
6162
if ($sArgs) {

src/CSSList/CSSList.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Sabberworm\CSS\CSSList;
44

55
use Sabberworm\CSS\Comment\Commentable;
6+
use Sabberworm\CSS\OutputFormat;
67
use Sabberworm\CSS\Parsing\ParserState;
78
use Sabberworm\CSS\Parsing\SourceException;
89
use Sabberworm\CSS\Parsing\UnexpectedTokenException;
@@ -353,13 +354,13 @@ public function removeDeclarationBlockBySelector($mSelector, $bRemoveAll = false
353354

354355
public function __toString()
355356
{
356-
return $this->render(new \Sabberworm\CSS\OutputFormat());
357+
return $this->render(new OutputFormat());
357358
}
358359

359360
/**
360361
* @return string
361362
*/
362-
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat)
363+
public function render(OutputFormat $oOutputFormat)
363364
{
364365
$sResult = '';
365366
$bIsFirst = true;

src/CSSList/Document.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
namespace Sabberworm\CSS\CSSList;
44

5+
use Sabberworm\CSS\OutputFormat;
56
use Sabberworm\CSS\Parsing\ParserState;
7+
use Sabberworm\CSS\Parsing\SourceException;
68

79
/**
810
* The root CSSList of a parsed file. Contains all top-level css contents, mostly declaration blocks,
@@ -25,7 +27,7 @@ public function __construct($iLineNo = 0)
2527
*
2628
* @return Document
2729
*
28-
* @throws \Sabberworm\CSS\Parsing\SourceException
30+
* @throws SourceException
2931
*/
3032
public static function parse(ParserState $oParserState)
3133
{
@@ -127,14 +129,14 @@ public function createShorthands()
127129
/**
128130
* Override render() to make format argument optional
129131
*
130-
* @param \Sabberworm\CSS\OutputFormat|null $oOutputFormat
132+
* @param OutputFormat|null $oOutputFormat
131133
*
132134
* @return string
133135
*/
134-
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat = null)
136+
public function render(OutputFormat $oOutputFormat = null)
135137
{
136138
if ($oOutputFormat === null) {
137-
$oOutputFormat = new \Sabberworm\CSS\OutputFormat();
139+
$oOutputFormat = new OutputFormat();
138140
}
139141
return parent::render($oOutputFormat);
140142
}

src/CSSList/KeyFrame.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Sabberworm\CSS\CSSList;
44

5+
use Sabberworm\CSS\OutputFormat;
56
use Sabberworm\CSS\Property\AtRule;
67

78
class KeyFrame extends CSSList implements AtRule
@@ -45,15 +46,15 @@ public function getAnimationName()
4546

4647
public function __toString()
4748
{
48-
return $this->render(new \Sabberworm\CSS\OutputFormat());
49+
return $this->render(new OutputFormat());
4950
}
5051

5152
/**
52-
* @param \Sabberworm\CSS\OutputFormat $oOutputFormat
53+
* @param OutputFormat $oOutputFormat
5354
*
5455
* @return string
5556
*/
56-
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat)
57+
public function render(OutputFormat $oOutputFormat)
5758
{
5859
$sResult = "@{$this->vendorKeyFrame} {$this->animationName}{$oOutputFormat->spaceBeforeOpeningBrace()}{";
5960
$sResult .= parent::render($oOutputFormat);

src/Comment/Comment.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Sabberworm\CSS\Comment;
44

5+
use Sabberworm\CSS\OutputFormat;
56
use Sabberworm\CSS\Renderable;
67

78
class Comment implements Renderable
@@ -45,13 +46,13 @@ public function setComment($sComment)
4546
*/
4647
public function __toString()
4748
{
48-
return $this->render(new \Sabberworm\CSS\OutputFormat());
49+
return $this->render(new OutputFormat());
4950
}
5051

5152
/**
5253
* @return string
5354
*/
54-
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat)
55+
public function render(OutputFormat $oOutputFormat)
5556
{
5657
return '/*' . $this->sComment . '*/';
5758
}

src/OutputFormatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public function implode($sSeparator, array $aValues, $bIncreaseLevel = false)
123123
} else {
124124
$sResult .= $sSeparator;
125125
}
126-
if ($mValue instanceof \Sabberworm\CSS\Renderable) {
126+
if ($mValue instanceof Renderable) {
127127
$sResult .= $mValue->render($oFormat);
128128
} else {
129129
$sResult .= $mValue;

src/Property/CSSNamespace.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Sabberworm\CSS\Property;
44

5+
use Sabberworm\CSS\OutputFormat;
6+
57
/**
68
* CSSNamespace represents an @namespace rule.
79
*/
@@ -33,15 +35,15 @@ public function getLineNo()
3335

3436
public function __toString()
3537
{
36-
return $this->render(new \Sabberworm\CSS\OutputFormat());
38+
return $this->render(new OutputFormat());
3739
}
3840

3941
/**
40-
* @param \Sabberworm\CSS\OutputFormat $oOutputFormat
42+
* @param OutputFormat $oOutputFormat
4143
*
4244
* @return string
4345
*/
44-
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat)
46+
public function render(OutputFormat $oOutputFormat)
4547
{
4648
return '@namespace ' . ($this->sPrefix === null ? '' : $this->sPrefix . ' ')
4749
. $this->mUrl->render($oOutputFormat) . ';';

src/Property/Charset.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Sabberworm\CSS\Property;
44

5+
use Sabberworm\CSS\OutputFormat;
6+
57
/**
68
* Class representing an @charset rule.
79
* The following restrictions apply:
@@ -57,15 +59,15 @@ public function getCharset()
5759

5860
public function __toString()
5961
{
60-
return $this->render(new \Sabberworm\CSS\OutputFormat());
62+
return $this->render(new OutputFormat());
6163
}
6264

6365
/**
64-
* @param \Sabberworm\CSS\OutputFormat $oOutputFormat
66+
* @param OutputFormat $oOutputFormat
6567
*
6668
* @return string
6769
*/
68-
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat)
70+
public function render(OutputFormat $oOutputFormat)
6971
{
7072
return "@charset {$this->sCharset->render($oOutputFormat)};";
7173
}

src/Property/Import.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Sabberworm\CSS\Property;
44

5+
use Sabberworm\CSS\OutputFormat;
56
use Sabberworm\CSS\Value\URL;
67

78
/**
@@ -62,15 +63,15 @@ public function getLocation()
6263

6364
public function __toString()
6465
{
65-
return $this->render(new \Sabberworm\CSS\OutputFormat());
66+
return $this->render(new OutputFormat());
6667
}
6768

6869
/**
69-
* @param \Sabberworm\CSS\OutputFormat $oOutputFormat
70+
* @param OutputFormat $oOutputFormat
7071
*
7172
* @return string
7273
*/
73-
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat)
74+
public function render(OutputFormat $oOutputFormat)
7475
{
7576
return "@import " . $this->oLocation->render($oOutputFormat)
7677
. ($this->sMediaQuery === null ? '' : ' ' . $this->sMediaQuery) . ';';

src/Renderable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public function __toString();
1414
*
1515
* @return string
1616
*/
17-
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat);
17+
public function render(OutputFormat $oOutputFormat);
1818

1919
public function getLineNo();
2020
}

0 commit comments

Comments
 (0)