Code Duplication    Length = 11-19 lines in 2 locations

eZ/Publish/Core/Search/Common/EventSubscriber/ContentEventSubscriber.php 1 location

@@ 114-124 (lines=11) @@
111
        }
112
    }
113
114
    public function onUpdateContentMetadata(UpdateContentMetadataEvent $event)
115
    {
116
        $contentInfo = $this->persistenceHandler->contentHandler()->loadContentInfo($event->getContent()->id);
117
        if (!$contentInfo->isPublished) {
118
            return;
119
        }
120
        $this->searchHandler->indexContent(
121
            $this->persistenceHandler->contentHandler()->load($contentInfo->id, $contentInfo->currentVersionNo)
122
        );
123
        $this->searchHandler->indexLocation($this->persistenceHandler->locationHandler()->load($contentInfo->mainLocationId));
124
    }
125
}
126

eZ/Publish/Core/Search/Common/EventSubscriber/LocationEventSubscriber.php 1 location

@@ 103-121 (lines=19) @@
100
        $this->indexSubtree($event->getRevealedLocation()->id);
101
    }
102
103
    public function onUpdateLocation(UpdateLocationEvent $event)
104
    {
105
        $contentInfo = $this->persistenceHandler->contentHandler()->loadContentInfo(
106
            $event->getLocation()->contentId
107
        );
108
109
        $this->searchHandler->indexContent(
110
            $this->persistenceHandler->contentHandler()->load(
111
                $event->getLocation()->contentId,
112
                $contentInfo->currentVersionNo
113
            )
114
        );
115
116
        $this->searchHandler->indexLocation(
117
            $this->persistenceHandler->locationHandler()->load(
118
                $event->getLocation()->id
119
            )
120
        );
121
    }
122
123
    public function onAssignSectionToSubtree(AssignSectionToSubtreeEvent $event): void
124
    {