Skip to content

Commit ba73f72

Browse files
committed
Changes suggested in review.
1 parent defbc9e commit ba73f72

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

src/Rule/Rule.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,13 @@ public static function parse(ParserState $oParserState): Rule
114114
}
115115

116116
/**
117-
* @param string $sRule
118-
*
119-
* @return array<int, string>
117+
* Returns a list of delimiters (or separators).
120118
* The first item is the innermost separator (or, put another way, the highest-precedence operator).
121119
* The sequence continues to the outermost separator (or lowest-precedence operator).
120+
*
121+
* @param string $sRule
122+
*
123+
* @return list<non-empty-string>
122124
*/
123125
private static function listDelimiterForRule($sRule): array
124126
{

tests/Rule/RuleTest.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
final class RuleTest extends TestCase
1818
{
1919
/**
20-
* @return array<string, array{0: string, 1: array<int, string>}>
20+
* @return array<string, array{0: string, 1: list<class-string>}>
2121
*/
2222
public static function provideRulesAndExpectedParsedValueListTypes(): array
2323
{
@@ -35,7 +35,7 @@ public static function provideRulesAndExpectedParsedValueListTypes(): array
3535
/**
3636
* @test
3737
*
38-
* @param array<int, string> $expectedTypeClassnames
38+
* @param list<class-string> $expectedTypeClassnames
3939
*
4040
* @dataProvider provideRulesAndExpectedParsedValueListTypes
4141
*/
@@ -47,8 +47,11 @@ public function parsesValuesIntoExpectedTypeList(string $rule, array $expectedTy
4747
self::assertInstanceOf(ValueList::class, $value);
4848

4949
$actualClassnames = \array_map(
50-
function ($component): string {
51-
return \get_class($component);
50+
/**
51+
* @param Value|string $component
52+
*/
53+
static function ($component): string {
54+
return \is_string($component) ? 'string' : \get_class($component);
5255
},
5356
$value->getListComponents()
5457
);

0 commit comments

Comments
 (0)