Code Duplication    Length = 23-24 lines in 2 locations

app/presenters/RegistrationPresenter.php 2 locations

@@ 165-188 (lines=24) @@
162
	 *
163
	 * @return void
164
	 */
165
	public function actionCreate()
166
	{
167
		try {
168
			$postData = $this->getHttpRequest()->getPost();
169
			$postData['meeting'] = $this->getMeetingId();
170
171
			$guid = $this->getVisitorService()->create($postData);
172
			$result = $this->sendRegistrationSummary($postData, $guid);
173
174
			$this->logInfo('Creation of registration(%s) successfull, result: %s', [
175
				$guid,
176
				json_encode($result),
177
			]);
178
			$this->flashSuccess("Registrace({$guid}) byla úspěšně založena.");
179
		} catch(Exception $e) {
180
			$this->logError('Creation of registration(%s) failed, result: %s', [
181
				$guid,
182
				$e->getMessage(),
183
			]);
184
			$this->flashError('Creation of registration failed, result: ' . $e->getMessage());
185
		}
186
187
		$this->redirect('Registration:check', $guid);
188
	}
189
190
	/**
191
	 * @param  string  $guid
@@ 194-216 (lines=23) @@
191
	 * @param  string  $guid
192
	 * @return void
193
	 */
194
	public function actionUpdate($guid)
195
	{
196
		try {
197
			$postData = $this->getHttpRequest()->getPost();
198
199
			$result = $this->getVisitorService()->update($guid, $postData);
200
			$result = $this->sendRegistrationSummary($postData, $guid);
201
202
			$this->logInfo('Modification of registration(%s) successfull, result: %s', [
203
				$guid,
204
				json_encode($result),
205
			]);
206
			$this->flashSuccess("Registrace({$guid}) byla úspěšně upravena.");
207
		} catch(Exception $e) {
208
			$this->logError('Modification of registration(%s) failed, result: %s', [
209
				$guid,
210
				$e->getMessage(),
211
			]);
212
			$this->flashError("Modification of registration({$guid}) failed, result: " . $e->getMessage());
213
		}
214
215
		$this->redirect('Registration:check', $guid);
216
	}
217
218
	/**
219
	 * Renders default template