Code Duplication    Length = 7-13 lines in 2 locations

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

@@ 21-27 (lines=7) @@
18
        ];
19
    }
20
21
    public function onAssignSection(AssignSectionEvent $event)
22
    {
23
        $contentInfo = $this->persistenceHandler->contentHandler()->loadContentInfo($event->getContentInfo()->id);
24
        $this->searchHandler->indexContent(
25
            $this->persistenceHandler->contentHandler()->load($contentInfo->id, $contentInfo->currentVersionNo)
26
        );
27
    }
28
}
29

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

@@ 43-55 (lines=13) @@
40
        $this->indexSubtree($event->getLocation()->id);
41
    }
42
43
    public function onCreateLocation(CreateLocationEvent $event)
44
    {
45
        $contentInfo = $this->persistenceHandler->contentHandler()->loadContentInfo(
46
            $event->getContentInfo()->id
47
        );
48
49
        $this->searchHandler->indexContent(
50
            $this->persistenceHandler->contentHandler()->load(
51
                $contentInfo->id,
52
                $contentInfo->currentVersionNo
53
            )
54
        );
55
    }
56
57
    public function onDeleteLocation(DeleteLocationEvent $event)
58
    {