Passed
Push — master ( a357e7...195a07 )
by Anton
04:22 queued 01:11
created

Reset::handle()   A

Complexity

Conditions 4
Paths 4

Size

Total Lines 21
Code Lines 6

Duplication

Lines 21
Ratio 100 %

Importance

Changes 0
Metric Value
dl 21
loc 21
rs 9.0534
c 0
b 0
f 0
cc 4
eloc 6
nc 4
nop 0
1
<?php
2
3
namespace Modules\Auth\Action {
4
5
	use Modules\Auth, Request;
6
7 View Code Duplication
	class Reset extends Auth\Utils\Action {
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
8
9
		# Handle request
10
11
		public function handle() {
12
13
			# Set view
14
15
			$this->view = (Auth::admin() ? 'Blocks/Auth/Reset' : 'Blocks/Profile/Auth/Reset');
16
17
			# Create form
18
19
			$this->form = new Auth\Form\Reset;
20
21
			# Handle form
22
23
			if ($this->form->handle(new Auth\Controller\Reset)) {
24
25
				Request::redirect(INSTALL_PATH . (Auth::admin() ? '/admin' : '/profile') . '/login?submitted=reset');
26
			}
27
28
			# ------------------------
29
30
			return $this->getContents();
31
		}
32
	}
33
}
34