Register events.

@param array|string $events
184222
public function listen($events)
    {
        $this->dispatcher->listen($events, function (DelayedEvent $event) {
            $this->dispatch($event);
        });
    }
1109442
public function addEvents(array $events)
    {
        foreach ($events as $event) {
            if ($event instanceof EventInterface) {
                $this->addEvent($event);
            }
        }
        return $this;
    }
1322172
public function registerEvents()
    {
        if (!empty($this->clientEvents)) {
            $js = [];
            foreach ($this->clientEvents as $event => $handle) {
                $js[] = "jQuery('#{$this->options['id']}').on('{$event}',{$handle});";
            }
            $this->getView()->registerJs(implode(PHP_EOL, $js));
        }
    }
64503
public function registerPortEvents(): void
    {
        foreach ((array)$this->options['events'] as $event => $method) {
            // ['onConnect'] --> 'Connect', 'onConnect
            if (\is_int($event)) {
                $event = substr($method, 2);
            }

            // e.g $server->on('Request', [$this, 'onRequest']);
            if (method_exists($this, $method)) {
                $this->port->on($event, [$this, $method]);
            }
        }
    }
918358
public function add_events( array $stops ): void {

		$this->events = array_merge( $this->events, $stops );

		/**
		 * @var int|string $key
		 * @var array      $data
		 */
		foreach ( $stops as $key => $data ) {

			if ( is_int( $key ) ) {
				/** @var array{0:string} $data */
				$this->add_event( ...$data );
				continue;
			}

			/** @var int $priority */
			foreach ( array_keys( $data ) as $priority ) {
				add_action( $key, [ $this, 'tick' ], $priority );
			}
		}
	}
753160
public static function registerHelpers( $classes ) {

		if( !is_array($classes) )
			$classes = [$classes];

		foreach( $classes as $class ) {

			$class   = new \ReflectionClass($class);
			$methods = $class->getMethods(\ReflectionMethod::IS_PUBLIC | \ReflectionMethod::IS_STATIC);

			foreach( $methods as $m ) {
				static::addHelperMethod($class->name, $m->name);
			}
			
		}

	}
743576
public function registerEvents()
    {
        // Delete user tokens after login
        if (config('passwordless.empty_tokens_after_login') === true) {
            Event::listen(
                Authenticated::class,
                function (Authenticated $event) {
                    $event->user->tokens()
                        ->delete();
                }
            );
        }
    }
1277046
public function registerParameters($parameters)
	{
		foreach ($parameters as $parameter => $value) {
			if (property_exists($this, $parameter)) {
				$this->$parameter = $value;
			}
		}
	}
240110
def register_events eves
        @_events ||= []
        case eves
        when Array
          @_events.push(*eves)
        when Symbol
          @_events << eves
        else
          raise ArgumentError "register_events: Don't know how to handle #{eves.class}"
        end
      end
856381
protected function registerCommands(array $commands)
    {
        foreach ($commands as $command) {
            if ( ! $command instanceof SymfonyCommand) {
                $command = $this->container[$command];
            }

            $this->container['console']->add($command);
        }
    }
1177318
public function registerLookups(array $lookups)
    {
        $this->lookedUp = [];
        foreach ($lookups as $type => $lookup) {
            $this->registerLookup($type, $lookup);
        }
    }
475305
public function setTables(array $tables)
    {
        $this->tables = array();

        foreach ($tables as $table) {
            $this->addTable($table);
        }
    }
759159
public function setEventClasses($events)
    {
        foreach ($events as $iface => $cls) {
            $this->setEventClass($iface, $cls);
        }
    }
1018862
protected function registerLoadEvents($provider, array $events)
    {
        if (count($events) < 1) {
            return;
        }

        $this->app->make('events')->listen($events, function () use ($provider) {
            $this->app->register($provider);
        });
    }
140824
protected function registerCommands(array $commands)
    {
        foreach (array_keys($commands) as $command) {
            call_user_func([$this, "register{$command}Command"]);
        }

        $this->commands(array_values($commands));
    }
1137222
protected function registerListeners($service)
    {
        $serviceMetadata = $this->serviceMetadataFactory->getMetadataFor(get_class($service));

        foreach ($serviceMetadata->getAllListeners() as $event => $listeners) {
            foreach ($listeners as $listener) {
                $this->eventManager->addListener($event, array($service, $listener));
            }
        }
    }
864685
private function registerEventListeners()
    {
        $listeners = $this->getListeners();
        foreach ($listeners as $listenerKey => $listenerValues) {
            foreach ($listenerValues as $listenerValue) {
                \Event::listen($listenerKey,
                    $listenerValue
                );
            }
        }
    }