public function prepend(FilterChain $chain)
    {
        $priorities = array_keys($this->filters);
        if (count($priorities)) {
            $priority = min(array_keys($this->filters)) - 1;
        } else {
            $priority = 0;
        }
        $filters = $chain->getFilters();
        foreach ($filters as $filter) {
            $this->add($filter, $priority);
        }
        return $this;
    }