<?php

use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\DependencyInjection\Exception\LogicException;
use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException;
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;

/**
 * @internal This class has been auto-generated by the Symfony Dependency Injection Component.
 */
class Symfony_DI_PhpDumper_Test_Almost_Circular_Private extends Container
{
    protected $parameters = [];
    protected readonly \WeakReference $ref;

    public function __construct()
    {
        $this->ref = \WeakReference::create($this);
        $this->services = $this->privates = [];
        $this->methodMap = [
            'bar2' => 'getBar2Service',
            'bar3' => 'getBar3Service',
            'baz6' => 'getBaz6Service',
            'connection' => 'getConnectionService',
            'connection2' => 'getConnection2Service',
            'doctrine.entity_manager' => 'getDoctrine_EntityManagerService',
            'foo' => 'getFooService',
            'foo2' => 'getFoo2Service',
            'foo5' => 'getFoo5Service',
            'foo6' => 'getFoo6Service',
            'foobar4' => 'getFoobar4Service',
            'listener3' => 'getListener3Service',
            'listener4' => 'getListener4Service',
            'logger' => 'getLoggerService',
            'manager' => 'getManagerService',
            'manager2' => 'getManager2Service',
            'manager3' => 'getManager3Service',
            'monolog.logger' => 'getMonolog_LoggerService',
            'monolog_inline.logger' => 'getMonologInline_LoggerService',
            'pA' => 'getPAService',
            'root' => 'getRootService',
            'subscriber' => 'getSubscriberService',
        ];

        $this->aliases = [];
    }

    public function compile(): void
    {
        throw new LogicException('You cannot compile a dumped container that was already compiled.');
    }

    public function isCompiled(): bool
    {
        return true;
    }

    public function getRemovedIds(): array
    {
        return [
            'bar' => true,
            'bar5' => true,
            'bar6' => true,
            'config' => true,
            'config2' => true,
            'connection3' => true,
            'connection4' => true,
            'dispatcher' => true,
            'dispatcher2' => true,
            'doctrine.config' => true,
            'doctrine.entity_listener_resolver' => true,
            'doctrine.listener' => true,
            'foo4' => true,
            'foobar' => true,
            'foobar2' => true,
            'foobar3' => true,
            'level2' => true,
            'level3' => true,
            'level4' => true,
            'level5' => true,
            'level6' => true,
            'logger2' => true,
            'mailer.transport' => true,
            'mailer.transport_factory' => true,
            'mailer.transport_factory.amazon' => true,
            'mailer_inline.mailer' => true,
            'mailer_inline.transport_factory' => true,
            'mailer_inline.transport_factory.amazon' => true,
            'manager4' => true,
            'monolog.logger_2' => true,
            'monolog_inline.logger_2' => true,
            'multiuse1' => true,
            'pB' => true,
            'pC' => true,
            'pD' => true,
            'subscriber2' => true,
        ];
    }

    /**
     * Gets the public 'bar2' shared service.
     *
     * @return \BarCircular
     */
    protected static function getBar2Service($container)
    {
        $container->services['bar2'] = $instance = new \BarCircular();

        $instance->addFoobar(new \FoobarCircular(($container->services['foo2'] ?? self::getFoo2Service($container))));

        return $instance;
    }

    /**
     * Gets the public 'bar3' shared service.
     *
     * @return \BarCircular
     */
    protected static function getBar3Service($container)
    {
        $container->services['bar3'] = $instance = new \BarCircular();

        $a = new \FoobarCircular();

        $instance->addFoobar($a, $a);

        return $instance;
    }

    /**
     * Gets the public 'baz6' shared service.
     *
     * @return \stdClass
     */
    protected static function getBaz6Service($container)
    {
        $container->services['baz6'] = $instance = new \stdClass();

        $instance->bar6 = ($container->privates['bar6'] ?? self::getBar6Service($container));

        return $instance;
    }

    /**
     * Gets the public 'connection' shared service.
     *
     * @return \stdClass
     */
    protected static function getConnectionService($container)
    {
        $a = new \stdClass();

        $b = new \stdClass();

        $container->services['connection'] = $instance = new \stdClass($a, $b);

        $b->logger = ($container->services['logger'] ?? self::getLoggerService($container));

        $a->subscriber = ($container->services['subscriber'] ?? self::getSubscriberService($container));

        return $instance;
    }

    /**
     * Gets the public 'connection2' shared service.
     *
     * @return \stdClass
     */
    protected static function getConnection2Service($container)
    {
        $a = new \stdClass();

        $b = new \stdClass();

        $container->services['connection2'] = $instance = new \stdClass($a, $b);

        $c = new \stdClass($instance);

        $d = ($container->services['manager2'] ?? self::getManager2Service($container));

        $c->handler2 = new \stdClass($d);

        $b->logger2 = $c;

        $a->subscriber2 = new \stdClass($d);

        return $instance;
    }

    /**
     * Gets the public 'doctrine.entity_manager' shared service.
     *
     * @return \stdClass
     */
    protected static function getDoctrine_EntityManagerService($container)
    {
        $containerRef = $container->ref;

        $a = new \stdClass();
        $a->resolver = new \stdClass(new RewindableGenerator(function () use ($containerRef) {
            $container = $containerRef->get();

            yield 0 => ($container->privates['doctrine.listener'] ?? self::getDoctrine_ListenerService($container));
        }, 1));
        $a->flag = 'ok';

        return $container->services['doctrine.entity_manager'] = \FactoryChecker::create($a);
    }

    /**
     * Gets the public 'foo' shared service.
     *
     * @return \FooCircular
     */
    protected static function getFooService($container)
    {
        $a = new \BarCircular();

        $container->services['foo'] = $instance = new \FooCircular($a);

        $a->addFoobar(new \FoobarCircular($instance));

        return $instance;
    }

    /**
     * Gets the public 'foo2' shared service.
     *
     * @return \FooCircular
     */
    protected static function getFoo2Service($container)
    {
        $a = ($container->services['bar2'] ?? self::getBar2Service($container));

        if (isset($container->services['foo2'])) {
            return $container->services['foo2'];
        }

        return $container->services['foo2'] = new \FooCircular($a);
    }

    /**
     * Gets the public 'foo5' shared service.
     *
     * @return \stdClass
     */
    protected static function getFoo5Service($container)
    {
        $container->services['foo5'] = $instance = new \stdClass();

        $a = new \stdClass($instance);
        $a->foo = $instance;

        $instance->bar = $a;

        return $instance;
    }

    /**
     * Gets the public 'foo6' shared service.
     *
     * @return \stdClass
     */
    protected static function getFoo6Service($container)
    {
        $container->services['foo6'] = $instance = new \stdClass();

        $instance->bar6 = ($container->privates['bar6'] ?? self::getBar6Service($container));

        return $instance;
    }

    /**
     * Gets the public 'foobar4' shared service.
     *
     * @return \stdClass
     */
    protected static function getFoobar4Service($container)
    {
        $a = new \stdClass();

        $container->services['foobar4'] = $instance = new \stdClass($a);

        $a->foobar = $instance;

        return $instance;
    }

    /**
     * Gets the public 'listener3' shared service.
     *
     * @return \stdClass
     */
    protected static function getListener3Service($container)
    {
        $container->services['listener3'] = $instance = new \stdClass();

        $instance->manager = ($container->services['manager3'] ?? self::getManager3Service($container));

        return $instance;
    }

    /**
     * Gets the public 'listener4' shared service.
     *
     * @return \stdClass
     */
    protected static function getListener4Service($container)
    {
        $a = ($container->privates['manager4'] ?? self::getManager4Service($container));

        if (isset($container->services['listener4'])) {
            return $container->services['listener4'];
        }

        return $container->services['listener4'] = new \stdClass($a);
    }

    /**
     * Gets the public 'logger' shared service.
     *
     * @return \stdClass
     */
    protected static function getLoggerService($container)
    {
        $a = ($container->services['connection'] ?? self::getConnectionService($container));

        if (isset($container->services['logger'])) {
            return $container->services['logger'];
        }

        $container->services['logger'] = $instance = new \stdClass($a);

        $instance->handler = new \stdClass(($container->services['manager'] ?? self::getManagerService($container)));

        return $instance;
    }

    /**
     * Gets the public 'manager' shared service.
     *
     * @return \stdClass
     */
    protected static function getManagerService($container)
    {
        $a = ($container->services['connection'] ?? self::getConnectionService($container));

        if (isset($container->services['manager'])) {
            return $container->services['manager'];
        }

        return $container->services['manager'] = new \stdClass($a);
    }

    /**
     * Gets the public 'manager2' shared service.
     *
     * @return \stdClass
     */
    protected static function getManager2Service($container)
    {
        $a = ($container->services['connection2'] ?? self::getConnection2Service($container));

        if (isset($container->services['manager2'])) {
            return $container->services['manager2'];
        }

        return $container->services['manager2'] = new \stdClass($a);
    }

    /**
     * Gets the public 'manager3' shared service.
     *
     * @return \stdClass
     */
    protected static function getManager3Service($container, $lazyLoad = true)
    {
        $a = ($container->services['listener3'] ?? self::getListener3Service($container));

        if (isset($container->services['manager3'])) {
            return $container->services['manager3'];
        }
        $b = new \stdClass();
        $b->listener = [$a];

        return $container->services['manager3'] = new \stdClass($b);
    }

    /**
     * Gets the public 'monolog.logger' shared service.
     *
     * @return \stdClass
     */
    protected static function getMonolog_LoggerService($container)
    {
        $container->services['monolog.logger'] = $instance = new \stdClass();

        $instance->handler = ($container->privates['mailer.transport'] ?? self::getMailer_TransportService($container));

        return $instance;
    }

    /**
     * Gets the public 'monolog_inline.logger' shared service.
     *
     * @return \stdClass
     */
    protected static function getMonologInline_LoggerService($container)
    {
        $container->services['monolog_inline.logger'] = $instance = new \stdClass();

        $instance->handler = ($container->privates['mailer_inline.mailer'] ?? self::getMailerInline_MailerService($container));

        return $instance;
    }

    /**
     * Gets the public 'pA' shared service.
     *
     * @return \stdClass
     */
    protected static function getPAService($container)
    {
        $a = ($container->privates['pC'] ?? self::getPCService($container));

        if (isset($container->services['pA'])) {
            return $container->services['pA'];
        }
        $b = new \stdClass();

        $container->services['pA'] = $instance = new \stdClass($b, $a);

        $b->d = ($container->privates['pD'] ?? self::getPDService($container));

        return $instance;
    }

    /**
     * Gets the public 'root' shared service.
     *
     * @return \stdClass
     */
    protected static function getRootService($container)
    {
        $a = new \Symfony\Component\DependencyInjection\Tests\Fixtures\FooForCircularWithAddCalls();

        $b = new \stdClass();

        $a->call(new \stdClass(new \stdClass($b, ($container->privates['level5'] ?? self::getLevel5Service($container)))));

        return $container->services['root'] = new \stdClass($a, $b);
    }

    /**
     * Gets the public 'subscriber' shared service.
     *
     * @return \stdClass
     */
    protected static function getSubscriberService($container)
    {
        $a = ($container->services['manager'] ?? self::getManagerService($container));

        if (isset($container->services['subscriber'])) {
            return $container->services['subscriber'];
        }

        return $container->services['subscriber'] = new \stdClass($a);
    }

    /**
     * Gets the private 'bar6' shared service.
     *
     * @return \stdClass
     */
    protected static function getBar6Service($container)
    {
        $a = ($container->services['foo6'] ?? self::getFoo6Service($container));

        if (isset($container->privates['bar6'])) {
            return $container->privates['bar6'];
        }

        return $container->privates['bar6'] = new \stdClass($a);
    }

    /**
     * Gets the private 'doctrine.listener' shared service.
     *
     * @return \stdClass
     */
    protected static function getDoctrine_ListenerService($container)
    {
        $a = ($container->services['doctrine.entity_manager'] ?? self::getDoctrine_EntityManagerService($container));

        if (isset($container->privates['doctrine.listener'])) {
            return $container->privates['doctrine.listener'];
        }

        return $container->privates['doctrine.listener'] = new \stdClass($a);
    }

    /**
     * Gets the private 'level5' shared service.
     *
     * @return \stdClass
     */
    protected static function getLevel5Service($container)
    {
        $a = new \Symfony\Component\DependencyInjection\Tests\Fixtures\FooForCircularWithAddCalls();

        $container->privates['level5'] = $instance = new \stdClass($a);

        $a->call($instance);

        return $instance;
    }

    /**
     * Gets the private 'mailer.transport' shared service.
     *
     * @return \stdClass
     */
    protected static function getMailer_TransportService($container)
    {
        $containerRef = $container->ref;

        return $container->privates['mailer.transport'] = (new \FactoryCircular(new RewindableGenerator(function () use ($containerRef) {
            $container = $containerRef->get();

            yield 0 => ($container->privates['mailer.transport_factory.amazon'] ?? self::getMailer_TransportFactory_AmazonService($container));
            yield 1 => self::getMailerInline_TransportFactory_AmazonService($container);
        }, 2)))->create();
    }

    /**
     * Gets the private 'mailer.transport_factory.amazon' shared service.
     *
     * @return \stdClass
     */
    protected static function getMailer_TransportFactory_AmazonService($container)
    {
        $a = new \stdClass();

        $container->privates['mailer.transport_factory.amazon'] = $instance = new \stdClass($a);

        $a->handler = ($container->privates['mailer.transport'] ?? self::getMailer_TransportService($container));

        return $instance;
    }

    /**
     * Gets the private 'mailer_inline.mailer' shared service.
     *
     * @return \stdClass
     */
    protected static function getMailerInline_MailerService($container)
    {
        return $container->privates['mailer_inline.mailer'] = new \stdClass((new \FactoryCircular(new RewindableGenerator(fn () => new \EmptyIterator(), 0)))->create());
    }

    /**
     * Gets the private 'mailer_inline.transport_factory.amazon' shared service.
     *
     * @return \stdClass
     */
    protected static function getMailerInline_TransportFactory_AmazonService($container)
    {
        $a = new \stdClass();
        $a->handler = ($container->privates['mailer_inline.mailer'] ?? self::getMailerInline_MailerService($container));

        return new \stdClass($a);
    }

    /**
     * Gets the private 'manager4' shared service.
     *
     * @return \stdClass
     */
    protected static function getManager4Service($container, $lazyLoad = true)
    {
        $a = new \stdClass();

        $container->privates['manager4'] = $instance = new \stdClass($a);

        $a->listener = [($container->services['listener4'] ?? self::getListener4Service($container))];

        return $instance;
    }

    /**
     * Gets the private 'pC' shared service.
     *
     * @return \stdClass
     */
    protected static function getPCService($container, $lazyLoad = true)
    {
        $container->privates['pC'] = $instance = new \stdClass();

        $instance->d = ($container->privates['pD'] ?? self::getPDService($container));

        return $instance;
    }

    /**
     * Gets the private 'pD' shared service.
     *
     * @return \stdClass
     */
    protected static function getPDService($container)
    {
        $a = ($container->services['pA'] ?? self::getPAService($container));

        if (isset($container->privates['pD'])) {
            return $container->privates['pD'];
        }

        return $container->privates['pD'] = new \stdClass($a);
    }
}
