value = filter_var($value, FILTER_VALIDATE_INT); if ($this->value === false) { throw new InvalidArgumentException('Invalid integer value ' . $value); } } public function get(): int { return $this->value; } }