Files
many-notes/app/Actions/ResolveTwoPaths.php
2025-01-26 18:57:20 +00:00

20 lines
421 B
PHP

<?php
declare(strict_types=1);
namespace App\Actions;
use GuzzleHttp\Psr7\UriResolver;
use GuzzleHttp\Psr7\Utils;
final class ResolveTwoPaths
{
public function handle(string $currentPath, string $path): string
{
$uri = Utils::uriFor(mb_trim($path));
$resolvedUri = (string) UriResolver::resolve(Utils::uriFor(mb_trim($currentPath)), $uri);
return mb_ltrim($resolvedUri, '/');
}
}