Esempio n. 1
0
 public function processRequest(ServerRequestInterface $request) : int
 {
     $ret = $this->dispatcher->dispatch($request->getMethod(), $request->getUri()->getPath());
     switch ($ret[0]) {
         case Dispatcher::FOUND:
             $this->route = $this->collection->getRoute($ret[1]);
             $this->vars = $ret[2];
             return RouterInterface::STATUS_FOUND;
         case Dispatcher::METHOD_NOT_ALLOWED:
             $this->allowed = $ret[1];
             return RouterInterface::STATUS_NOT_ALLOWED;
         default:
             return RouterInterface::STATUS_NOT_FOUND;
     }
 }