status, [ self::STATUS_NO_LICENSE, self::STATUS_INVALID, self::STATUS_VALID, self::STATUS_UNKNOWN, ]); } public function isValid(): bool { return $this->status === self::STATUS_VALID; } public function hasNoLicense(): bool { return $this->status === self::STATUS_NO_LICENSE; } public static function noLicense(): self { return new self(self::STATUS_NO_LICENSE, null); } public static function valid(License $license): self { return new self(self::STATUS_VALID, $license); } public static function invalid(License $license): self { return new self(self::STATUS_INVALID, $license); } public static function unknown(License $license): self { return new self(self::STATUS_UNKNOWN, $license); } }