F2m2\Apidocs\Commands\ApiDocsGenerator::getEndpoints PHP Method

getEndpoints() protected method

Returns an array of endpoints
protected getEndpoints ( ) : array
return array
    protected function getEndpoints()
    {
        $endpoints = [];
        foreach ($this->routes as $route) {
            $array = explode("@", $route['action']);
            $class = $array[0];
            if ($class == "Closure") {
                // check for api/v1/docs
                if (strpos($route['uri'], $this->prefix . '/docs') !== false) {
                    continue;
                }
            }
            $reflector = new ReflectionClass($class);
            $docBlock = new DocBlock($reflector);
            // remove Controller
            $class = str_replace('Controller', '', $class);
            $endpoints["{$class}"]['methods'] = [];
            $endpoints["{$class}"]['description'] = $docBlock->getShortDescription();
        }
        return $this->getEndpointMethods($endpoints);
    }