Skip to content

Commit af1b661

Browse files
committed
Fix some types
1 parent 990a600 commit af1b661

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

config/phpstan-baseline.neon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ parameters:
4343
path: ../src/CSSList/Document.php
4444

4545
-
46-
message: '#^Cannot call method render\(\) on string\.$#'
47-
identifier: method.nonObject
46+
message: '#^Method Sabberworm\\CSS\\Property\\CSSNamespace\:\:atRuleArgs\(\) should return array\<int, string\> but returns list\<Sabberworm\\CSS\\Value\\CSSString\|Sabberworm\\CSS\\Value\\URL\|string\>\.$#'
47+
identifier: return.type
4848
count: 1
4949
path: ../src/Property/CSSNamespace.php
5050

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 $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;
@@ -67,7 +70,7 @@ public function render(OutputFormat $outputFormat): string
6770
}
6871

6972
/**
70-
* @return string
73+
* @return CSSString|URL
7174
*/
7275
public function getUrl()
7376
{
@@ -83,7 +86,7 @@ public function getPrefix()
8386
}
8487

8588
/**
86-
* @param string $url
89+
* @param CSSString|URL $url
8790
*/
8891
public function setUrl($url): void
8992
{

src/Value/CSSFunction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class CSSFunction extends ValueList
2424
protected $name;
2525

2626
/**
27-
* @param RuleValueList|array<array-key, Value|string> $aArguments
27+
* @param RuleValueList|array<array-key, Value|string> $arguments
2828
* @param int<0, max> $lineNumber
2929
*/
3030
public function __construct(string $name, $arguments, string $separator = ',', int $lineNumber = 0)

src/Value/ValueList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ abstract class ValueList extends Value
2929
protected $separator;
3030

3131
/**
32-
* @param array<array-key, Value|string>|Value|string $aComponents
32+
* @param array<array-key, Value|string>|Value|string $components
3333
* @param int<0, max> $lineNumber
3434
*/
3535
public function __construct($components = [], string $separator = ',', int $lineNumber = 0)

0 commit comments

Comments
 (0)