/** * @param ApplicationInterface $app * @return bool * @throws Exception */ public function run(ApplicationInterface $app) : bool { // check route filter if ($this->getFilter() != '*') { $request = $app->getRequest(); if (!$request) { throw new Exception('Cannot run RouteFilter: no request has been set'); } $route = $request->getRoute(); if (!$route) { throw new Exception('Cannot run RouteFilter: no route has been set'); } if (!$app->getRouteMatcher()->match($this->getFilter(), $route)) { return false; } } return true; }