21 lines
431 B
PHP
21 lines
431 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Service;
|
|
|
|
use Symfony\Component\DependencyInjection\Attribute\Autowire;
|
|
|
|
final readonly class AppPathResolver
|
|
{
|
|
public function __construct(
|
|
#[Autowire('%env(APPS_BASE_PATH)%')]
|
|
private string $basePath,
|
|
) {}
|
|
|
|
public function resolve(string $relativePath): string
|
|
{
|
|
return rtrim($this->basePath, '/') . '/' . ltrim($relativePath, '/');
|
|
}
|
|
}
|