Phprest\Util\Controller::registerRoutes PHP Method

registerRoutes() protected method

protected registerRoutes ( ) : void
return void
    protected function registerRoutes()
    {
        $reader = new AnnotationReader();
        $class = new \ReflectionClass($this);
        /** @var RouteCollection $router */
        $router = $this->getContainer()->get(Application::CONTAINER_ID_ROUTER);
        /** @var \ReflectionMethod $method */
        foreach ($class->getMethods(\ReflectionMethod::IS_PUBLIC) as $method) {
            $this->registerRoute($router, $class, $method, $reader->getMethodAnnotation($method, '\\Phprest\\Annotation\\Route'));
        }
    }