Completed
Push — master ( cb70dd...e19938 )
by Florent
02:50
created

JWS::withSignature()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
rs 9.4286
cc 1
eloc 4
nc 1
nop 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\Object;
13
14
/**
15
 * Class JWS.
16
 */
17
final class JWS extends JWT implements JWSInterface
18
{
19
    /**
20
     * @var string|null
21
     */
22
    protected $encoded_payload = null;
23
24
    /**
25
     * @var string|null
26
     */
27
    protected $encoded_protected_header = null;
28
29
    /**
30
     * @var string|null
31
     */
32
    protected $signature = null;
33
34
    /**
35
     * JWS constructor.
36
     *
37
     * @param string $signature
38
     */
39
    public function __construct($input = null, $signature = null, $encoded_payload = null, $encoded_protected_header = null)
40
    {
41
        parent::__construct($input);
42
        $this->encoded_payload = $encoded_payload;
43
        $this->encoded_protected_header = $encoded_protected_header;
44
        $this->signature = $signature;
45
    }
46
47
    /**
48
     * {@inheritdoc}
49
     */
50
    public function getEncodedPayload()
51
    {
52
        return $this->encoded_payload;
53
    }
54
55
    /**
56
     * {@inheritdoc}
57
     */
58
    public function getEncodedProtectedHeader()
59
    {
60
        return $this->encoded_protected_header;
61
    }
62
63
    /**
64
     * {@inheritdoc}
65
     */
66
    public function getSignature()
67
    {
68
        return $this->signature;
69
    }
70
71
    /*public function __clone()
72
    {
73
        $this->signature = null;
74
        $this->encoded_payload = null;
75
        $this->encoded_protected_header = null;
76
    }*/
77
}
78