value = match ($value) { 'true', 'yes', 'y', '1' => true, 'false', 'no', 'n', '0', '' => false, default => throw new InvalidArgumentException('Invalid boolean value ' . $value), }; } public function get(): bool { return $this->value; } }