Completed
Push — master ( 0fe947...dc0e70 )
by Mahmoud
04:36
created

LogoutAction::run()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace App\Containers\WebAuthentication\Actions;
4
5
use App\Containers\WebAuthentication\Services\WebAuthenticationService;
6
use App\Port\Action\Abstracts\Action;
7
8
/**
9
 * Class WebLogoutAction.
10
 *
11
 * @author Mahmoud Zalt <[email protected]>
12
 */
13
class LogoutAction extends Action
14
{
15
16
    /**
17
     * @var  \App\Containers\WebAuthentication\Services\WebAuthenticationService
18
     */
19
    private $authenticationService;
20
21
    /**
22
     * LogoutAction constructor.
23
     *
24
     * @param \App\Containers\WebAuthentication\Services\WebAuthenticationService $authenticationService
25
     */
26
    public function __construct(
27
        WebAuthenticationService $authenticationService
28
    ) {
29
        $this->authenticationService = $authenticationService;
30
    }
31
32
    /**
33
     * @param $authorizationHeader
34
     *
35
     * @return bool
36
     */
37
    public function run()
38
    {
39
        $hasLoggedOut = $this->authenticationService->logout();
40
41
        return $hasLoggedOut;
42
    }
43
}
44