Logout   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 36
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 25 2
1
<?php
2
namespace Redaxscript\Controller;
3
4
use Redaxscript\Auth;
5
6
/**
7
 * children class to process the logout request
8
 *
9
 * @since 3.0.0
10
 *
11
 * @package Redaxscript
12
 * @category Controller
13
 * @author Henry Ruhs
14
 * @author Balázs Szilágyi
15
 */
16
17
class Logout extends ControllerAbstract
18
{
19
	/**
20
	 * process the class
21
	 *
22
	 * @since 3.0.0
23
	 *
24
	 * @return string
25
	 */
26
27 2
	public function process() : string
28
	{
29 2
		$auth = new Auth($this->_request);
30 2
		$auth->init();
31
32
		/* handle logout */
33
34 2
		if ($auth->logout())
35
		{
36 1
			return $this->_success(
37
			[
38 1
				'route' => 'login',
39 1
				'timeout' => 0,
40 1
				'message' => $this->_language->get('logged_out'),
41 1
				'title' => $this->_language->get('goodbye')
42
			]);
43
		}
44
45
		/* handle error */
46
47 1
		return $this->_error(
48
		[
49 1
			'route' => 'login'
50
		]);
51
	}
52
}
53