public function add($middleware)
    {
        $object = $this->marshalMiddleware($middleware);

        if (count($this->stack)) {
            $object->setNext($this->stack->top());
        }

        $this->stack[] = $object;

        return $this;
    }