Skip to content

Commit

Permalink
Merge pull request #6585 from orklah/truthy
Browse files Browse the repository at this point in the history
fix isAlwaysTruthy: TNonEmptyString can be falsy (with '0')
  • Loading branch information
orklah committed Oct 5, 2021
2 parents 96ed252 + 20bb5f1 commit 2956220
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Psalm/Type/Union.php
Expand Up @@ -1045,11 +1045,11 @@ public function isAlwaysTruthy(): bool
continue;
}

if ($atomic_type instanceof Type\Atomic\TNonEmptyString) {
if ($atomic_type instanceof Type\Atomic\TNonFalsyString) {
continue;
}

if ($atomic_type instanceof Type\Atomic\TNonEmptyNonspecificLiteralString) {
if ($atomic_type instanceof Type\Atomic\TCallableString) {
continue;
}

Expand Down

0 comments on commit 2956220

Please sign in to comment.