Returns an array of Events.
Every event is a class with the event
details being properties within it.

@return array
493693
public function events()
    {
        $array = $this->cal;
        $array = isset($array['VEVENT']) ? $array['VEVENT'] : array();
        $events = array();

        if (!empty($array)) {
            foreach ($array as $event) {
                $events[] = new Event($event);
            }
        }

        return $events;
    }
588977
public function getEvents()
    {
        if (empty($this->events)) {
            return [];
        }

        $events = call_user_func_array('array_merge', $this->events);

        foreach ($events as &$e) {
            if (!$e['timestamp'] instanceof \DateTime) {
                $dt             = new DateTimeHelper($e['timestamp'], 'Y-m-d H:i:s', 'UTC');
                $e['timestamp'] = $dt->getDateTime();
                unset($dt);
            }
        }

        if (!empty($this->orderBy)) {
            usort(
                $events,
                function ($a, $b) {
                    switch ($this->orderBy[0]) {
                        case 'eventLabel':
                            $aLabel = '';
                            if (isset($a['eventLabel'])) {
                                $aLabel = (is_array($a['eventLabel'])) ? $a['eventLabel']['label'] : $a['eventLabel'];
                            }

                            $bLabel = '';
                            if (isset($b['eventLabel'])) {
                                $bLabel = (is_array($b['eventLabel'])) ? $b['eventLabel']['label'] : $b['eventLabel'];
                            }

                            return strnatcmp($aLabel, $bLabel);

                        case 'date_added':
                            if ($a['timestamp'] == $b['timestamp']) {
                                $aPriority = isset($a['eventPriority']) ? (int) $a['eventPriority'] : 0;
                                $bPriority = isset($b['eventPriority']) ? (int) $b['eventPriority'] : 0;

                                return $aPriority - $bPriority;
                            }

                            return $a['timestamp'] < $b['timestamp'] ? -1 : 1;

                        case 'contact_id':
                            if ($a['contactId'] == $b['contactId']) {
                                return 0;
                            }

                            return $a['contactId'] < $b['contactId'] ? -1 : 1;

                        case 'type':

                            return strnatcmp($a['eventType'], $b['eventType']);

                        default:

                            return strnatcmp($a[$this->orderBy[0]], $b[$this->orderBy[0]]);
                    }
                }
            );

            if ('DESC' == $this->orderBy[1]) {
                $events = array_reverse($events);
            }
        }

        return $events;
    }
66124
protected function getEvents()
    {
        $events = [];

        foreach ($this->laravel->getProviders(EventServiceProvider::class) as $provider) {
            $providerEvents = array_merge($provider->discoverEvents(), $provider->listens());

            $events = array_merge_recursive($events, $providerEvents);
        }

        return $events;
    }
645491
public function toDomainEvents(): DomainEvents {
        return DomainEvents::make($this->map(function (StreamEvent $streamEvent) {
            return $streamEvent->event();
        })->toArray());
    }
314387
public function collect()
	{
		$events = $this->container->getEventDispatcher()->getEventTrace();

		$dataFormatter = $this->getDataFormatter();

		return array_map (function ($value) use ($dataFormatter) {
			$value = array(
				'name' => $value['name'],
				'timestamp' => $value['timestamp'],
				'listeners' => $value['listeners'],
				'event' => $value['event'] ? get_class($value['event']) : 'unknown'
			);

			return $dataFormatter->formatVar($value);
		}, $events);
	}
676154
public static function get_all_events_list($detail = true) {
        return array_merge(self::get_core_events_list($detail), self::get_non_core_event_list($detail));
    }
1156758
protected function eventCollection(): EventCollection
    {
        if ($this->eventCollection === null) {
            $this->eventCollection = new EventCollection($this->id(), Type::create($this));
        }

        return $this->eventCollection;
    }
171828
protected function getEventDefinitions()
    {
        $scanner = $this->laravel->make('annotations.event.scanner');

        $scanner->setClassesToScan($this->provider->eventScans());

        return '<?php '.PHP_EOL.PHP_EOL.$scanner->getEventDefinitions().PHP_EOL;
    }
1329666
public static final function get_static_info() {
        /** Var \core\event\base $event. */
        $event = new static();
        // Set static event data specific for child class.
        $event->init();
        return array(
            'eventname' => $event->data['eventname'],
            'component' => $event->data['component'],
            'target' => $event->data['target'],
            'action' => $event->data['action'],
            'crud' => $event->data['crud'],
            'edulevel' => $event->data['edulevel'],
            'objecttable' => $event->data['objecttable'],
        );
    }
1042696
public function events()
    {
        $events[ActiveRecord::EVENT_AFTER_DELETE] = 'eventAfterDelete';
        $events[ActiveRecord::EVENT_AFTER_INSERT] = 'save';
        $events[ActiveRecord::EVENT_AFTER_UPDATE] = 'save';
        return $events;
    }
437660
public function getEvents()
    {
        $events = [];

        $statement = $this->connection->prepare('SELECT * FROM ' . $this->table);

        $result = $statement->execute();

        if (0 < count($result)) {
            foreach ($result as $row) {
                var_dump($row);
                $events[] = (new Event())
                    ->setId($row['id']);
            }
        }

        return $events;
    }
399485
public function getEvents()
    {
        $events = [];

        try {
            $files = $this->reader->readDir($this->directory);

            foreach ($files as $file) {
                $filePath = $this->directory . '/' . $file;

                $contents = $this->reader->read($filePath);

                $parts = explode(PHP_EOL, $contents);
                $line1 = explode(' ', $parts[0]);

                $method = $line1[0];
                $endpoint = $line1[1];
                $reference = $parts[1];
                $request = $parts[2];

                $event = $this->eventFactory->create($request, $endpoint, $method, $reference);

                if (5 === count($parts)) {
                    $event->setLatency((float)$parts[3]);
                    $event->setResponse($parts[4]);
                }

                $events[] = $event;
            }
        } catch (Exception $e) {
            if (null !== $this->logger) {
                $this->logger->error($e);
            }
        }

        return $events;
    }
172811
protected static function define_other_properties() {
        return [
            'events' => [
                'type' => calendar_event_exporter::read_properties_definition(),
                'multiple' => true,
            ],
            'defaulteventcontext' => [
                'type' => PARAM_INT,
                'default' => 0,
            ],
            'filter_selector' => [
                'type' => PARAM_RAW,
            ],
            'courseid' => [
                'type' => PARAM_INT,
            ],
            'categoryid' => [
                'type' => PARAM_INT,
                'optional' => true,
                'default' => 0,
            ],
            'isloggedin' => [
                'type' => PARAM_BOOL,
            ],
        ];
    }
918571
public static function getEventListeners()
    {
        $listeners = array();

        $reflection = new ReflectionClass(get_called_class());
        foreach ($reflection->getMethods(ReflectionMethod::IS_PUBLIC) as $method)
        {
            if(substr($method->name, 0, 2) == 'on') {
               $listeners[] = $method->name;
            }
        }

        return $listeners;
    }
327666
public static function getEventNames($className)
    {
        $result = [];
        $reflection = new \ReflectionClass($className);
        foreach ($reflection->getConstants() as $name => $value) {
            if (!preg_match('/^EVENT/', $name)) {
                continue;
            }
            $result[$name] = $value;
        }
        return $result;
    }
785562
public function listIssueEvents(): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues/events',
            $this->getActivity()->getOwner(), $this->getActivity()->getRepo()));
    }
349263
public function getEvents()
    {
        $inotifyEvents = $this->readEvents();

        $inotifyEvents = is_array($inotifyEvents) ? $inotifyEvents : array();

        $last = end($inotifyEvents);
        if (IN_Q_OVERFLOW === $last['mask']) {
            throw new RuntimeException('Event queue overflowed. Either read events more frequently or increase the limit for queues. The limit can be changed in /proc/sys/fs/inotify/max_queued_events');
        }

        foreach ($inotifyEvents as $event) {
            foreach ($this->bag->get($event['wd']) as $watched) {
                $watched->setEvent($event['mask'], $event['name']);
            }
        }

        $events = array();

        foreach ($this->checkers as $meta) {
            $tracked = $meta['tracked'];
            $watched = $meta['checker'];
            foreach ($watched->getChangeset() as $change) {
                $events[] = new FilesystemEvent($tracked, $change['resource'], $change['event']);
            }
        }

        return $events;
    }