Code Duplication    Length = 18-18 lines in 2 locations

code/api/nouns/APIProject.php 1 location

@@ 83-100 (lines=18) @@
80
	/**
81
	 * @return SS_HTTPResponse
82
	 */
83
	protected function createFetch() {
84
		/** @var DNGitFetch $fetch */
85
		$fetch = DNGitFetch::create();
86
		$fetch->ProjectID = $this->record->ID;
87
		$fetch->write();
88
		$fetch->start();
89
90
		$location = Director::absoluteBaseURL() . $this->Link() . '/fetch/' . $fetch->ID;
91
		$output = array(
92
			'message' => 'Fetch queued as job ' . $fetch->ResqueToken,
93
			'href' => $location,
94
		);
95
96
		$response = $this->getAPIResponse($output);
97
		$response->setStatusCode(201);
98
		$response->addHeader('Location', $location);
99
		return $response;
100
	}
101
102
	/**
103
	 * @return string

code/control/GitDispatcher.php 1 location

@@ 184-201 (lines=18) @@
181
	/**
182
	 * @return SS_HTTPResponse
183
	 */
184
	protected function createUpdate() {
185
		/** @var DNGitFetch $fetch */
186
		$fetch = DNGitFetch::create();
187
		$fetch->ProjectID = $this->project->ID;
188
		$fetch->write();
189
		$fetch->start();
190
191
		$location = Director::absoluteBaseURL() . $this->Link() . '/update/' . $fetch->ID;
192
		$output = [
193
			'message' => 'git fetch has been queued',
194
			'id' => $fetch->ID,
195
			'location' => $location,
196
		];
197
198
		$response = $this->getAPIResponse($output, 201);
199
		$response->addHeader('Location', $location);
200
		return $response;
201
	}
202
203
	/**
204
	 * @param $project