Adamgoose\Routing\Annotations\MethodEndpoint::toRouteDefinition PHP Method

toRouteDefinition() public method

Transform the endpoint into a route definition.
public toRouteDefinition ( ) : string
return string
    public function toRouteDefinition()
    {
        $routes = [];
        foreach ($this->paths as $path) {
            $routes[] = sprintf($this->getTemplate(), $path->verb, $path->path, $this->uses, var_export($path->as, true), $this->getMiddleware($path), $this->implodeArray($path->where), var_export($path->domain, true));
        }
        return implode(PHP_EOL . PHP_EOL, $routes);
    }