Skip to content

Commit 3a11b24

Browse files
Add failing tests
1 parent dde1b67 commit 3a11b24

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

tests/PHPStan/Analyser/nsrt/pr-5379.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
namespace PR5379;
66

7+
use ArrayAccess;
8+
79
use function PHPStan\Testing\assertType;
810

911
class AggregationParser
@@ -36,3 +38,33 @@ private static function buildFieldName(): string
3638
}
3739
}
3840

41+
class AggregationParser2
42+
{
43+
private function parseAggregation(string $aggregation, string $type)
44+
{
45+
if (empty($aggregation[1]) && $type !== 'filter') {
46+
return null;
47+
}
48+
assertType('string', $type);
49+
50+
if ($type !== 'filter') {
51+
assertType('string', $type);
52+
}
53+
54+
assertType('string', $type);
55+
}
56+
57+
private function parseAggregation2(ArrayAccess $aggregation, string $type)
58+
{
59+
if (empty($aggregation['foo']) && $type !== 'filter') {
60+
return null;
61+
}
62+
assertType('string', $type);
63+
64+
if ($type !== 'filter') {
65+
assertType('string', $type);
66+
}
67+
68+
assertType('string', $type);
69+
}
70+
}

0 commit comments

Comments
 (0)