Code Duplication    Length = 7-9 lines in 2 locations

controller/paperhivecontroller.php 2 locations

@@ 133-141 (lines=9) @@
130
		}
131
		
132
		$fileContents = $this->view->file_get_contents($path);
133
		if ($fileContents !== false) {
134
			$paperHiveObject = json_decode($fileContents, true);
135
			if (json_last_error() === JSON_ERROR_NONE && isset($paperHiveObject['id'])) {
136
				$paperHiveId = $paperHiveObject['id'];
137
				if($this->adjustPaperHiveExtensions($path, $paperHiveId)){
138
					return $paperHiveId;
139
				}
140
			}
141
		}
142
		return false;
143
	}
144
@@ 175-181 (lines=7) @@
172
				}
173
174
				$disscussionCount = -1;
175
				if ($fetchDiscussions == "true") {
176
					$paperHiveString = $this->fetchDiscussions($revision);
177
					$paperHiveDiscussions = json_decode($paperHiveString, true);
178
					if (json_last_error() === JSON_ERROR_NONE && isset($paperHiveDiscussions['discussions'])) {
179
						$disscussionCount = count($paperHiveDiscussions['discussions']);
180
					}
181
				}
182
183
				return new DataResponse([
184
					'paperhive_base_url' => $this->paperhive_base_url,