Completed
Push — master ( f67525...5cf1da )
by Florent
02:34
created

SignatureInstruction   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 4
c 1
b 0
f 1
lcom 0
cbo 0
dl 0
loc 53
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getKey() 0 4 1
A getProtectedHeader() 0 4 1
A getUnprotectedHeader() 0 4 1
1
<?php
2
3
/*
4
 * The MIT License (MIT)
5
 *
6
 * Copyright (c) 2014-2015 Spomky-Labs
7
 *
8
 * This software may be modified and distributed under the terms
9
 * of the MIT license.  See the LICENSE file for details.
10
 */
11
12
namespace Jose;
13
14
/**
15
 * Class SignatureInstruction.
16
 */
17
class SignatureInstruction implements SignatureInstructionInterface
18
{
19
    /**
20
     * @var \Jose\JWKInterface
21
     */
22
    protected $key = null;
23
    /**
24
     * @var array
25
     */
26
    protected $protected_header = [];
27
    /**
28
     * @var array
29
     */
30
    protected $unprotected_header = [];
31
32
    /**
33
     * SignatureInstruction constructor.
34
     *
35
     * @param \Jose\JWKInterface $key
36
     * @param array              $protected_header
37
     * @param array              $unprotected_header
38
     */
39
    public function __construct(JWKInterface $key, array $protected_header = [], array $unprotected_header = [])
40
    {
41
        $this->key = $key;
42
        $this->protected_header = $protected_header;
43
        $this->unprotected_header = $unprotected_header;
44
    }
45
46
    /**
47
     * {@inheritdoc}
48
     */
49
    public function getKey()
50
    {
51
        return $this->key;
52
    }
53
54
    /**
55
     * {@inheritdoc}
56
     */
57
    public function getProtectedHeader()
58
    {
59
        return $this->protected_header;
60
    }
61
62
    /**
63
     * {@inheritdoc}
64
     */
65
    public function getUnprotectedHeader()
66
    {
67
        return $this->unprotected_header;
68
    }
69
}
70