Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
28101ef
Fix phpstan/phpstan#12597: Variable might not be undefined after in_a…
staabm Apr 1, 2026
2543d6e
Add regression tests for phpstan/phpstan#13591, #10422, #10055
phpstan-bot Apr 2, 2026
c59d42d
test with userland comparator
staabm Apr 2, 2026
665967d
Relax subtype matching to work with non-finite union guard types
phpstan-bot Apr 2, 2026
437bf38
Add regression tests for phpstan/phpstan#4090, #11218
phpstan-bot Apr 2, 2026
06c54f7
Update DefinedVariableRuleTest.php
staabm Apr 2, 2026
d2adea9
Update bug-4090.php
staabm Apr 2, 2026
df5c834
add failling test
staabm Apr 2, 2026
e9fdca7
Fix subtype matching regression: restrict guard to UnionType
phpstan-bot Apr 2, 2026
daf40dd
Add comment explaining why instanceof UnionType is the correct guard
phpstan-bot Apr 2, 2026
4d3ed52
Remove bar() test case from bug-4090 regression test
phpstan-bot Apr 2, 2026
6eb0f48
Extend subtype matching to IntegerRangeType guards and restore bar() …
phpstan-bot Apr 2, 2026
4b8610d
Replace instanceof checks with getFiniteTypes() for subtype matching …
phpstan-bot Apr 2, 2026
0945d6a
Revert "Replace instanceof checks with getFiniteTypes() for subtype m…
VincentLanglet Apr 2, 2026
ec4322e
Update MutatingScope.php
staabm Apr 2, 2026
2ae5477
Update MutatingScope.php
staabm Apr 2, 2026
89f7ec4
cs
staabm Apr 2, 2026
11b2b22
Update MutatingScope.php
staabm Apr 2, 2026
e18ae09
Update bug-12597.php
staabm Apr 2, 2026
9ede808
Update MutatingScope.php
staabm Apr 2, 2026
dde1b67
move test
staabm Apr 2, 2026
3a11b24
Add failing tests
VincentLanglet Apr 2, 2026
3adae85
Update MutatingScope.php
staabm Apr 2, 2026
2abc27a
Delete tests/PHPStan/Analyser/nsrt/bug-10055.php
staabm Apr 2, 2026
957c096
Fix hallucination
VincentLanglet Apr 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add failing tests
  • Loading branch information
VincentLanglet committed Apr 2, 2026
commit 3a11b2409263bc229772d21ecc962dbd3e4eacf3
32 changes: 32 additions & 0 deletions tests/PHPStan/Analyser/nsrt/pr-5379.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace PR5379;

use ArrayAccess;

use function PHPStan\Testing\assertType;

class AggregationParser
Expand Down Expand Up @@ -36,3 +38,33 @@ private static function buildFieldName(): string
}
}

class AggregationParser2
{
private function parseAggregation(string $aggregation, string $type)
{
if (empty($aggregation[1]) && $type !== 'filter') {
return null;
}
assertType('string', $type);

if ($type !== 'filter') {
assertType('string', $type);
}

assertType('string', $type);
}

private function parseAggregation2(ArrayAccess $aggregation, string $type)
{
if (empty($aggregation['foo']) && $type !== 'filter') {
return null;
}
assertType('string', $type);

if ($type !== 'filter') {
assertType('string', $type);
}

assertType('string', $type);
}
}
Loading