Return the event container containing the uncommitted changes.
If there are no pending changes to be committed, a new event container
will be initialized.

@return EventContainer
196639
final private function changes()
    {
        if (null === $this->changes) {
            $lastCommittedEventSequenceNumber = $this->lastCommittedEventSequenceNumber();

            $this->changes = new DefaultEventContainer($this->identifier(), $lastCommittedEventSequenceNumber);
        }

        return $this->changes;
    }
727654
public function createContainer()
  {
    # Create the container
    $container = new Container;

    # If we have auto-wire option on ...
    if (($this->options['autowire'] ?? false)) {
      # Add reflection delegate, so auto-wiring is possible
      $container->delegate( new ReflectionContainer );
    }

    \logger()->debug('Created PSR-11 Container (The Leauge Container)');

    return $container;
  }
11880
public function getEventPriorityMap()
    {
        if (null !== $this->eventPriorityMap) {
            return $this->eventPriorityMap;
        }

        return $this->eventPriorityMap = $this->buildEventPriorityMap();
    }
607286
public function getContainerBuilder() {
    if (!isset($this->containerBuilder)) {
      // Get the kernel, and hack it to get a compiled container.
      // We need this rather than the normal cached container, as that doesn't
      // allow us to get the full service definitions.
      $kernel = \Drupal::service('kernel');
      $kernel_R = new \ReflectionClass($kernel);

      $compileContainer_R = $kernel_R->getMethod('compileContainer');
      $compileContainer_R->setAccessible(TRUE);

      $this->containerBuilder = $compileContainer_R->invoke($kernel);
    }

    return $this->containerBuilder;
  }
164836
public function getOriginalContainer() {
		$container = $this;
		while ($container instanceof Comment) {
			$container = $container->getContainerEntity();
		}
		return ($container instanceof Comment) ? $this->getOwnerEntity() : $container;
	}
83705
protected function initialiseContainer()
    {
        // @todo: add some form of container caching?
        $container = $this->buildContainer();
        $this->prepareContainer($container);

        $this->container = $container;
        return $this->container;
    }
1027935
protected function iocContainer()
    {
        if (
            property_exists($this, 'container')
            && isset($this->container)
            && $this->container instanceof ContainerInterface
        ) {
            return $this->container;
        }

        /*
         * Technically your code can work without ever being using fallback container, all
         * spiral components can do that and only few traits will require few extra parameters.
         *
         * I'm planning one day (update: DONE) to run spiral as worker and later in async mode (few app
         * processes in memory), memory schemas might help a lot by minimizing runtime code by using
         * pre-calculated behaviours.
         */

        return self::$staticContainer;
    }
886497
public function getContainer(): Container
    {
        if ($this->containerInstance === null) {
            $this->containerInstance = $this->getCollector()->getContracts();
        }

        return $this->containerInstance;
    }
256636
public function getContainer() {
		if(!$this->container) {
			$this->container = $this->buildContainer();
			$this->container['kernel'] = $this;
		}
		return $this->container;
	}
293368
protected function updateScriptEvents()
    {
        if (!$this->control || !ScriptLabel::isEventLabel($this->labelName)) {
            return $this;
        }
        if ($this->control instanceof Scriptable) {
            $this->control->setScriptEvents(true);
        }
        return $this;
    }
579879
public static function getContainerInstance() : Container
    {
        if (self::$container === null) {
            self::$container = self::getUnboundContainerInstance();
        }

        return self::$container;
    }
406944
protected function getContainerBuilder()
    {
        if ($this->containerBuilder) {
            return $this->containerBuilder;
        }

        $kernel = $this->getApplication()->getKernel();

        if (!$kernel->isDebug() || !(new ConfigCache($kernel->getContainer()->getParameter('debug.container.dump'), true))->isFresh()) {
            $buildContainer = \Closure::bind(function () { return $this->buildContainer(); }, $kernel, \get_class($kernel));
            $container = $buildContainer();
        } else {
            (new XmlFileLoader($container = new ContainerBuilder(), new FileLocator()))->load($kernel->getContainer()->getParameter('debug.container.dump'));
            $container->setParameter('container.build_hash', $hash = ContainerBuilder::hash(__METHOD__));
            $container->setParameter('container.build_id', hash('crc32', $hash.time()));
        }

        $container->getCompilerPassConfig()->setRemovingPasses([]);
        $container->compile();

        return $this->containerBuilder = $container;
    }
1345770
public function getEventManager()
    {
        if (!$this->events) {
            $events = new EventManager();
            $this->setEventManager($events);
        }

        return $this->events;
    }
724902
protected function setEventsManager()
    {
        $ev = new EventsManager();
        $ev->enablePriorities(true);
        $ev->collectResponses(true);
        $this->set('eventsManager', $ev, true);
        return $this;
    }
474935
public function getPersistenceEventQueue()
    {
        if (null === $this->persistenceEventQueue) {
            $this->persistenceEventQueue = new Persistence\PersistenceEventQueue(
                $this->getConfigurationRegistry(),
                $this->getEventDispatcher()
            );
        }

        return $this->persistenceEventQueue;
    }
1293334
public function getCurrentContainerLabel()
    {
        if ($this->getContainerCode() !== null) {
            $container = $this->containersSource->get($this->getContainerCode());

            if ($this->getContainerLabel($container)) {
                return $this->getContainerLabel($container);
            }
        }
    }
372530
public function getContainer()
    {
        if (is_null($this->_container)) {
            $def = [
                "db_{$this->configName}" => Definition::factory(
                        function() {
                            $args = Configuration::get($this->_configFile)
                                ->get($this->_configName);
                            $adapter = new Adapter($args);
                            return $adapter->initialize();
                        }
                    ),
                'sharedEventManager' => Definition::object(
                        'Zend\EventManager\SharedEventManager'
                    )
            ];
            $this->setContainer(ContainerBuilder::buildContainer($def));
        }
        return $this->_container;
    }