JWTProvider::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 2
Bugs 1 Features 0
Metric Value
c 2
b 1
f 0
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4286
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Tymon\JWTAuth\Providers\JWT;
4
5
abstract class JWTProvider
6
{
7
    /**
8
     * @var string
9
     */
10
    protected $secret;
11
12
    /**
13
     * @var string
14
     */
15
    protected $algo;
16
17
    /**
18
     * @param string  $secret
19
     * @param string  $algo
20
     */
21 12
    public function __construct($secret, $algo = 'HS256')
22
    {
23 12
        $this->secret = $secret;
24 12
        $this->algo = $algo;
25 12
    }
26
27
    /**
28
     * Set the algorithm used to sign the token
29
     *
30
     * @param  string  $algo
31
     * @return self
32
     */
33 3
    public function setAlgo($algo)
34
    {
35 3
        $this->algo = $algo;
36
37 3
        return $this;
38
    }
39
40
    /**
41
     * Get the algorithm used to sign the token
42
     *
43
     * @return string
44
     */
45 3
    public function getAlgo()
46
    {
47 3
        return $this->algo;
48
    }
49
}
50