Provider-specific registration logic.

@param  Container $container Plugin container instance.

@return void
323074
public function register( Container $container ) {
		$container['check_site_job'] = function( Container $c ) {
			return new Check_Site_Job( $c['checker'], $c['options_manager'] );
		};

		$container['checker'] = function( Container $c ) {
			$checker = new Checker( new Api_Client( $c['http'] ), new WP_Package_Manager() );

			$checker->add_post_check_callback( function( $vulnerabilities, $response ) {
				do_action( 'soter_package_check_complete', $vulnerabilities, $response );
			} );

			return $checker;
		};

		$container['http'] = function( Container $c ) {
			return new Cached_Http_Client(
				new WP_Http_Client( $c['user_agent'] ),
				new WP_Transient_Cache( $c['prefix'], HOUR_IN_SECONDS )
			);
		};

		$container['notifier_manager'] = function( Container $c ) {
			$options = $c['options_manager'];

			return new Notifier_Manager( $options, [
				new Email_Notifier( $c['plates'], $options ),
				new Slack_Notifier( $options, $c['user_agent'] ),
			] );
		};

		$container['options_manager'] = function( Container $c ) {
			return new Options_Manager( new Options_Store( $c['prefix'] ) );
		};

		$container['options_page'] = function( Container $c ) {
			return new Options_Page( $c['options_manager'], $c['plates'] );
		};

		$container['plates'] = function( Container $c ) {
			$engine = new Engine( $c['dir'] . '/templates' );

			// Drop the file extension so we can also load .css files.
			$engine->setFileExtension( null );
			$engine->loadExtension( new Button_Extension() );
			$engine->addData(
				[
					'plugin_url' => $c['url'],
					'site_name' => get_bloginfo( 'name' ),
					'site_url' => site_url(),
				],
				[
					'emails/html/error.php',
					'emails/html/vulnerable.php',
					'emails/partials/footer.php',
					'emails/partials/header.php',
					'emails/text/error.php',
					'emails/text/vulnerable.php',
				]
			);

			return $engine;
		};

		$container['user_agent'] = function( Container $c ) {
			return sprintf(
				'%s (%s) | %s | v%s | %s',
				get_bloginfo( 'name' ),
				get_home_url(),
				$c['name'],
				$c['version'],
				$c['url']
			);
		};
	}
806052
public function register(Container $container)
    {
        $container->prepareSharedObject(
            EventDispatcher::class,
            function (EventDispatcher $dispatcher, Container $container) {
                $dispatcher->foo = 'bar';

                return $dispatcher->setDebug($container->get('config')->get('system.debug'));
            }
        )->bindShared(Dispatcher::class, EventDispatcher::class)
            ->bindShared(DispatcherInterface::class, EventDispatcher::class);
    }
431093
public function process(ContainerBuilder $container)
    {
        if (!$container->hasDefinition(static::TASK_REGISTRY)) {
            return;
        }

        $registry = $container->getDefinition(static::TASK_REGISTRY);

        foreach ($container->findTaggedServiceIds(static::TASK_TAG) as $id => $tag) {
            $registry->addMethodCall("addTask", [new Reference($id)]);
        }
    }
885116
public function register( Container $container ) {
		$this->container = $container;

		$container->define(
			array( 'assets' => 'Intraxia\Jaxion\Contract\Assets\Register' ),
			$register = new Register( $container->fetch( 'url' ), $container->fetch( 'version' ) )
		);

		$this->add_assets( $register );
	}
675450
public function register(Container $container)
    {
        $config = $container->get('config');

        if ($config->get('system.debug')) {
            $whoops = new Whoops();

            $handler = new PrettyPageHandler();
            $handler->setEditor($config->get('whoops.editor', 'phpstorm'));

            $whoops->pushHandler($handler);

            $container->share(Whoops::class, $whoops)
                ->alias('whoops', Whoops::class);

            $container->share(PrettyPageHandler::class, $handler)
                ->alias('whoops.handler', PrettyPageHandler::class);
        }
    }
448417
public function register(ContainerInterface $container, Configurable $config)
    {
        if ( ! $config instanceof Config) {
            throw new \InvalidArgumentException('Wrong Config object');
        }
        
        $validator = Validation::createValidatorBuilder();

        if ($config->annotationMapping) {
            $validator->enableAnnotationMapping();
        }

        $container->add($config->getServiceName(), $validator->getValidator());
    }
839956
public function register(Container $container)
    {
        $app = $container->get('application');

        $container->share(get_class($app), $app)
            ->bindShared(CoreConsole::class, get_class($app))
            ->bindShared(WindwalkerApplicationInterface::class, CoreConsole::class);

        // Input
        $container->share(IOInterface::class, $app->io)
            ->alias('io', IOInterface::class);

        // Environment
        $container->prepareSharedObject(Environment::class)
            ->alias('environment', Environment::class);

        $container->prepareSharedObject(Platform::class)
            ->alias('platform', Platform::class);
    }
565239
public function register(Container $container)
    {
        $container->share(get_class($this->package), $this->package)
            ->bindShared(AbstractPackage::class, get_class($this->package));

        $container->share('controller.resolver', function (Container $container) {
            return new ControllerResolver($this->package, $container);
        });

        $container->share('repository.resolver', function (Container $container) {
            return new RepositoryResolver($this->package, $container);
        })->alias('model.resolver', 'repository.resolver');

        $container->share('view.resolver', function (Container $container) {
            return new ViewResolver($this->package, $container);
        });

        $container->share('mvc.resolver', function (Container $container) {
            return new MvcResolver(
                $container->get('controller.resolver'),
                $container->get('repository.resolver'),
                $container->get('view.resolver')
            );
        });

        if ($this->package->app->isWeb()) {
            // Router
            $container->prepareSharedObject(PackageRouter::class)->alias('router', PackageRouter::class);
        }
    }
521863
public function build(ContainerBuilder $container)
    {
        parent::build($container);

        /**
         * Adds compiler pass.
         */
        $container
            ->addCompilerPass(new MappingCompilerPass())
            ->addCompilerPass(new ContextCompilerPass())
            ->addCompilerPass(new ExpressionLanguageCompilerPass());
    }
857663
public function build(ContainerBuilder $container)
    {
        $this->initAdmingeneratorClassLoader($container);

        parent::build($container);

        $container->addCompilerPass(new ValidatorCompilerPass());
        $container->addCompilerPass(new FormCompilerPass());
    }
415323
public function register(Container $container)
    {
        $container->prepareSharedObject(DatabaseService::class);

        $closure = function (Container $container) {
            $service = $container->get(DatabaseService::class);

            return $service->createConnection();
        };

        class_alias(AbstractDatabaseDriver::class, DatabaseAdapter::class);
        $container->share(AbstractDatabaseDriver::class, $closure)
            ->alias(DatabaseAdapter::class, AbstractDatabaseDriver::class);

        DatabaseContainer::setDb(function () use ($container) {
            return $container->get(AbstractDatabaseDriver::class);
        });

        // For Exporter
        $closure = function (Container $container) {
            $service = $container->get(DatabaseService::class);

            return $service->getExporter();
        };

        $container->share(AbstractExporter::class, $closure);
    }
127004
public function register(Container $container)
    {
        /** @var Config $configuration */
        $configuration = $container['config'];

        /** @var LoggerInterface $logger */
        $logger = $container['logger'];

        /** @var Client $http */
        $http = $container['http'];

        return new TierConfiguration($configuration, $logger, $http, $container);
    }
511257
public function process(ContainerBuilder $container): void
    {
        if (true === self::enabled($container))
        {
            $excludedFiles = canonicalizeFilesPath(self::getExcludedFiles($container));

            $files = searchFiles(self::getDirectories($container), '/\.php/i');

            $this->registerClasses($container, $files, $excludedFiles);
        }
    }
71584
public function boot(Container $container)
    {
        $config = $container->get('config');

        if (!$config->get('system.debug')) {
            return;
        }

        $error = $container->get('error.handler');

        /**
         * @param \Exception|\Throwable $e
         *
         * @return  void
         */
        $handler = function ($e) use ($container) {
            /** @var Whoops $whoops */
            $whoops = $container->get('whoops');
            $whoops->allowQuit(false);
            $whoops->handleException($e);
        };

        $error->addHandler($handler, 'default');
    }
167123
protected function registerFormats(Container $container)
    {
        foreach ($this->formats as $formatClass) {
            $container['format.'.$formatClass::getName()] = $container->factory(function() use ($formatClass) {
                return new $formatClass();
            });
        }
    }
1206524
protected function setDependencies(Container $container)
    {
        parent::setDependencies($container);

        $this->setBaseUrl($container['base-url']);
        $this->setCollectionLoader($container['model/collection/loader']);
    }
360007
protected function setDependencies(Container $container)
    {
        parent::setDependencies($container);

        $this->basePath   = $container['config']['base_path'];
        $this->publicPath = $container['config']['public_path'];
    }