Code Duplication    Length = 16-16 lines in 4 locations

eZ/Publish/Core/SignalSlot/LocationService.php 2 locations

@@ 241-256 (lines=16) @@
238
     *
239
     * @return \eZ\Publish\API\Repository\Values\Content\Location $location, with updated hidden value
240
     */
241
    public function hideLocation(Location $location)
242
    {
243
        $returnValue = $this->service->hideLocation($location);
244
        $this->signalDispatcher->emit(
245
            new HideLocationSignal(
246
                [
247
                    'locationId' => $location->id,
248
                    'contentId' => $location->contentId,
249
                    'currentVersionNo' => $returnValue->getContentInfo()->currentVersionNo,
250
                    'parentLocationId' => $returnValue->parentLocationId,
251
                ]
252
            )
253
        );
254
255
        return $returnValue;
256
    }
257
258
    /**
259
     * Unhides the $location.
@@ 270-285 (lines=16) @@
267
     *
268
     * @return \eZ\Publish\API\Repository\Values\Content\Location $location, with updated hidden value
269
     */
270
    public function unhideLocation(Location $location)
271
    {
272
        $returnValue = $this->service->unhideLocation($location);
273
        $this->signalDispatcher->emit(
274
            new UnhideLocationSignal(
275
                [
276
                    'locationId' => $location->id,
277
                    'contentId' => $location->contentId,
278
                    'currentVersionNo' => $returnValue->getContentInfo()->currentVersionNo,
279
                    'parentLocationId' => $returnValue->parentLocationId,
280
                ]
281
            )
282
        );
283
284
        return $returnValue;
285
    }
286
287
    /**
288
     * Moves the subtree to $newParentLocation.

eZ/Publish/Core/SignalSlot/TrashService.php 2 locations

@@ 81-96 (lines=16) @@
78
     *
79
     * @return \eZ\Publish\API\Repository\Values\Content\TrashItem|null null if location was deleted, otherwise TrashItem
80
     */
81
    public function trash(Location $location)
82
    {
83
        $returnValue = $this->service->trash($location);
84
        $this->signalDispatcher->emit(
85
            new TrashSignal(
86
                [
87
                    'locationId' => $location->id,
88
                    'parentLocationId' => $location->parentLocationId,
89
                    'contentId' => $location->contentId,
90
                    'contentTrashed' => $returnValue instanceof TrashItem,
91
                ]
92
            )
93
        );
94
95
        return $returnValue;
96
    }
97
98
    /**
99
     * Recovers the $trashedLocation at its original place if possible.
@@ 110-125 (lines=16) @@
107
     *
108
     * @return \eZ\Publish\API\Repository\Values\Content\Location the newly created or recovered location
109
     */
110
    public function recover(TrashItem $trashItem, Location $newParentLocation = null)
111
    {
112
        $newLocation = $this->service->recover($trashItem, $newParentLocation);
113
        $this->signalDispatcher->emit(
114
            new RecoverSignal(
115
                [
116
                    'trashItemId' => $trashItem->id,
117
                    'contentId' => $trashItem->contentId,
118
                    'newParentLocationId' => $newLocation->parentLocationId,
119
                    'newLocationId' => $newLocation->id,
120
                ]
121
            )
122
        );
123
124
        return $newLocation;
125
    }
126
127
    /**
128
     * Empties trash.