Code Duplication    Length = 7-13 lines in 2 locations

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

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

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