mirror of
https://github.com/brufdev/many-notes.git
synced 2026-01-24 20:09:50 -06:00
20 lines
421 B
PHP
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, '/');
|
|
}
|
|
}
|