public function add($pattern, $callback): self
    {
        if (is_string($pattern)) {
            if (!isset($pattern{0})) {
                throw new \InvalidArgumentException('The pattern argument must be a not empty string or array of not empty strings');
            }
            $pattern = [$pattern];
        } elseif (is_array($pattern)) {
            if (empty($pattern)) {
                throw new \InvalidArgumentException('The pattern argument must be a not empty string or array of not empty strings');
            }
            foreach ($pattern as $_pattern) {
                if (!is_string($_pattern)) {
                    throw new \InvalidArgumentException('The pattern argument must be a not empty string or array of not empty strings');
                }
                if (!isset($_pattern{0})) {
                    throw new \InvalidArgumentException('The pattern argument must be a not empty string or array of not empty strings');
                }
            }
        } else {
            throw new \InvalidArgumentException('The pattern argument must be a not empty string or array of not empty strings');
        }
        if (is_callable($callback)) {
            $callback = [$callback];
        } elseif (is_array($callback)) {
            if (empty($callback)) {
                throw new \InvalidArgumentException('The callback argument must be a valid callable or array of valid callables');
            }
            foreach ($callback as $_callback) {
                if (!is_callable($_callback)) {
                    throw new \InvalidArgumentException('The callback argument must be a valid callable or array of valid callables');
                }
            }
        } else {
            throw new \InvalidArgumentException('The callback argument must be a valid callable or array of valid callables');
        }
        $this->data[] = [$pattern, $callback];
        return $this;
    }