*/ private array $flashMessages = []; public function __construct(private readonly string $actionName) { $this->argumentsValidationResult = new Result(); parent::__construct('php://temp', 204); } public function withControllerName(string $controllerName): self { $clone = clone $this; $clone->controllerName = $controllerName; return $clone; } public function withoutControllerName(): self { $clone = clone $this; $clone->controllerName = null; return $clone; } public function withExtensionName(string $extensionName): self { $clone = clone $this; $clone->extensionName = $extensionName; return $clone; } public function withoutExtensionName(): self { $clone = clone $this; $this->extensionName = null; return $clone; } public function withArguments(array $arguments): self { $clone = clone $this; $clone->arguments = $arguments; return $clone; } public function withoutArguments(): self { $clone = clone $this; $this->arguments = null; return $clone; } public function withArgumentsValidationResult(Result $argumentsValidationResult): self { $clone = clone $this; $clone->argumentsValidationResult = $argumentsValidationResult; return $clone; } public function withFlashMessages(FlashMessage ...$flashMessages): self { if ($flashMessages === []) { return $this; } $clone = clone $this; $clone->flashMessages = array_merge($this->flashMessages, $flashMessages); return $clone; } public function getActionName(): string { return $this->actionName; } public function getControllerName(): ?string { return $this->controllerName; } public function getExtensionName(): ?string { return $this->extensionName; } public function getArguments(): ?array { return $this->arguments; } public function getArgumentsValidationResult(): Result { return $this->argumentsValidationResult; } /** * @return list */ public function getFlashMessages(): array { return $this->flashMessages; } }