Completed
Push — master ( a9f129...0fe947 )
by Mahmoud
03:59
created

LogoutAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 31
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A run() 0 6 1
1
<?php
2
3
namespace App\Containers\ApiAuthentication\Actions;
4
5
use App\Containers\ApiAuthentication\Services\ApiAuthenticationService;
6
use App\Port\Action\Abstracts\Action;
7
8
/**
9
 * Class ApiLogoutAction.
10
 *
11
 * @author Mahmoud Zalt <[email protected]>
12
 */
13
class LogoutAction extends Action
14
{
15
16
    /**
17
     * @var  \App\Containers\ApiAuthentication\Services\ApiAuthenticationService
18
     */
19
    private $authenticationService;
20
21
    /**
22
     * LogoutAction constructor.
23
     *
24
     * @param \App\Containers\ApiAuthentication\Services\ApiAuthenticationService $authenticationService
25
     */
26
    public function __construct(
27
        ApiAuthenticationService $authenticationService
28
    ) {
29
        $this->authenticationService = $authenticationService;
30
    }
31
32
    /**
33
     * @param $authorizationHeader
34
     *
35
     * @return bool
36
     */
37
    public function run($authorizationHeader)
38
    {
39
        $ok = $this->authenticationService->logout($authorizationHeader);
40
41
        return $ok;
42
    }
43
}
44