diff --git a/src/TrinaryLogic.php b/src/TrinaryLogic.php index 81db0e1159..fe08c0aa69 100644 --- a/src/TrinaryLogic.php +++ b/src/TrinaryLogic.php @@ -53,16 +53,28 @@ private static function create(int $value): self return self::$registry[$value]; } + /** + * @phpstan-assert-if-true =false $this->no() + * @phpstan-assert-if-true =false $this->maybe() + */ public function yes(): bool { return $this->value === self::YES; } + /** + * @phpstan-assert-if-true =false $this->no() + * @phpstan-assert-if-true =false $this->yes() + */ public function maybe(): bool { return $this->value === self::MAYBE; } + /** + * @phpstan-assert-if-true =false $this->maybe() + * @phpstan-assert-if-true =false $this->yes() + */ public function no(): bool { return $this->value === self::NO; diff --git a/src/Type/AcceptsResult.php b/src/Type/AcceptsResult.php index 2358285f16..36a3b598cf 100644 --- a/src/Type/AcceptsResult.php +++ b/src/Type/AcceptsResult.php @@ -26,16 +26,28 @@ public function __construct( { } + /** + * @phpstan-assert-if-true =false $this->no() + * @phpstan-assert-if-true =false $this->maybe() + */ public function yes(): bool { return $this->result->yes(); } + /** + * @phpstan-assert-if-true =false $this->no() + * @phpstan-assert-if-true =false $this->yes() + */ public function maybe(): bool { return $this->result->maybe(); } + /** + * @phpstan-assert-if-true =false $this->maybe() + * @phpstan-assert-if-true =false $this->yes() + */ public function no(): bool { return $this->result->no(); diff --git a/src/Type/IsSuperTypeOfResult.php b/src/Type/IsSuperTypeOfResult.php index c1decae155..7fddea5c04 100644 --- a/src/Type/IsSuperTypeOfResult.php +++ b/src/Type/IsSuperTypeOfResult.php @@ -26,16 +26,28 @@ public function __construct( { } + /** + * @phpstan-assert-if-true =false $this->no() + * @phpstan-assert-if-true =false $this->maybe() + */ public function yes(): bool { return $this->result->yes(); } + /** + * @phpstan-assert-if-true =false $this->no() + * @phpstan-assert-if-true =false $this->yes() + */ public function maybe(): bool { return $this->result->maybe(); } + /** + * @phpstan-assert-if-true =false $this->maybe() + * @phpstan-assert-if-true =false $this->yes() + */ public function no(): bool { return $this->result->no();