Code Duplication    Length = 10-11 lines in 2 locations

cloudcontrol/library/storage/Storage.php 1 location

@@ 132-141 (lines=10) @@
129
		 *
130
		 * @throws \Exception
131
		 */
132
		public function addDocumentFolder($postValues)
133
		{
134
			$documentFolderObject = DocumentFolderFactory::createDocumentFolderFromPostValues($postValues);
135
			if ($postValues['path'] === '/') {
136
				$documentFolderObject->path = $postValues['path'] . $documentFolderObject->slug;
137
			} else {
138
				$documentFolderObject->path = $postValues['path'] . '/' . $documentFolderObject->slug;
139
			}
140
			$this->repository->saveDocument($documentFolderObject);
141
		}
142
143
		/**
144
		 * Delete a folder by its compound slug

cloudcontrol/library/storage/storage/DocumentStorage.php 1 location

@@ 64-74 (lines=11) @@
61
	/**
62
	 * @param $postValues
63
	 */
64
	public function addDocument($postValues)
65
	{
66
		$documentObject = DocumentFactory::createDocumentFromPostValues($postValues, $this);
67
		if ($postValues['path'] === '/') {
68
			$documentObject->path = $postValues['path'] . $documentObject->slug;
69
		} else {
70
			$documentObject->path = $postValues['path'] . '/' . $documentObject->slug;
71
		}
72
73
		$this->repository->saveDocument($documentObject);
74
	}
75
76
	/**
77
	 * @param $slug