src/Leevel/Event/Dispatch.php
public function handle($event, ...$params): void
    {
        if (is_object($event)) {
            $name = get_class($event);
        } else {
            $name = $event;

            // This may return object or string
            $event = $this->container->make($event);
        }

        array_unshift($params, $event);

        $listeners = $this->get($name);

        if (!$listeners) {
            return;
        }

        ksort($listeners);

        $listeners = array_reduce($listeners, function (array $result, array $value) {
            return array_merge($result, $value);
        }, []);

        $this->makeSubject($listeners)->notify(...$params);
    }
public function handle($event, ...$params): void
    {
        if (is_object($event)) {
            $name = get_class($event);
        } else {
            $name = $event;

            // This may return object or string
            $event = $this->container->make($event);
        }

        array_unshift($params, $event);

        $listeners = $this->get($name);

        if (!$listeners) {
            return;
        }

        ksort($listeners);

        $listeners = array_reduce($listeners, function (array $result, array $value) {
            return array_merge($result, $value);
        }, []);

        $this->makeSubject($listeners)->notify(...$params);
    }
执行一个事件.

@param object|string $event
@param array         $params