eventList[] = $event; } public function eventFromType(string $type) : array { return array_filter($this->eventList, fn($ev) => $ev instanceof $type); } public function eventExecute(string $type, ...$arguments) : void { foreach($this->eventFromType($type) as $event) { call_user_func_array([ $event, 'execute'], $arguments); } } }