JWTProvider::getAlgo()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
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