code: public function router(RouterInterface $router = null) : RouterInterface
      {
          if ($router){
              $this->router = $router;
          }
          if (!$this->router){
              $this->router = new NullRouter;
          }
          return $this->router;
      }
docs: Set/get router
  
  @param RouterInterface $router
  
  @return RouterInterface