Code Duplication    Length = 10-11 lines in 2 locations

cloudcontrol/library/storage/Storage.php 2 locations

@@ 254-264 (lines=11) @@
251
			$this->repository->saveDocument($documentObject);
252
		}
253
254
		public function addDocument($postValues)
255
		{
256
			$documentObject = DocumentFactory::createDocumentFromPostValues($postValues, $this);
257
			if ($postValues['path'] === '/') {
258
				$documentObject->path = $postValues['path'] . $documentObject->slug;
259
			} else {
260
				$documentObject->path = $postValues['path'] . '/' . $documentObject->slug;
261
			}
262
263
			$this->repository->saveDocument($documentObject);
264
		}
265
266
		public function deleteDocumentBySlug($slug)
267
		{
@@ 279-288 (lines=10) @@
276
		 *
277
		 * @throws \Exception
278
		 */
279
		public function addDocumentFolder($postValues)
280
		{
281
			$documentFolderObject = DocumentFolderFactory::createDocumentFolderFromPostValues($postValues);
282
			if ($postValues['path'] === '/') {
283
				$documentFolderObject->path = $postValues['path'] . $documentFolderObject->slug;
284
			} else {
285
				$documentFolderObject->path = $postValues['path'] . '/' . $documentFolderObject->slug;
286
			}
287
			$this->repository->saveDocument($documentFolderObject);
288
		}
289
290
		/**
291
		 * Delete a folder by its compound slug