Registers a browser configuration.

@param BrowserConfiguration $browser Browser configuration.

@return void
@throws \InvalidArgumentException When browser configuration is already registered.
487039
public function register(BrowserConfiguration $browser)
	{
		$type = $browser->getType();

		if ( isset($this->browserConfigurations[$type]) ) {
			throw new \InvalidArgumentException(
				'Browser configuration with type "' . $type . '" is already registered'
			);
		}

		$this->browserConfigurations[$type] = $browser;
	}
556223
public static function register(Configurator $configurator)
	{
		$configurator->onCompile[] = function($configurator, $compiler) {
			$compiler->addExtension('rest', new RestExtension());
		};
	}
526593
public function registerIdentity()
    {
        if ($this->module->userComponent !== true && !is_string($this->module->userComponent) && !is_array($this->module->userComponent)) {
            throw new InvalidConfigException('Invalid value for the userComponent parameter.');
        }
        if (is_string($this->module->userComponent)) {
            return;
        }
        $this->module->set('podium_user', is_array($this->module->userComponent)
                ? $this->module->userComponent
                : [
                    'class' => 'bizley\podium\web\User',
                    'identityClass' => 'bizley\podium\models\User',
                    'enableAutoLogin' => true,
                    'loginUrl' => $this->module->loginUrl,
                    'identityCookie' => [
                        'name' => 'podium',
                        'httpOnly' => true,
                        'secure' => $this->module->secureIdentityCookie,
                    ],
                    'idParam' => '__id_podium',
                ]);
    }
144540
public function register()
    {

        /**
         * Merge configurations
         * Config::get('accio.test')
         */
        $this->mergeConfigFrom(
            __DIR__.'/config/app.php', 'accio'
        );

        /**
         * Register aliases
         */
        $aliasLoader = AliasLoader::getInstance();
        foreach ($this->aliases as $name=>$namespace){
            $aliasLoader->alias($name, $namespace);
        }

        /**
         * Bind classes
         */
        foreach ($this->bindings as $name=>$namespace){
            $this->app->bind(
                $name, function ($namespace) {
                    return $this->app->make($namespace);
                }
            );
        }

        Event::fire('system:register', [$this]);
    }
21974
public function registerContainerConfiguration(\Symfony\Component\Config\Loader\LoaderInterface $loader)
    {
        $loader->load(__DIR__.self::CONFIG_PATH.self::SERVICES_FILE);
    }
885768
protected function registerConfig(Configurator $configurator)
	{
		$configurator->addConfig($this->params->getParam("moduleDir") . $this->getModuleName() . DIRECTORY_SEPARATOR . "config" . DIRECTORY_SEPARATOR . "config.neon");
	}
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());
    }
1171112
public function register(ContainerInterface $container, Configurable $config)
    {
        if ( ! $config instanceof Config) {
            throw new \InvalidArgumentException('Wrong Config object');
        }

        $entityManager = EntityManager::create(
            $config->database,
            Setup::createAnnotationMetadataConfiguration(
                $config->annotationDirs, $config->dev, $config->proxyDir, $config->cache, false
            )
        );

        $container->add($config->getServiceName(), $entityManager);
    }
199061
public function register()
    {
        $this->container['session'] = function ($container) {
            $handler = null;
            if ($config = $container['config']->get('session.saveHandler')) {
                if (!$class = $config->handler) {
                    throw new InvalidArgumentException(
                        'Invalid "handler" parameter in the session save handler'
                    );
                }

                if (!is_subclass_of($class, SessionHandlerInterface::class)) {
                    throw new InvalidArgumentException(
                        $class . ' must implement of ' . SessionHandlerInterface::class
                    );
                }

                $handler = new $class($config->options ? $config->options->toArray() : null);
            }

            $session = new Session($handler);
            $session->start();

            return $session;
        };
    }
150873
public function session(BrowserConfiguration $browser)
	{
		if ( $this->_lastTestFailed ) {
			$this->stopSession();
			$this->_lastTestFailed = false;
		}

		if ( $this->_session === null ) {
			$this->_session = $this->_originalStrategy->session($browser);
		}
		else {
			$this->_switchToMainWindow();
		}

		return $this->_session;
	}
769435
public function validateProviders(array $providers) : void
    {
        Assert::allClassExists($providers);
        Assert::allImplementsInterface($providers, self::PROVIDER_INTERFACE);

        foreach ($this->requiredProviders as $name) {
            if (!in_array($name, array_keys($providers))) {
                throw new InvalidArgumentException("Configuration is missing a required provider for [$name]");
            }
        }
    }
225067
final public function autoconfigure(bool $autoconfigured = true)
    {
        if ($autoconfigured && $this->definition instanceof ChildDefinition) {
            throw new InvalidArgumentException(sprintf('The service "%s" cannot have a "parent" and also have "autoconfigure". Try disabling autoconfiguration for the service.', $this->id));
        }
        $this->definition->setAutoconfigured($autoconfigured);

        return $this;
    }
762323
public function register(): void
    {
        $configPath = $this->basePath.'config/config.php';
        if (file_exists($configPath)) {
            $this->mergeConfigFrom($configPath, $this->name);
        }

        $this->commands([ModuleMakeCommand::class]);

        if ($this->app['config']->get('foundation.auto_mount', false)) {
            $this->app->register(MountServiceProvider::class);
        }
    }
1275423
public static function initialize(Configuration $configuration)
    {
        $configuration = static::normalizeConfiguration($configuration);
        
        if (!$configuration->validateIdentity()) {
            throw new InvalidArgumentException('Bad configuration identity');
        }
        
        if (!$configuration->validateConnection()) {
            throw new InvalidArgumentException('Bad connection settings. Check your configuration file ":file"', [
                'file' => $configuration->getIdentity(),
            ]);
        }
        
        static::loadAdditionalConfiguration($configuration);
        
        static::getServiceContainer()->set('configuration', $configuration);
        static::getServiceContainer()->set('classLoader', self::initializeClassLoader());
        
        static::getServiceContainer()->getDispatcher()
            ->addListener(null, [static::getServiceContainer()->getLogger(), 'event']);
    }
74644
public function register()
    {
        $this->app->singleton('forrest', function ($app) {

            // Config options
            $settings           = config('forrest');
            $storageType        = config('forrest.storage.type');
            $authenticationType = config('forrest.authentication');

            // Dependencies
            $httpClient    = $this->getClient();
            $input     = new LaravelInput(app('request'));
            $event     = new LaravelEvent(app('events'));
            $encryptor = new LaravelEncryptor(app('encrypter'));
            $redirect  = $this->getRedirect();
            $storage   = $this->getStorage($storageType);

            $refreshTokenRepo = new RefreshTokenRepository($encryptor, $storage);
            $tokenRepo        = new TokenRepository($encryptor, $storage);
            $resourceRepo     = new ResourceRepository($storage);
            $versionRepo      = new VersionRepository($storage);
            $instanceURLRepo  = new InstanceURLRepository($tokenRepo, $settings);
            $stateRepo        = new StateRepository($storage);

            $formatter = new JSONFormatter($tokenRepo, $settings);

            switch ($authenticationType) {
                case 'WebServer':
                    $forrest = new WebServer(
                        $httpClient,
                        $encryptor,
                        $event,
                        $input,
                        $redirect,
                        $instanceURLRepo,
                        $refreshTokenRepo,
                        $resourceRepo,
                        $stateRepo,
                        $tokenRepo,
                        $versionRepo,
                        $formatter,
                        $settings);
                    break;
                case 'UserPassword':
                    $forrest = new UserPassword(
                        $httpClient,
                        $encryptor,
                        $event,
                        $input,
                        $redirect,
                        $instanceURLRepo,
                        $refreshTokenRepo,
                        $resourceRepo,
                        $stateRepo,
                        $tokenRepo,
                        $versionRepo,
                        $formatter,
                        $settings);
                    break;
                default:
                    $forrest = new WebServer(
                        $httpClient,
                        $encryptor,
                        $event,
                        $input,
                        $redirect,
                        $instanceURLRepo,
                        $refreshTokenRepo,
                        $resourceRepo,
                        $stateRepo,
                        $tokenRepo,
                        $versionRepo,
                        $formatter,
                        $settings);
                    break;
            }

            return $forrest;
        });
    }
754836
public function registerParser($pluginName, $parser, $regexp = null, $limit = PHP_INT_MAX)
	{
		if (!is_callable($parser))
		{
			throw new InvalidArgumentException('Argument 1 passed to ' . __METHOD__ . ' must be a valid callback');
		}
		// Create an empty config for this plugin to ensure it is executed
		if (!isset($this->pluginsConfig[$pluginName]))
		{
			$this->pluginsConfig[$pluginName] = [];
		}
		if (isset($regexp))
		{
			$this->pluginsConfig[$pluginName]['regexp']      = $regexp;
			$this->pluginsConfig[$pluginName]['regexpLimit'] = $limit;
		}
		$this->pluginParsers[$pluginName] = $parser;
	}
896241
protected function registerServiceProvider($serviceProvider) {
        $serviceProvider = $this->ensureProviderIsObject($serviceProvider);

        if (!($serviceProvider instanceof Contracts\ServiceProvider)) {
            throw new InvalidConfigException('Service provider should be an instance of ' . ServiceProvider::class);
        } elseif ($serviceProvider instanceof Contracts\DelayedServiceProvider) {
            $this->addDelayedServiceProvider($serviceProvider);
        } else {
            $serviceProvider->register();
        }
    }