Code Duplication    Length = 10-11 lines in 2 locations

cloudcontrol/library/storage/Storage.php 2 locations

@@ 259-269 (lines=11) @@
256
			$this->repository->saveDocument($documentObject);
257
		}
258
259
		public function addDocument($postValues)
260
		{
261
			$documentObject = DocumentFactory::createDocumentFromPostValues($postValues, $this);
262
			if ($postValues['path'] === '/') {
263
				$documentObject->path = $postValues['path'] . $documentObject->slug;
264
			} else {
265
				$documentObject->path = $postValues['path'] . '/' . $documentObject->slug;
266
			}
267
268
			$this->repository->saveDocument($documentObject);
269
		}
270
271
		public function deleteDocumentBySlug($slug)
272
		{
@@ 284-293 (lines=10) @@
281
		 *
282
		 * @throws \Exception
283
		 */
284
		public function addDocumentFolder($postValues)
285
		{
286
			$documentFolderObject = DocumentFolderFactory::createDocumentFolderFromPostValues($postValues);
287
			if ($postValues['path'] === '/') {
288
				$documentFolderObject->path = $postValues['path'] . $documentFolderObject->slug;
289
			} else {
290
				$documentFolderObject->path = $postValues['path'] . '/' . $documentFolderObject->slug;
291
			}
292
			$this->repository->saveDocument($documentFolderObject);
293
		}
294
295
		/**
296
		 * Delete a folder by its compound slug