Register a broadcaster.

@param BroadcasterInterface $broadcaster
340861
public function add(BroadcasterInterface $broadcaster)
    {
        if ($this->has($broadcaster->getName())) {
            throw new InvalidArgumentException(sprintf(
                'Broadcaster with name "%s" already registered.',
                $broadcaster->getName()
            ));
        }

        $this->broadcasters[$broadcaster->getName()] = $broadcaster;
    }
952273
public function subscribe(EventInterface $event) {
        $events = [];

        // Enable the event listener only for resources and methods specified
        foreach ($this->params['allowedMethods'] as $resource => $methods) {
            foreach ($methods as $method) {
                $eventName = $resource . '.' . strtolower($method);
                $events[$eventName] = ['invoke' => 1000];
            }

            // Always enable the listener for the OPTIONS method
            $eventName = $resource . '.options';
            $events[$eventName] = ['options' => 20];
        }

        $manager = $event->getManager();
        $manager->addCallbacks($event->getHandler(), $events);

        // Add OPTIONS to the Allow header
        $event->getResponse()->headers->set('Allow', 'OPTIONS', false);
    }
733694
protected function registerClientInterface()
	{
		$this->app->bind('Mgallegos\DecimaAccounting\Accounting\Repositories\Client\ClientInterface', function($app)
		{
			$AuthenticationManager = $app->make('App\Kwaai\Security\Services\AuthenticationManagement\AuthenticationManagementInterface');

			return new \Mgallegos\DecimaAccounting\Accounting\Repositories\Client\EloquentClient(new Client(), $AuthenticationManager->getCurrentUserOrganizationConnection());
		});
	}
488161
public function register($provider)
    {
        if (! $provider instanceof ServiceProvider) {
            $provider = new $provider($this);
        }

        if (array_key_exists($providerName = get_class($provider), $this->loadedProviders)) {
            return;
        }

        $this->loadedProviders[$providerName] = true;

        if (method_exists($provider, 'register')) {
            $provider->register();
        }

        if (method_exists($provider, 'boot')) {
            return $this->call([$provider, 'boot']);
        }
    }
46150
protected function registerEvents(ServiceProvider $provider)
    {
        if ( ! isset($this->event)) return;

        foreach ($provider->when() as $event) {
            $this->event->listen($event, function() use ($provider) {
                $this->registerProvider($provider, true);
            });
        }
    }
547300
public function register(MW_Observer_Publisher_Interface $publisher, $domain)
	{
		if( !empty( $this->_plugins ) )
		{
			foreach( $this->_plugins as $plugin ) {
				$plugin->register( $publisher );
			}

			return;
		}

		$search = $this->createSearch( true );

		$expr = array(
			$search->compare( '==', 'plugin.type.code', $domain ),
			$search->getConditions(),
		);

		$search->setConditions( $search->combine( '&&', $expr ) );
		$search->setSortations( array( $search->sort( '+', 'plugin.position' ) ) );

		$pluginItems = $this->searchItems( $search );

		$interface = 'MShop_Plugin_Provider_Interface';
		$context = $this->_getContext();

		foreach( $pluginItems as $pluginItem )
		{
			$domain = $pluginItem->getType();
			$providernames = explode( ',', $pluginItem->getProvider() );

			if( ( $providername = array_shift( $providernames ) ) === null )
			{
				$msg = sprintf( 'Provider in "%1$s" not available', $providernames );
				throw new MShop_Service_Exception( $msg );
			}

			if( ctype_alnum( $domain ) === false )
			{
				$msg = sprintf( 'Invalid characters in domain name "%1$s"', $domain );
				$context->getLogger()->log( $msg, MW_Logger_Abstract::WARN );
				continue;
			}

			if( ctype_alnum( $providername ) === false )
			{
				$msg = sprintf( 'Invalid characters in provider name "%1$s"', $providername );
				$context->getLogger()->log( $msg, MW_Logger_Abstract::WARN );
				continue;
			}


			$classname = 'MShop_Plugin_Provider_' . ucfirst( $domain ) . '_' . $providername;

			if( class_exists( $classname ) === false )
			{
				$msg = sprintf( 'Class "%1$s" not available', $classname );
				$context->getLogger()->log( $msg, MW_Logger_Abstract::WARN );
				continue;
			}

			$provider = new $classname( $context, $pluginItem );

			if( ( $provider instanceof $interface ) === false )
			{
				$msg = sprintf( 'Class "%1$s" does not implement interface "%2$s"', $classname, $interface );
				throw new MShop_Service_Exception( $msg );
			}


			$provider = $this->_addPluginDecorators( $pluginItem, $provider, $providernames );

			$config = $context->getConfig();
			$decorators = $config->get( 'mshop/plugin/provider/' . $pluginItem->getType() . '/decorators', array() );

			$provider = $this->_addPluginDecorators( $pluginItem, $provider, $decorators );


			$this->_plugins[$pluginItem->getId()] = $provider;
			$provider->register( $publisher );
		}
	}
625803
public function register(
        ServerRequestInterface $request, ResponseInterface $response
    ) {
        $this->request = $request;
        $this->response = $response;
        return $this;
    }
1158362
public function register()
    {
        $displayer = new BasicDisplayer;
        $handler = new Handler($displayer);
        $this->container->bind('error', $handler);
    }
377974
public function getBroadcast(): ?Broadcaster
    {
        if (!$this->hasBroadcast()) {
            $this->setBroadcast($this->getDefaultBroadcast());
        }
        return $this->broadcast;
    }
34288
public function registerServices(DiInterface $di)
    {
        // registering view
        $config = $di->get('config');
        $view = $di->get('view');
        $view->setViewsDir(__DIR__. '/views/');
        $view->setMainView('main');
        $view->setLayoutsDir($config->application->layoutsDir);
        $view->setPartialsDir($config->application->adminPartialDir );
        $view->setLayout('private');
    }
988052
public function registerService(string $className, string $serviceId): void
    {
        assert(
            Validate::implementsInterface($className, EventSubscriber::class),
            sprintf('Invalid subscriber class: %s', $className)
        );
        /** @var EventSubscriber $className The subscriber class name */
        foreach ($className::eventRegistration() as $eventType => $params) {
            $eventType = ClassName::underscore($eventType);
            if (is_string($params)) {
                $this->addHandlerService($eventType, $serviceId, $params);
            } elseif (is_string($params[0])) {
                $priority = isset($params[1]) ? (int) $params[1] : 0;
                $this->addHandlerService($eventType, $serviceId, $params[0], $priority);
            } else {
                foreach ($params as $handler) {
                    $priority = isset($handler[1]) ? (int) $handler[1] : 0;
                    $this->addHandlerService($eventType, $serviceId, $handler[0], $priority);
                }
            }
        }
    }
696301
public function handle(Broadcaster $broadcaster)
    {
        $name = method_exists($this->event, 'broadcastAs')
                ? $this->event->broadcastAs() : get_class($this->event);

        $broadcaster->broadcast(
            Arr::wrap($this->event->broadcastOn()), $name,
            $this->getPayloadFromEvent($this->event)
        );
    }
555610
public function registerProvider(ProviderInterface $provider)
    {
        $this->providers[$provider->getName()] = $provider;
        $this->sortProviders();

        return $this;
    }
163924
public function register()
    {
        $this->app->singleton('pubsub.factory', function ($app) {
            return new PubSubConnectionFactory($app);
        });

        $this->app->singleton('pubsub', function ($app) {
            return new PubSubManager($app, $app['pubsub.factory']);
        });

        $this->app->bind('pubsub.connection', PubSubAdapterInterface::class);

        $this->app->bind(PubSubAdapterInterface::class, function ($app) {
            $manager = $app['pubsub']; /* @var PubSubManager $manager */
            return $manager->connection();
        });

        $this->registerAdapterDependencies();
    }
1186789
public static function register()
    {
        if ( self::$hasBeenRegistered === true ) {
            return;
        }

        if ( stream_filter_register(self::getFilterName(), __CLASS__) === false ) {
            throw new RuntimeException('Failed to register stream filter: '.self::getFilterName());
        }

        self::$hasBeenRegistered = true;
    }
1107745
public function register($name, FormatInterface $format)
    {
        if (isset($this->formats[$name])) {
            throw new \InvalidArgumentException(sprintf(
                'Formatter with name "%s" is already registered',
                $name
            ));
        }

        $this->formats[$name] = $format;
    }
106556
public function register()
    {
        $this->app->when(GcmChannel::class)
            ->needs(Client::class)
            ->give(function () {
                $gcmConfig = config('broadcasting.connections.gcm');

                $client = new Client();
                $client->setApiKey($gcmConfig['key']);
                $client->getHttpClient()->setAdapter(new Curl());

                return $client;
            });
    }