public function addError(string $field, string $error, $options = []) {
        if (empty($error)) {
            throw new \InvalidArgumentException('The error code cannot be empty.', 500);
        } elseif (!in_array(gettype($options), ['integer', 'array'], true)) {
            throw new \InvalidArgumentException('$options must be an integer or array.', 500);
        }
        if (is_int($options)) {
            trigger_error('Passing an integer for $options in Validation::addError() is deprecated.', E_USER_DEPRECATED);
            $options = ['code' => $options];
        } elseif (isset($options['status'])) {
            trigger_error('Validation::addError() expects $options[\'number\'], not $options[\'status\'].', E_USER_DEPRECATED);
            $options['code'] = $options['status'];
            unset($options['status']);
        }

        $row = ['error' => $error] + $options;
        $this->errors[$field][] = $row;

        return $this;
    }