RobDWaller / ReallySimpleJWT
1
<?php
2

3
declare(strict_types=1);
4

5
namespace ReallySimpleJWT;
6

7
/**
8
 * JWT Value object.
9
 *
10
 * Consumes a token and a secret string, used when parsing a JWT and generated
11
 * when creating a JWT.
12
 */
13
class Jwt
14
{
15
    /**
16
     * The JSON Web Token string
17
     */
18
    private string $token;
19

20
    /**
21
    * The secret used to create the JWT signature
22
    */
23
    private string $secret;
24

25 16
    public function __construct(string $token, string $secret)
26
    {
27 16
        $this->token = $token;
28

29 16
        $this->secret = $secret;
30
    }
31

32
    /**
33
     * Return the JSON Web Token String
34
     */
35 16
    public function getToken(): string
36
    {
37 16
        return $this->token;
38
    }
39

40
    /**
41
     * Return the secret used to encode the JWT signature
42
     */
43 16
    public function getSecret(): string
44
    {
45 16
        return $this->secret;
46
    }
47
}

Read our documentation on viewing source code .

Loading