Code Duplication    Length = 17-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/DeployPlanDispatcher.php 1 location

@@ 164-180 (lines=17) @@
161
	/**
162
	 * @return SS_HTTPResponse
163
	 */
164
	protected function createFetch() {
165
		/** @var DNGitFetch $fetch */
166
		$fetch = DNGitFetch::create();
167
		$fetch->ProjectID = $this->project->ID;
168
		$fetch->write();
169
		$fetch->start();
170
171
		$location = Director::absoluteBaseURL() . $this->Link() . '/gitupdate/' . $fetch->ID;
172
		$output = array(
173
			'message' => 'Fetch queued as job ' . $fetch->ResqueToken,
174
			'href' => $location,
175
		);
176
177
		$response = $this->getAPIResponse($output, 201);
178
		$response->addHeader('Location', $location);
179
		return $response;
180
	}
181
182
	/**
183
	 * @param SS_HTTPRequest $request