Code Duplication    Length = 12-14 lines in 2 locations

src/Transfer/EzPlatform/Repository/Manager/LocationManager.php 2 locations

@@ 173-186 (lines=14) @@
170
    /**
171
     * {@inheritdoc}
172
     */
173
    public function createOrUpdate(ObjectInterface $object)
174
    {
175
        if (!$object instanceof LocationObject) {
176
            throw new UnsupportedObjectOperationException(LocationObject::class, get_class($object));
177
        }
178
179
        try {
180
            $this->find($object);
181
182
            return $this->update($object);
183
        } catch (NotFoundException $notFound) {
184
            return $this->create($object);
185
        }
186
    }
187
188
    /**
189
     * Creates/updates/deletes locations in ContentObject->parent_locations.
@@ 242-253 (lines=12) @@
239
    /**
240
     * {@inheritdoc}
241
     */
242
    public function remove(ObjectInterface $object)
243
    {
244
        if (!$object instanceof LocationObject) {
245
            throw new UnsupportedObjectOperationException(LocationObject::class, get_class($object));
246
        }
247
248
        if ($location = $this->find($object)) {
249
            $this->locationService->deleteLocation($location);
250
        }
251
252
        return true;
253
    }
254
255
    /**
256
     * Hides a location.