/** * Create a dispatcher that has all the configured middleware applied. * * @return \Cake\Routing\Dispatcher */ public static function create() { $dispatcher = new Dispatcher(); foreach (static::$_stack as $middleware) { $dispatcher->addFilter($middleware); } return $dispatcher; }