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

SignatureInstruction::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
rs 9.4286
cc 1
eloc 4
nc 1
nop 3
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