protected function addFilter($when, $action, $callback)
    {
        if (!is_callable($callback) && !is_array($callback)) {
            $callback = [$this, $callback];
        }

        if (is_array($action)) {
            foreach ($action as $method) {
                $this->addFilter($when, $method, $callback);
            }
        } else {
            EventDispatcher::addListener("{$when}." . get_called_class() . "::{$action}", $callback);
        }
    }