Skip to content

Commit 5f1f7d6

Browse files
committed
Fix some types
1 parent 11e1526 commit 5f1f7d6

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/CSSList/CSSList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ private static function parseAtRule(ParserState $parserState)
176176
}
177177
}
178178
$parserState->consumeUntil([';', ParserState::EOF], true, true);
179-
return new Import($location, $mediaQuery, $identifierLineNumber);
179+
return new Import($location, $mediaQuery ?? '', $identifierLineNumber);
180180
} elseif ($identifier === 'charset') {
181181
$charsetString = CSSString::parse($parserState);
182182
$parserState->consumeWhiteSpace();

src/Property/CSSNamespace.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@
66

77
use Sabberworm\CSS\Comment\Comment;
88
use Sabberworm\CSS\OutputFormat;
9+
use Sabberworm\CSS\Value\CSSString;
10+
use Sabberworm\CSS\Value\URL;
911

1012
/**
1113
* `CSSNamespace` represents an `@namespace` rule.
1214
*/
1315
class CSSNamespace implements AtRule
1416
{
1517
/**
16-
* @var string
18+
* @var CSSString|URL
1719
*/
1820
private $url;
1921

@@ -35,9 +37,10 @@ class CSSNamespace implements AtRule
3537
protected $comments = [];
3638

3739
/**
40+
* @param CSSString|URL
3841
* @param int<0, max> $lineNumber
3942
*/
40-
public function __construct(string $url, ?string $prefix = null, int $lineNumber = 0)
43+
public function __construct($url, ?string $prefix = null, int $lineNumber = 0)
4144
{
4245
$this->url = $url;
4346
$this->prefix = $prefix;
@@ -64,7 +67,7 @@ public function render(OutputFormat $outputFormat): string
6467
}
6568

6669
/**
67-
* @return string
70+
* @return CSSString|URL
6871
*/
6972
public function getUrl()
7073
{
@@ -80,7 +83,7 @@ public function getPrefix()
8083
}
8184

8285
/**
83-
* @param string $url
86+
* @param CSSString|URL $url
8487
*/
8588
public function setUrl($url): void
8689
{

0 commit comments

Comments
 (0)