Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-helldar committed Jun 22, 2023
1 parent 68bd6a9 commit cf9f3d6
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/Support/URI.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
namespace CashierProvider\Core\Support;

use DragonCode\Support\Concerns\Makeable;
use DragonCode\Support\Facades\Helpers\Arr;
use DragonCode\Support\Facades\Http\Builder as HttpBuilder;
use DragonCode\Support\Http\Builder;

use function implode;
use function trim;

class URI
Expand Down Expand Up @@ -51,14 +51,10 @@ protected function parse(): Builder

protected function resolvePath(?string ...$values): ?string
{
$path = [];

foreach ($values as $value) {
if (! empty($value)) {
$path[] = trim($value, '/');
}
}

return implode('/', $path);
return Arr::of($values)
->filter()
->map(fn (string $value) => trim($value))
->implode(DIRECTORY_SEPARATOR)
->toString();
}
}

0 comments on commit cf9f3d6

Please sign in to comment.