Code Duplication    Length = 19-19 lines in 2 locations

eZ/Publish/Core/Search/Common/Slot/HideContent.php 1 location

@@ 13-31 (lines=19) @@
10
11
use eZ\Publish\Core\SignalSlot\Signal;
12
13
class HideContent extends AbstractSubtree
14
{
15
    /**
16
     * Receive the given $signal and react on it.
17
     *
18
     * @param \eZ\Publish\Core\SignalSlot\Signal $signal
19
     */
20
    public function receive(Signal $signal)
21
    {
22
        if (!$signal instanceof Signal\ContentService\HideContentSignal) {
23
            return;
24
        }
25
26
        $locations = $this->persistenceHandler->locationHandler()->loadLocationsByContent($signal->contentId);
27
        foreach ($locations as $location) {
28
            $this->indexSubtree($location->id);
29
        }
30
    }
31
}
32

eZ/Publish/Core/Search/Common/Slot/RevealContent.php 1 location

@@ 13-31 (lines=19) @@
10
11
use eZ\Publish\Core\SignalSlot\Signal;
12
13
class RevealContent extends AbstractSubtree
14
{
15
    /**
16
     * Receive the given $signal and react on it.
17
     *
18
     * @param \eZ\Publish\Core\SignalSlot\Signal $signal
19
     */
20
    public function receive(Signal $signal)
21
    {
22
        if (!$signal instanceof Signal\ContentService\RevealContentSignal) {
23
            return;
24
        }
25
26
        $locations = $this->persistenceHandler->locationHandler()->loadLocationsByContent($signal->contentId);
27
        foreach ($locations as $location) {
28
            $this->indexSubtree($location->id);
29
        }
30
    }
31
}
32