Raml\ApiDefinition::getMethodsAsArray PHP Method

getMethodsAsArray() private method

GET /songs => [api.example.org, /songs, GET, [https], Raml\Method] GET /songs/{songId} => [api.example.org, /songs/{songId}, GET, [https], Raml\Method]
private getMethodsAsArray ( array $resources ) : array[BasicRoute]
$resources array
return array[BasicRoute]
    private function getMethodsAsArray(array $resources)
    {
        $all = [];
        $baseUrl = $this->getBaseUrl();
        $protocols = $this->protocols;
        // Loop over each resource to build out the full URI's that it has.
        foreach ($resources as $resource) {
            $path = $resource->getUri();
            foreach ($resource->getMethods() as $method) {
                $all[$method->getType() . ' ' . $path] = new BasicRoute($baseUrl, $path, $protocols, $method->getType(), $resource->getUriParameters(), $resource->getMethod($method->getType()));
            }
            $all = array_merge_recursive($all, $this->getMethodsAsArray($resource->getResources()));
        }
        return $all;
    }