public function handleEvent(string $eventId, array $eventData)
    {
        switch ($eventId) {
            case self::EVENT_ADD_CHILD:
                /** @var NodeInterface $node */
                $node = $eventData['child'];

                $this->addNode($node);

                break;
            case self::EVENT_REMOVE_CHILD:
                /** @var NodeInterface $node */
                $node = $eventData['child'];

                $this->removeNode($node);

                break;
            case self::EVENT_ADD_PARENT:
                /** @var NodeInterface $child */
                $child = $eventData['child'];
                /** @var NodeInterface $newParent */
                $newParent = $eventData['newParent'];
                $nodes = $child->getNodes() + [$child];

                /** @var NodeInterface $n */
                foreach ($nodes as $n) {
                    $n->addSubscriber($newParent);
                    $newParent->addNode($n);
                }

                break;
            case self::EVENT_REMOVE_PARENT:
                /** @var NodeInterface $child */
                $child = $eventData['child'];
                /** @var NodeInterface $oldParent */
                $oldParent = $eventData['parentToRemove'];
                $nodes = $child->getNodes() + [$child];

                /** @var NodeInterface $n */
                foreach ($nodes as $n) {
                    $n->removeSubscriber($oldParent);
                    $oldParent->removeNode($n);
                }

                break;
            default:
                break;
        }
    }