code: public static function createFromApplication(Application $app)
      {
          $dispatch = new static($app->request, $app->resolver, $app->config);
          $dispatch->setApplication($app);
          return $dispatch;
      }
docs: Create a new dispatcher using an application object
  @param Application $app The Application object from which to get the required variables
  @return Dispatcher The dispatcher instance