File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -457,13 +457,13 @@ public function specifyTypesInCondition(
457457 ) {
458458 $ newScope = $ scope ->filterBySpecifiedTypes ($ result );
459459 $ callType = $ newScope ->getType ($ expr ->right );
460- $ newContext = TypeSpecifierContext::createTrue ($ callType );
460+ $ newContext = TypeSpecifierContext::createTruthy ($ callType );
461461
462- return $ this ->specifyTypesInCondition (
462+ $ result = $ result -> unionWith ( $ this ->specifyTypesInCondition (
463463 $ scope ,
464464 $ expr ->right ,
465465 $ newContext ,
466- )->setRootExpr ($ expr );
466+ )->setRootExpr ($ expr )) ;
467467 }
468468
469469 return $ result ;
Original file line number Diff line number Diff line change @@ -45,19 +45,19 @@ public static function createTrue(?Type $returnType = null): self
4545 return self ::create (self ::CONTEXT_TRUE , $ returnType );
4646 }
4747
48- public static function createTruthy (): self
48+ public static function createTruthy (? Type $ returnType = null ): self
4949 {
50- return self ::create (self ::CONTEXT_TRUTHY );
50+ return self ::create (self ::CONTEXT_TRUTHY , $ returnType );
5151 }
5252
5353 public static function createFalse (?Type $ returnType = null ): self
5454 {
5555 return self ::create (self ::CONTEXT_FALSE , $ returnType );
5656 }
5757
58- public static function createFalsey (): self
58+ public static function createFalsey (? Type $ returnType = null ): self
5959 {
60- return self ::create (self ::CONTEXT_FALSEY );
60+ return self ::create (self ::CONTEXT_FALSEY , $ returnType );
6161 }
6262
6363 public static function createNull (): self
You can’t perform that action at this time.
0 commit comments