Get all the places for a particular type of event

@param string[] $events

@return Place[]
181721
public function getAllEventPlaces(array $events): array
    {
        $places = [];
        foreach ($this->facts($events) as $event) {
            if (preg_match_all('/\n(?:2 PLAC|3 (?:ROMN|FONE|_HEB)) +(.+)/', $event->gedcom(), $ged_places)) {
                foreach ($ged_places[1] as $ged_place) {
                    $places[] = new Place($ged_place, $this->tree);
                }
            }
        }

        return $places;
    }
1008128
public static function getRegistered($event) {
            $listeners = [];
            foreach (self::$listeners as $ev => $registered_listeners) {
                if ($ev & $event) {
                    $listeners = array_merge($listeners, $registered_listeners);
                }
            }

            return $listeners;
        }
1164538
protected function getSortedListeners($event)
    {
        if (! $this->hasListeners($event)) {
            return [];
        }

        $listeners = $this->listeners[$event];
        krsort($listeners);

        return call_user_func_array('array_merge', $listeners);
    }
1345418
public function getListeners($event): array
    {
        $event = $this->getEventName($event);

        if (! $this->hasListener($event)) {
            return [];
        }

        if (! array_key_exists($event, $this->sortedListeners)) {
            $listeners = $this->listeners[$event];

            krsort($listeners);

            $listeners = call_user_func_array(
                'array_merge',
                $listeners
            );
            $this->sortedListeners[$event] = $listeners;

            unset($listeners);
        }

        return $this->sortedListeners[$event];
    }
614918
public function getEventCallbacks($event = null)
    {
        if ($event === null) {
            return $this->eventCallbacks;
        }

        return $this->eventCallbacks[strtolower($event)] ?? [];
    }
909444
protected static function getIndexes(array $properties)
    {
        $indexes = [];

        foreach ($properties as $property) {
            $indexes[] = Index::get($property);
        }

        return $indexes;
    }
1151188
public function attachEvents($events=array()) {
		if (\is_array($events)) {
			foreach ( $events as $action => $selector ) {
				$this->attachEvent($selector, $action);
			}
		}
		return $this;
	}
722546
private function getEventCount(array $events): int
    {
        $query = DB::table('dates')
            ->where('d_file', '=', $this->tree->id());

        $no_types = [
            'HEAD',
            'CHAN',
        ];

        if ($events) {
            $types = [];

            foreach ($events as $type) {
                if (strncmp($type, '!', 1) === 0) {
                    $no_types[] = substr($type, 1);
                } else {
                    $types[] = $type;
                }
            }

            if ($types) {
                $query->whereIn('d_fact', $types);
            }
        }

        return $query->whereNotIn('d_fact', $no_types)
            ->count();
    }
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];
    }
1206853
private function addListeners(array $events)
    {
        foreach ($events as $eventName => $listeners) {
            foreach ($listeners as $listener) {
                if (is_array($listener) && count($listener) === 2 && is_int($listener[1])) {
                    list($listener, $priority) = $listener;
                } else {
                    $priority = 0;
                }
                $this->dispatcher->addListener($eventName, $listener, $priority);
            }
        }

        return $this;
    }
977279
public function createSuccessFromEventCollection(
        EventCollection $events
    ): EventCollection {
        Assert::assertThat(true, Assert::isTrue());

        return $events;
    }
1166186
public function getVisits($items)
  {
    $result = [];
    foreach ($items as $item) {
      $result[] = new Visit($item);
    }

    return $result;
  }
1235626
public function getArgs($event)
    {
        return [
            $event->getGroupField(),
            $event->getGroupingMode(),
            $event->getValue(),
            $event->getModel()->getPropertiesAsArray()
        ];
    }
918418
protected function prioritizeMainLocation(array $locations): array
    {
        foreach ($locations as $key => $location) {
            if ($location->main) {
                unset($locations[$key]);
                array_unshift($locations, $location);
                break;
            }
        }

        return $locations;
    }
53397
private function getTop10Places(array $places): array
    {
        $top10 = [];
        $i     = 0;

        arsort($places);

        foreach ($places as $place => $count) {
            $tmp     = new Place($place, $this->tree);
            $top10[] = [
                'place' => $tmp,
                'count' => $count,
            ];

            ++$i;

            if ($i === 10) {
                break;
            }
        }

        return $top10;
    }
820855
protected static function getFlatActions(array $actions)
    {
        $actions = array_map(function(Action $action) {
            return $action->getAction();
        }, $actions);

        return array_unique($actions);
    }
537717
public function findAll(array $locations = [])
    {
        if (empty($locations)) {
            $locations = $this->lookupPaths;
        }

        $finder = new Finder;
        $finder->directories()->depth(0)->sortByName()->in($locations);

        return iterator_to_array($finder, true);
    }