Skip to content

Commit 1226a2f

Browse files
authored
[CLEANUP] Fix type annotation of ::getSelectors() (#1184)
Also add a native type declaration. This will need more cleanup and refactoring later on.
1 parent fcaea55 commit 1226a2f

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Please also have a look at our
3434
- Use more native type declarations and strict mode
3535
(#641, #772, #774, #778, #804, #841, #873, #875, #891, #922, #923, #933, #958,
3636
#964, #967, #1000, #1044, #1134, #1136, #1137, #1139, #1140, #1141, #1145,
37-
#1162, #1163, #1166, #1172, #1174, #1178, #1179, #1181)
37+
#1162, #1163, #1166, #1172, #1174, #1178, #1179, #1181, #1184)
3838
- Add visibility to all class/interface constants (#469)
3939

4040
### Deprecated

config/phpstan-baseline.neon

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ parameters:
66
count: 1
77
path: ../src/CSSList/AtRuleBlockList.php
88

9-
-
10-
message: '#^Parameter &\$result by\-ref type of method Sabberworm\\CSS\\CSSList\\CSSBlockList\:\:allSelectors\(\) expects array\<int, Sabberworm\\CSS\\Property\\Selector\>, array\<int, Sabberworm\\CSS\\Property\\Selector\|string\> given\.$#'
11-
identifier: parameterByRef.type
12-
count: 2
13-
path: ../src/CSSList/CSSBlockList.php
14-
159
-
1610
message: '#^Parameter &\$result by\-ref type of method Sabberworm\\CSS\\CSSList\\CSSBlockList\:\:allValues\(\) expects array\<int, Sabberworm\\CSS\\Value\\Value\>, array\<int, Sabberworm\\CSS\\CSSList\\CSSList\|Sabberworm\\CSS\\Value\\Value\> given\.$#'
1711
identifier: parameterByRef.type

src/RuleSet/DeclarationBlock.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
class DeclarationBlock extends RuleSet
2626
{
2727
/**
28-
* @var array<int, Selector|string>
28+
* @var array<Selector|string>
2929
*/
3030
private $selectors = [];
3131

@@ -76,7 +76,7 @@ public static function parse(ParserState $parserState, $list = null)
7676
}
7777

7878
/**
79-
* @param array<int, Selector|string>|string $selectors
79+
* @param array<Selector|string>|string $selectors
8080
* @param CSSList|null $list
8181
*
8282
* @throws UnexpectedTokenException
@@ -133,9 +133,9 @@ public function removeSelector($selectorToRemove): bool
133133
}
134134

135135
/**
136-
* @return array<int, Selector|string>
136+
* @return array<Selector>
137137
*/
138-
public function getSelectors()
138+
public function getSelectors(): array
139139
{
140140
return $this->selectors;
141141
}

0 commit comments

Comments
 (0)