Code Duplication    Length = 17-17 lines in 2 locations

app/presenters/VisitorPresenter.php 2 locations

@@ 202-218 (lines=17) @@
199
	 * @param  integer|string $ids
200
	 * @return void
201
	 */
202
	public function actionPay($id)
203
	{
204
		try {
205
			$visitor = $this->getModel();
206
			$visitor->payCharge($id, 'cost');
207
			$recipients = $visitor->getRecipients($id);
208
			$this->getEmailer()->sendPaymentInfo($recipients, 'advance');
209
210
			Debugger::log('Visitor: Action pay for id ' . $id . ' successfull, result: ' . $e->getMessage(), Debugger::INFO);
211
			$this->flashMessage('Platba byla zaplacena.', 'ok');
212
		} catch(Exception $e) {
213
			Debugger::log('Visitor: Action pay for id ' . $id . ' failed, result: ' . $e->getMessage(), Debugger::ERROR);
214
			$this->flashMessage('Visitor: Action pay for id ' . $id . ' failed, result: ' . $e->getMessage(), 'error');
215
		}
216
217
		$this->redirect('Visitor:listing');
218
	}
219
220
	/**
221
	 * @param  string|interger $ids
@@ 224-240 (lines=17) @@
221
	 * @param  string|interger $ids
222
	 * @return void
223
	 */
224
	public function actionAdvance($id)
225
	{
226
		try {
227
			$visitor = $this->getModel();
228
			$visitor->payCharge($id, 'advance');
229
			$recipients = $visitor->getRecipients($id);
230
			$this->getEmailer()->sendPaymentInfo($recipients, 'advance');
231
232
			Debugger::log('Visitor: Action advance for id ' . $id . ' successfull, result: ' . $e->getMessage(), Debugger::INFO);
233
			$this->flashMessage('Záloha byla zaplacena.', 'ok');
234
		} catch(Exception $e) {
235
			Debugger::log('Visitor: Action advance for id ' . $id . ' failed, result: ' . $e->getMessage(), Debugger::ERROR);
236
			$this->flashMessage('Visitor: Action advance for id ' . $id . ' failed, result: ' . $e->getMessage(), 'error');
237
		}
238
239
		$this->redirect('Visitor:listing');
240
	}
241
242
	/**
243
	 * Set item as checked by id