Get all of the listeners and their corresponding events.

@param  iterable  $listeners
@param  string  $basePath
@return array
507957
protected static function getListenerEvents($listeners, $basePath)
    {
        $listenerEvents = [];

        foreach ($listeners as $listener) {
            $listener = new ReflectionClass(
                static::classFromFile($listener, $basePath)
            );

            foreach ($listener->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {
                if (! Str::is('handle*', $method->name) ||
                    ! isset($method->getParameters()[0])) {
                    continue;
                }

                $listenerEvents[$listener->name.'@'.$method->name] =
                                optional($method->getParameters()[0]->getClass())->name;
            }
        }

        return array_filter($listenerEvents);
    }
1192914
protected function iterateListeners(array $listeners, $result)
    {
        foreach ($listeners as $listener) {
            call_user_func($listener, $result, $this);
        }
    }
520587
public List<Listener<Listeners<T>>> getAllListener()
   {
      List<Listener<Listeners<T>>> list = new ArrayList<Listener<Listeners<T>>>();
      List<Node> nodeList = childNode.get("listener");
      for(Node node: nodeList)
      {
         Listener<Listeners<T>>  type = new ListenerImpl<Listeners<T>>(this, "listener", childNode, node);
         list.add(type);
      }
      return list;
   }
183205
public function getListeners($resultType = self::FULL_RESULT)
    {
        $listeners = [];

        foreach ($this->getEventDispatcher()->getListeners(CronEvent::NAME) as $listener) {
            $listenerClass = get_class($listener[0]);

            if (!$listener[0] instanceof CronEventListenerInterface) {
                $this->getLogger()->addError(sprintf('%s without %s', $listenerClass, CronEventListenerInterface::class));

                continue;
            }

            if (self::FLAT_RESULT === $resultType) {
                $listeners[] = $listenerClass;

                continue;
            }

            $type = $listener[0]::getRepeatedType();
            if (false === isset($listeners[$type])) {
                $listeners[$type] = [];
            }

            $listeners[$type][] = $listenerClass;
        }

        return $listeners;
    }
184950
def get_listeners(self, event_type: str) -> List[Callable]:
        """"""
        if event_type not in self.events:
            raise ValueError(f'No event {event_type} in system.')
        return self.events.get_listeners(event_type)
1282020
private function getListeners(ActionEvent $event): iterable
    {
        $prioritizedListeners = $this->events[$event->getName()] ?? [];

        \krsort($prioritizedListeners, SORT_NUMERIC);

        foreach ($prioritizedListeners as $listenersByPriority) {
            foreach ($listenersByPriority as $listenerHandler) {
                yield $listenerHandler;
            }
        }
    }
1096900
public function getListeners($event): array
    {
        if ($event instanceof EventInterface) {
            $event = $event->getName();
        }

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

        return [];
    }
19022
public static function getKnownLanguages($basePath = JPATH_ROOT)
	{
		$dir = self::getLanguagePath($basePath);
		$knownLanguages = self::parseLanguageFiles($dir);

		return $knownLanguages;
	}
153927
public function getListeners($eventName = null)
    {

        if (empty($eventName)) return $this->listeners;
        if (!empty($eventName) && !isset($this->listeners[$eventName])) return [];

        return $this->listeners[$eventName];
    }
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;
    }
662216
protected function _getCallbacks($className, $pluginPath = null, $prefixPath = null)
    {
        $callbacks = [];
        $namespace = $this->_getNamespace($className, $pluginPath, $prefixPath);
        $reflection = new \ReflectionClass($namespace);
        if ($reflection->isAbstract()) {
            return $callbacks;
        }
        try {
            $method = $reflection->getMethod('implementedEvents');
        } catch (ReflectionException $e) {
            return $callbacks;
        }
        if (version_compare(phpversion(), '5.4', '>=')) {
            $object = $reflection->newInstanceWithoutConstructor();
        } else {
            $object = unserialize(
                sprintf('O:%d:"%s":0:{}', strlen($className), $className)
            );
        }
        $implementedEvents = $method->invoke($object);
        foreach ($implementedEvents as $event => $callable) {
            if (is_string($callable)) {
                $callbacks[] = $callable;
            }
            if (is_array($callable) && isset($callable['callable'])) {
                $callbacks[] = $callable['callable'];
            }
        }

        return $callbacks;
    }
761822
protected function getWildcardListeners($eventName)
    {
        $wildcards = [];

        foreach ($this->wildcards as $key => $listeners) {
            if ($this->wildcardContainsEvent($key, $eventName)) {
                $wildcards = array_merge($wildcards, $listeners);
            }
        }

        return $this->wildcardsCache[$eventName] = $wildcards;
    }
762159
public function getStrategy($basePath, $settings = [])
    {
        if (isset($settings['combineRecords']) && $settings['combineRecords']) {
            $combineTag = $settings['combineRecordsTag'] ?? null;
            return new CombinedRecordWriterStrategy($basePath, $combineTag);
        }
        return new IndividualRecordWriterStrategy($basePath);
    }
542103
public function getListeners($name)
    {
        $result = array();
        if (isset($this->_listeners[$name])) {
            $result = $this->_listeners[$name];
        }
        
        return $result;
    }
1322728
public function getListeners(string $eventName = ''): array
    {
        $this->sortListeners($eventName);
        if ('' !== $eventName) {
            return \array_key_exists($eventName, $this->listeners) ? $this->listeners[$eventName] : [];
        }
        return $this->listeners;
    }
857879
public function dump($basepath)
    {
        foreach ($this->sitemapDumpers as $sitemapDumper) {
            if (is_array($this->languages)) {
                foreach ($this->languages as $language) {
                    $sitemapDumper->dump($basepath, $language);
                }
            } else {
                $sitemapDumper->dump($basepath);
            }
        }

        return $this;
    }
698243
private function bindEventListenersEvents()
	{
		if ($this->_eventListeners && !$this->_listenerInstances) {
			foreach ($this->_eventListeners as $listener) {
                
				$listener = static::getListener($listener);
				
				$events = $listener->events();
				
				if ($events) foreach ($events as $name => $handler) {
					static::on($name, is_string($handler) ? [$listener, $handler] : $handler);
				}
			}
		}
	}