GenerateTokenFromClaimsTask   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A run() 0 4 1
1
<?php
2
3
namespace App\Containers\Authentication\Tasks;
4
5
use App\Containers\Authentication\Adapters\JwtAuthAdapter;
6
use App\Ship\Parents\Tasks\Task;
7
8
/**
9
 * Class GenerateTokenFromClaimsTask.
10
 *
11
 * @author Mahmoud Zalt <[email protected]>
12
 */
13
class GenerateTokenFromClaimsTask extends Task
14
{
15
16
    public $jwtAuthAdapter;
17
18
    /**
19
     * GenerateTokenFromClaimsTask constructor.
20
     *
21
     * @param \App\Containers\Authentication\Adapters\JwtAuthAdapter $jwtAuthAdapter
22
     */
23
    public function __construct(JwtAuthAdapter $jwtAuthAdapter)
24
    {
25
        $this->jwtAuthAdapter = $jwtAuthAdapter;
26
    }
27
28
29
    /**
30
     * @param $customClaims
31
     *
32
     * @return  mixed
33
     */
34
    public function run($customClaims)
35
    {
36
        return $this->jwtAuthAdapter->makeTokenWithCustomClaims($customClaims);
37
    }
38
39
}
40