description = $description; return $this; } /** * Set the parameter as optional (or not). * @param bool $optional True to set the parameter as optional. * @return $this */ public function optional(bool $optional = true): static { $this->optional = $optional; return $this; } /** * Set the parameter as required. * @return $this */ public function require(): static { return $this->optional(false); } /** * Get parameter description. * @return string */ public function getDescription(): string { return $this->description ?? ""; } /** * Determine if the parameter is required or not. * @return bool True if the parameter is required. */ public function isRequired(): bool { return !$this->optional; } }