errors[] = [ 'element' => $elementName, 'code' => $code, 'message' => $message ]; } public function hasErrors(): bool { return count($this->errors) > 0; } public function getErrors(): array { return $this->errors; } public function setValue(string $name, $value): void { $this->values[$name] = $value; } public function getValue(string $name) { return $this->values[$name] ?? null; } public function getValues(): array { return $this->values; } public function toDto(): array { } }