toArray()['type'] ?? ''; if (empty($type)) { throw new \RuntimeException('Invalid event type.'); } return $type; } }