Вход Регистрация
Файл: vendor/league/flysystem/src/UrlGeneration/ChainedPublicUrlGenerator.php
Строк: 36
<?php

declare(strict_types=1);

namespace 
LeagueFlysystemUrlGeneration;

use 
LeagueFlysystemConfig;
use 
LeagueFlysystemUnableToGeneratePublicUrl;

final class 
ChainedPublicUrlGenerator implements PublicUrlGenerator
{
    
/**
     * @param PublicUrlGenerator[] $generators
     */
    
public function __construct(private iterable $generators)
    {
    }

    public function 
publicUrl(string $pathConfig $config): string
    
{
        foreach (
$this->generators as $generator) {
            try {
                return 
$generator->publicUrl($path$config);
            } catch (
UnableToGeneratePublicUrl) {
            }
        }

        throw new 
UnableToGeneratePublicUrl('No supported public url generator found.'$path);
    }
}
Онлайн: 1
Реклама