public function attach(EventObserverInterface $observer)
    {
        $key = $this->getRegistrationKey($observer);

        if (empty($this->observers[$key])) {
            $this->observers[$key] = $observer;
        }
    }