Use the register method to register items with the container via the
protected $this->container property or the `getContainer` method
from the ContainerAwareTrait.

@return void
542045
public function register()
    {

        $this->getContainer()->add(Connection::class, function () {
            /** @var Configuration $configuration */
            $configuration = $this->getContainer()->get(Configuration::class);
            return DriverManager::getConnection($configuration->get('plugins.database', []), new \Doctrine\DBAL\Configuration());
        });

        $this->getContainer()->add(EntityManagerInterface::class, function () {
            /** @var Configuration $configuration */
            $configuration = $this->getContainer()->get(Configuration::class);

            return EntityManager::create(
                $configuration->get('plugins.database', []),
                Setup::createAnnotationMetadataConfiguration(
                    [
                        realpath(__DIR__ . DIRECTORY_SEPARATOR . 'Entities')
                    ],
                    $configuration->get('debug', false)
                )
            );
        });
    }
159767
public function register()
    {
        $this->add_config_location(\realpath(__DIR__ . '/../config'));

        $this->add_blade();

        Container::add(
            Blade_Strategy::class,
            function (\Snap\Core\Container $container) {
                return $container->resolve(Blade_Strategy::class);
            }
        );

        Container::remove(Standard_Strategy::class);
        Container::remove(Partial::class);

        // Bind blade strategy as the current Templating engine.
        Container::bind(Blade_Strategy::class, Templating_Interface::class);

        $this->publishes_config(\realpath(__DIR__ . '/../config'));

        $this->publishes_directory(
            \realpath(__DIR__ . '/../templates'),
            Config::get('theme.templates_directory')
        );
    }
257296
public function initialize()
    {
        Facade::setContainer($this->container);

        if (null !== $loader = $this->loader) {
            $loader->register();
        }
    }
57978
protected function initialize()
    {
        $this->container = new Container();

        $containerProvider = new ContainerProvider($this->disabledMethods, $this->disabledFormats);
        $this->container->register($containerProvider);

        $this->initialized = false;
    }
769865
public function register(Container $container)
    {
        $container->share(\Swift_Mailer::class, [$this, 'swiftmailer'])
            ->alias('swiftmailer', \Swift_Mailer::class);

        $container->bindShared(MailerAdapterInterface::class, SwiftMailerAdapter::class)
            ->alias('mailer.adapter.swiftmailer', SwiftMailerAdapter::class);
    }
838352
public function register(Container $app): void
    {
        /** @var Collection $writerCollection */
        $writerCollection = $app['transformer.writer.collection'];
        $twigWriter = new Writer\Twig($app[\Twig\Environment::class]);

        $writerCollection['twig'] = $twigWriter;
    }
1068982
private function registerProviders()
    {
        $providers = $this->config('app')['providers'];
        foreach ($providers as $provider) {
            $obj = new $provider($this);

            if (!$obj instanceof Provider) {
                throw new \Exception("Invalid provider: $provider");
            }

            $this->container->invoke($obj, 'register');
        }
    }
628591
public function register() {
		$this->files = new Filesystem;
		$this->registerScanCommand();

		$method = "singleton";
		// Bind the manager as a singleton on the container.
		$this->app->$method('permacon', function($app) {
			
			/**
			 * Construct the actual manager.
			 */
			return new Permacon($app);
		});
	}
1019313
public function register()
    {
        Zilf::$container->register(
            Dispatcher::class, function () {
                return new Dispatcher(
                    function ($connection = null) {
                        return Zilf::$container['queue']->connection($connection);
                    }
                );
            }
        );
    }
548612
public static function register()
	{
		Container::extensionMethod('addDate', function ($container, $name, $label = NULL) {
			$picker = $container[$name] = new DatePicker($label);
			return $picker;
		});
	}
1290693
private function registerProviders(): void
    {
        $this->providers = array_merge($this->providers, $this->getConfigProviders());

        foreach ($this->providers as $provider) {
            $provider = $this->container->get($provider);
            $provider->boot();
        }
    }
1294041
public function register()
    {
        foreach ($this->templates as $post_type => $templates) {
            if (empty($templates)) {
                continue;
            }

            $this->filter->add("theme_{$post_type}_templates", function ($registered) use ($templates) {
                return array_merge($registered, $templates);
            });
        }
    }
1073975
public function register(Container $container)
    {
        $container['extensions.sections'] = function ($c) {
            return new Sections($c['section.factory'], $c['events']);
        };

        $container['extensions.helpers'] = function ($c) {
            return new Helpers($c['escaper'], $c['options']);
        };

        $container['extensions.walker'] = function ($c) {
            return new Walker($c['command'], $c['escaper'], $c['options']);
        };

        $container['extensions.filters'] = function () {
            return new Filters();
        };

        $container['extensions.aura_html'] = function ($c) {
            return new AuraHtmlExtension(
                $c['aura.html.locator'],
                $c['options']['html_tags_functions']
            );
        };
    }
1324708
public function register()
    {
        $params = Zilf::$container->getShare('config')->get('databases');
        foreach ($params as $key => $row) {
            Zilf::$container->register(
                'db.' . $key, function () use ($row) {
                    $connect = new Connection($row);
                    $connect->open();
                    return $connect;
                }
            );
        }
    }
860068
public function register ()
    {
        $callback = array($this, 'display');
        foreach ($this->screens as $screen) {
            $id       = $this->getPropertyForScreen($screen, $this->id);
            $title    = $this->getPropertyForScreen($screen, $this->title);
            $context  = $this->getPropertyForScreen($screen, $this->context);
            $priority = $this->getPropertyForScreen($screen, $this->priority);
            add_meta_box($id, $title, $callback, $screen, $context, $priority);
        }
    }
742840
protected function registerSecurity()
    {
        $this->app->singleton('security', function (Container $app) {
            $evil = $app->config->get('security.evil');

            return new Security($evil);
        });

        $this->app->alias('security', Security::class);
    }
484427
public function register(Container $container)
    {
        $closure = function (Container $container) {
            $manager = $container->newInstance(LoggerManager::class, [
                'logPath' => $container->get('config')->get('path.logs')
            ]);

            return $manager;
        };

        $container->share(LoggerManager::class, $closure);
    }