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

@@ 150-167 (lines=18) @@
147
	/**
148
	 * @return SS_HTTPResponse
149
	 */
150
	protected function createUpdate() {
151
		/** @var DNGitFetch $fetch */
152
		$fetch = DNGitFetch::create();
153
		$fetch->ProjectID = $this->project->ID;
154
		$fetch->write();
155
		$fetch->start();
156
157
		$location = Director::absoluteBaseURL() . $this->Link() . '/update/' . $fetch->ID;
158
		$output = array(
159
			'message' => 'git fetch has been queued',
160
			'id' => $fetch->ID,
161
			'location' => $location,
162
		);
163
164
		$response = $this->getAPIResponse($output, 201);
165
		$response->addHeader('Location', $location);
166
		return $response;
167
	}
168
169
	/**
170
	 * @param $project