Register the listeners for the subscriber.

@param \Illuminate\Events\Dispatcher $events

@return array
184033
public function subscribe(Dispatcher $events)
    {
        $events->listen(
            DiskUsageHealthy::class,
            static::class.'@whenDiskUsageHealthy'
        );

        $events->listen(
            DiskUsageAlarm::class,
            static::class.'@whenDiskUsageAlarm'
        );

        $events->listen(
            HttpPingUp::class,
            static::class.'@whenHttpPingUp'
        );

        $events->listen(
            HttpPingDown::class,
            static::class.'@whenHttpPingDown'
        );

        $events->listen(
            SSLCertificateValid::class,
            static::class.'@whenSSLCertificateValid'
        );

        $events->listen(
            SSLCertificateInvalid::class,
            static::class.'@whenSSLCertificateInvalid'
        );

        $events->listen(
            SSLCertificateExpiring::class,
            static::class.'@whenSSLCertificateExpiring'
        );
    }
535657
public function dispatch(array $events)
    {
        foreach ($events as $event) {
            $eventName = $this->getEventName($event);

            $this->app->fireEvent($eventName, $event);
            $this->app->logEvent($eventName .' was fired.');
        }
    }
923050
private function getListenersForEvent($event) {
        $listeners = [];

        foreach ($this->getEventNameParts($event) as $name) {
            if (isset($this->callbacks[$name])) {
                foreach (clone $this->callbacks[$name] as $listener) {
                    $listeners[] = $listener;
                }
            }
        }

        return $listeners;
    }
1109442
public function addEvents(array $events)
    {
        foreach ($events as $event) {
            if ($event instanceof EventInterface) {
                $this->addEvent($event);
            }
        }
        return $this;
    }
771281
public function subscribe($events)
	{
		$events->listen('Neonbug\Common\Events\AdminAddPreparedFields', function($event) {
			$interfaces = class_implements($event->class_name);
			if (!array_key_exists('Neonbug\Common\Traits\OrdTraitInterface', $interfaces)) return;
			
			$class_name = $event->class_name;
			foreach ($class_name::getOrdFields() as $field_name)
			{
				$new_value = $class_name::all()->max($field_name);
				$new_value = ($new_value === null ? 1 : intval($new_value) + 10);
				
				foreach ($event->fields['language_independent'] as $idx=>$field)
				{
					if ($field['name'] != $field_name) continue;
					
					$event->fields['language_independent'][$idx]['value'] = $new_value;
				}
			}
		});
	}
328111
protected function registerEvents()
    {
        $events = $this->app->make(Dispatcher::class);

        foreach ($this->events as $event => $listeners) {
            foreach ($listeners as $listener) {
                $events->listen($event, $listener);
            }
        }
    }
327930
protected function listen()
    {
        $events = app('events');
        if (isset($this->listen)) {
            foreach ($this->listen as $event => $listeners) {
                foreach ($listeners as $listener) {
                    $events->listen($event, $listener);
                }
            }
        }
        
        if (isset($this->subscribe)) {
            foreach ($this->subscribe as $subscriber) {
                $events->subscribe($subscriber);
            }
        }
    }
1056793
public function subscribe($events)
    {
        $events->listen(
            ComponentItemDestroyed::class,
            'Larrock\Core\Plugins\ComponentPlugin@detach'
        );

        $events->listen(
            ComponentItemUpdated::class,
            'Larrock\Core\Plugins\ComponentPlugin@attach'
        );

        $events->listen(
            ComponentItemStored::class,
            'Larrock\Core\Plugins\ComponentPlugin@attach'
        );
    }
569079
public function getListeners($event = null)
	{
		$event = $this->resolveEventName($event);

		if ($event)
		{
			if (isset($this->listeners[$event]))
			{
				return $this->listeners[$event]->getAll();
			}
			return array();
		}

		return $this->listeners;
	}
276566
public function events(array $events = null)
    {
        if (null !== $events) {
            return $this->events = $events;
        }

        return $this->events;
    }
282149
protected function addEventListeners(array $listeners)
  {
    try
    {
      foreach ($listeners as $listener)
      {
        $this->dispatcher->addListener(
          $listener['event'],
          array(
            $listener['class'],
            $listener['method']
          ),
          $listener['priority']
        );
      }
    }
    catch (\Exception $e)
    {
      throw new TransformerException($e->getMessage());
    }

    return $this;
  }
227843
public function subscribe($events)
	{
		$events->listen('Neonbug\Common\Events\AdminAddSavePreparedFields', function($event) {
			$this->handlePreparedFieldsEvent($event);
		});
		
		$events->listen('Neonbug\Common\Events\AdminEditSavePreparedFields', function($event) {
			$this->handlePreparedFieldsEvent($event);
		});
		
		$events->listen('Neonbug\Common\Events\AdminEditPreparedFields', function($event) {
			$interfaces = class_implements($event->class_name);
			if (!array_key_exists('Neonbug\Common\Traits\PasswordTraitInterface', $interfaces)) return;
			
			$class_name = $event->class_name;
			$password_fields = $class_name::getPasswordFields();
			
			if (sizeof($password_fields) > 0)
			{
				foreach ($event->fields as $type=>$fields)
				{
					foreach ($fields as $idx=>$field)
					{
						$field_name = $field['name'];
						if (!in_array($field_name, $password_fields)) continue;
						
						$event->fields[$type][$idx]['value'] = '';
					}
				}
			}
		});
	}
504492
protected function loadEvents(array $events = array())
    {
        foreach ($events as $event) {
            $method = 'set'.$event['type'].'s';
            $this->$method($event);
        }
    }
637509
public function getListeners(string $event) : array
    {
        if (empty($this->listeners[$event])) {
            return [];
        }

        if (! isset($this->sorted[$event])) {
            $this->sorted[$event] = $this->sortListeners($this->listeners[$event]);
        }

        return $this->sorted[$event];
    }
1096900
public function getListeners($event): array
    {
        if ($event instanceof EventInterface) {
            $event = $event->getName();
        }

        if (isset($this->listeners[$event])) {
            return $this->listeners[$event]->getAll();
        }

        return [];
    }
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));
            }
        }
    }
276960
public static function register($event, $listener) {
            if (!is_subclass_of($listener, Listener::class)) {
                throw new RegisterNonListenerException();
            }

            foreach (self::$listeners as $ev => $registered_listeners) {
                if ($ev & $event && !in_array($listener, $registered_listeners)) {
                    self::$listeners[ $ev ][] = $listener;
                }
            }
        }