<?php
namespace Claromentis\Infocapture;

$GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"] ?: array()) + array("_e608e5b5c4c3" . "4a67ba97ef84c" . "1e16199" => base64_decode("Jw=" . "="), "_faff366b90fa2" . "9952d16f53c94c" . "65728" => base64_decode("UmVwb3NpdG9ye" . "SBub3QgZm91bm" . "QgZm9yIGVudGl" . "0eSAn"));
use Claromentis\Infocapture\Exception\RepositoryNotFoundException;
use Claromentis\Infocapture\Repository\InfocaptureRepositoryInterface;
use Psr\Container\ContainerInterface;
use Webmozart\Assert\Assert;






class RepositoryManager
{
    
    
    
    
    protected ContainerInterface $container;
    
    
    
    
    
    
    protected array $repositories = [];
    
    
    
    
    
    public function __construct(ContainerInterface $_5e4594441b0e531bfd6f0011e0327611, array $_bb5824be9be68ab5182fd7fd46f0ca6a)
    {
        $this->container = $_5e4594441b0e531bfd6f0011e0327611;
        foreach ($_bb5824be9be68ab5182fd7fd46f0ca6a as $_ba1f6e266e3ebd29f620349be8ec92a5 => $_8652ba33e6ffeba02459fa9cbb320851) {
            $this->addRepository($_ba1f6e266e3ebd29f620349be8ec92a5, $_8652ba33e6ffeba02459fa9cbb320851);
        }
    }
    
    
    
    
    
    
    public function addRepository(string $_ba1f6e266e3ebd29f620349be8ec92a5, string $_e987912b737cc8177748aac5f525db70)
    {
        Assert::isAOf($_e987912b737cc8177748aac5f525db70, InfocaptureRepositoryInterface::class);
        $this->repositories[$_ba1f6e266e3ebd29f620349be8ec92a5] = $_e987912b737cc8177748aac5f525db70;
    }
    
    
    
    
    
    
    
    public function hasRepository(string $_ba1f6e266e3ebd29f620349be8ec92a5) : bool
    {
        return isset($this->repositories[$_ba1f6e266e3ebd29f620349be8ec92a5]) && $this->container->has($this->repositories[$_ba1f6e266e3ebd29f620349be8ec92a5]);
    }
    
    
    
    
    
    
    public function getRepository(string $_ba1f6e266e3ebd29f620349be8ec92a5) : InfocaptureRepositoryInterface
    {
        if (!isset($this->repositories[$_ba1f6e266e3ebd29f620349be8ec92a5])) {
            throw new RepositoryNotFoundException($GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_faff366b90fa299" . "52d16f53c94c6572" . "8"] . $_ba1f6e266e3ebd29f620349be8ec92a5 . $GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_e608e5b" . "5c4c34a6" . "7ba97ef8" . "4c1e1619" . "9"]);
        }
        return $this->container->get($this->repositories[$_ba1f6e266e3ebd29f620349be8ec92a5]);
    }
}