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

JWS   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getEncodedPayload() 0 4 1
A getEncodedProtectedHeader() 0 4 1
A getSignature() 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\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