public function setStack(array $stack): void
    {
        // reset
        $this->stack = [];

        foreach ($stack as $event) {
            if (!$event instanceof Event) {
                throw new EventException('Stack elements must be instanceof froq\event\Event object');
            }

            $this->stack[$this->normalizeName($event->getName())] = $event;
        }
    }