src/DecoratorStack.php
public function add(callable $decorator, $priority = 0)
    {
        $this->stack[] = array(
            'decorator' => $decorator,
            'priority' => $priority,
            'index' => $this->index
        );
        $this->index--;
        uasort($this->stack, array($this, 'compareStackItems'));

        return $this;
    }
public function add(callable $decorator, $priority = 0)
    {
        $this->stack[] = array(
            'decorator' => $decorator,
            'priority' => $priority,
            'index' => $this->index
        );
        $this->index--;
        uasort($this->stack, array($this, 'compareStackItems'));

        return $this;
    }
Add a decorator to the stack

@param callable $decorator
@param int $priority
@return $this