public function setController($controller)
    {
        // controller must be a callable
        if (!is_callable($controller)) {
            throw new \LogicException(sprintf(
                'The controller must be a callable (%s given).',
                gettype($controller)
            ));
        }

        $this->controller = $controller;
    }