Code Duplication    Length = 16-16 lines in 4 locations

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

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

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

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