@@ -478,12 +478,12 @@ public function isCloneable(): TrinaryLogic
478
478
479
479
public function isSmallerThan (Type $ otherType ): TrinaryLogic
480
480
{
481
- return $ this ->unionResults (static fn (Type $ type ): TrinaryLogic => $ type ->isSmallerThan ($ otherType ));
481
+ return $ this ->notBenevolentUnionResults (static fn (Type $ type ): TrinaryLogic => $ type ->isSmallerThan ($ otherType ));
482
482
}
483
483
484
484
public function isSmallerThanOrEqual (Type $ otherType ): TrinaryLogic
485
485
{
486
- return $ this ->unionResults (static fn (Type $ type ): TrinaryLogic => $ type ->isSmallerThanOrEqual ($ otherType ));
486
+ return $ this ->notBenevolentUnionResults (static fn (Type $ type ): TrinaryLogic => $ type ->isSmallerThanOrEqual ($ otherType ));
487
487
}
488
488
489
489
public function getSmallerType (): Type
@@ -508,12 +508,12 @@ public function getGreaterOrEqualType(): Type
508
508
509
509
public function isGreaterThan (Type $ otherType ): TrinaryLogic
510
510
{
511
- return $ this ->unionResults (static fn (Type $ type ): TrinaryLogic => $ otherType ->isSmallerThan ($ type ));
511
+ return $ this ->notBenevolentUnionResults (static fn (Type $ type ): TrinaryLogic => $ otherType ->isSmallerThan ($ type ));
512
512
}
513
513
514
514
public function isGreaterThanOrEqual (Type $ otherType ): TrinaryLogic
515
515
{
516
- return $ this ->unionResults (static fn (Type $ type ): TrinaryLogic => $ otherType ->isSmallerThanOrEqual ($ type ));
516
+ return $ this ->notBenevolentUnionResults (static fn (Type $ type ): TrinaryLogic => $ otherType ->isSmallerThanOrEqual ($ type ));
517
517
}
518
518
519
519
public function toBoolean (): BooleanType
@@ -668,6 +668,14 @@ protected function unionResults(callable $getResult): TrinaryLogic
668
668
return TrinaryLogic::extremeIdentity (...array_map ($ getResult , $ this ->types ));
669
669
}
670
670
671
+ /**
672
+ * @param callable(Type $type): TrinaryLogic $getResult
673
+ */
674
+ private function notBenevolentUnionResults (callable $ getResult ): TrinaryLogic
675
+ {
676
+ return TrinaryLogic::extremeIdentity (...array_map ($ getResult , $ this ->types ));
677
+ }
678
+
671
679
/**
672
680
* @param callable(Type $type): Type $getType
673
681
*/
0 commit comments