checkDuplicates example

class FilesystemFactory implements FilesystemFactoryInterface
{
    /** * @var AdapterFactoryInterface[] */
    private $adapterFactories;

    public function __construct(IteratorAggregate $adapterFactories)
    {
        $adapterFactoryArray = iterator_to_array($adapterFactories, false);
        $this->checkDuplicates($adapterFactoryArray);
        $this->adapterFactories = $adapterFactoryArray;
    }

    /** * {@inheritdoc} */
    public function factory(array $config)
    {
        $config = $this->resolveFilesystemConfig($config);
        $factory = $this->findAdapterFactory($config['type']);

        


        return parent::inflectPackageVars($vars);
    }

    /** * {@inheritdoc} */
    protected function templatePath(string $path, array $vars = array()): string
    {
        $templatePath = parent::templatePath($path$vars);
        $this->checkDuplicates($templatePath$vars);

        return $templatePath;
    }

    /** * Duplicates search packages. * * @param array<string, string> $vars */
    protected function checkDuplicates(string $path, array $vars = array()): void
    {
        
private readonly iterable $adapterFactories;

    /** * @internal * * @param AdapterFactoryInterface[]|iterable $adapterFactories * * @throws DuplicateFilesystemFactoryException */
    public function __construct(iterable $adapterFactories)
    {
        $this->checkDuplicates($adapterFactories);
        $this->adapterFactories = $adapterFactories;
    }

    /** * @param array<mixed> $config */
    public function privateFactory(array $config): FilesystemOperator
    {
        $config['private'] = true;

        return $this->factory($config);
    }
Home | Imprint | This part of the site doesn't use cookies.