Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ade3496

Browse files
Merge branch 'empty-hotfix2' into 1.1.x
2 parents 7267329 + 6b93db7 commit ade3496

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎src/Type/PHPUnit/Assert/AssertTypeSpecifyingExtensionHelper.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use PhpParser\Node\Expr\FuncCall;
1414
use PhpParser\Node\Expr\Instanceof_;
1515
use PhpParser\Node\Name;
16+
use PhpParser\Node\Scalar\LNumber;
1617
use PHPStan\Analyser\Scope;
1718
use PHPStan\Analyser\SpecifiedTypes;
1819
use PHPStan\Analyser\TypeSpecifier;
@@ -162,7 +163,10 @@ private static function getExpressionResolvers(): array
162163
return new Expr\BinaryOp\BooleanOr(
163164
new Instanceof_($actual->value, new Name(EmptyIterator::class)),
164165
new Expr\BinaryOp\BooleanOr(
165-
new Instanceof_($actual->value, new Name(Countable::class)),
166+
new Expr\BinaryOp\BooleanAnd(
167+
new Instanceof_($actual->value, new Name(Countable::class)),
168+
new Identical(new FuncCall(new Name('count'), [new Arg($actual->value)]), new LNumber(0))
169+
),
166170
new Expr\Empty_($actual->value)
167171
)
168172
);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /