flag = $flag; $this->isSet = $isSet; } /** * @psalm-param Flag::* $flag */ public static function is(string $flag): self { return new self($flag, true); } /** * @psalm-param Flag::* $flag */ public static function not(string $flag): self { return new self($flag, false); } public function invert(): self { return new self($this->flag, !$this->isSet); } /** * @psalm-return Flag::* */ public function getFlag(): string { return $this->flag; } public function isSet(): bool { return $this->isSet; } }