DefaultContext   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 65
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 65
c 0
b 0
f 0
wmc 6
lcom 0
cbo 3
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A jsonMapper() 0 4 1
A jwsAlgorithms() 0 4 1
A jweAlgorithms() 0 4 1
A jweEncryptions() 0 4 1
A setJsonMapper() 0 6 1
1
<?php
2
3
/*
4
 * This file is part of the tmilos/jose-jwt package.
5
 *
6
 * (c) Milos Tomic <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Tmilos\JoseJwt\Context;
13
14
use Tmilos\JoseJwt\Json\JsonMapper;
15
use Tmilos\JoseJwt\Jwe\JweAlgorithmCollection;
16
use Tmilos\JoseJwt\Jwe\JweEncryptionCollection;
17
use Tmilos\JoseJwt\Jws\JwsAlgorithmCollection;
18
19
class DefaultContext implements Context
20
{
21
    /** @var JsonMapper|null */
22
    private $jsonMapper;
23
24
    /** @var JwsAlgorithmCollection */
25
    private $jwsAlgorithms;
26
27
    /** @var JweAlgorithmCollection */
28
    private $jweAlgorithms;
29
30
    /** @var JweEncryptionCollection */
31
    private $jweEncryptions;
32
33
    public function __construct()
34
    {
35
        $this->jwsAlgorithms = new JwsAlgorithmCollection();
36
        $this->jweAlgorithms = new JweAlgorithmCollection();
37
        $this->jweEncryptions = new JweEncryptionCollection();
38
    }
39
40
    /**
41
     * @return JsonMapper|null
42
     */
43
    public function jsonMapper()
44
    {
45
        return $this->jsonMapper;
46
    }
47
48
    /**
49
     * @return JwsAlgorithmCollection
50
     */
51
    public function jwsAlgorithms()
52
    {
53
        return $this->jwsAlgorithms;
54
    }
55
56
    /**
57
     * @return JweAlgorithmCollection
58
     */
59
    public function jweAlgorithms()
60
    {
61
        return $this->jweAlgorithms;
62
    }
63
64
    /**
65
     * @return JweEncryptionCollection
66
     */
67
    public function jweEncryptions()
68
    {
69
        return $this->jweEncryptions;
70
    }
71
72
    /**
73
     * @param JsonMapper|null $jsonMapper
74
     *
75
     * @return DefaultContext
76
     */
77
    public function setJsonMapper(JsonMapper $jsonMapper = null)
78
    {
79
        $this->jsonMapper = $jsonMapper;
80
81
        return $this;
82
    }
83
}
84