Skip to content

Open-source event management and ticket selling platform — perfect for concerts, conferences, and everything in between 🎟️ If you find this project helpful, please consider giving us a star ⭐️

442 B
Raw Blame
<?php

namespace HiEvents\DataTransferObjects;

class ErrorBagDTO extends BaseDTO
{
    public function __construct(
        /**
         * @var array<string, string>
         */
        public array $errors = [],
    ) {}

    public function addError(string $key, string $message): void
    {
        $this->errors[$key] = $message;
    }

    public function toArray(array $without = []): array
    {
        return $this->errors;
    }
}