Code Duplication    Length = 5-5 lines in 2 locations

lib/Controller/PaperHiveController.php 2 locations

@@ 150-154 (lines=5) @@
147
148
	private function getBookIdforPath($dir, $filename){
149
		if (!empty($filename)) {
150
			if($dir == '/') {
151
				$path = $dir . $filename;
152
			} else {
153
				$path = $dir . '/' . $filename;
154
			}
155
156
			$fileInfo = $this->view->getFileInfo($path);
157
			if($fileInfo && $bookId = $this->paperHiveMetadata->getBookID($fileInfo['fileid'])) {
@@ 245-249 (lines=5) @@
242
		// Save the file
243
		$title = $paperHiveObject['metadata']['title'];
244
		$filename = $title . $this->paperhive_file_extension;
245
		if($dir == '/') {
246
			$path = $dir . $filename;
247
		} else {
248
			$path = $dir . '/' . $filename;
249
		}
250
251
		$exists = $this->view->file_exists($path);
252
		if ($exists) {