- Removed dependencies from unexisting methods

This commit is contained in:
Dave Mc Nicoll 2024-11-10 13:07:22 +00:00
parent f5317f906d
commit d2202066ba
2 changed files with 4 additions and 4 deletions

View File

@ -19,7 +19,7 @@ trait LeanApiTrait
if (str_contains($markdown, '{route:descriptor}'))
{
$describe = (new RouteDescriptor($this))->describe();
$describe = (new RouteDescriptor($this, $this->picea->compiler->getExtensionFromToken('url')))->describe();
$markdown = str_replace('{route:descriptor}', $describe, $markdown);
}

View File

@ -5,8 +5,7 @@ namespace Lean\Api;
use Lean\Factory\HttpFactory;
use Notes\ObjectReflection;
use Notes\Route\Attribute\Method\Route;
use function CSSLSJ\Reprise\Api\View\{ _, lang, url, route, form };
use Picea\Extension\UrlExtension;
class RouteDescriptor
{
@ -20,6 +19,7 @@ HTML;
public function __construct(
public object $controller,
protected UrlExtension $urlExtension,
) {}
/**
@ -40,7 +40,7 @@ HTML;
$route = $routeAttribute->object;
$path = rtrim($route->route, '/');
$cleaned = $this->cleanRouteFromRegex($base.$path);
$url = url($cleaned);
$url = $this->urlExtension->buildUrl($cleaned);
$html .= sprintf($this->routeLine, $url, $base.$path, $cleaned, $route->description, implode(', ', (array)$route->method), $route->name );
}