JWSBuiltFailureEvent   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 1
dl 0
loc 60
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A getPayload() 0 4 1
A isPayloadDetached() 0 4 1
A getSignatures() 0 4 1
A getisPayloadEncoded() 0 4 1
A getThrowable() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * The MIT License (MIT)
7
 *
8
 * Copyright (c) 2014-2019 Spomky-Labs
9
 *
10
 * This software may be modified and distributed under the terms
11
 * of the MIT license.  See the LICENSE file for details.
12
 */
13
14
namespace Jose\Bundle\JoseFramework\Event;
15
16
use Symfony\Contracts\EventDispatcher\Event;
17
use Throwable;
18
19
final class JWSBuiltFailureEvent extends Event
20
{
21
    /**
22
     * @var null|string
23
     */
24
    protected $payload;
25
26
    /**
27
     * @var bool
28
     */
29
    protected $isPayloadDetached;
30
31
    /**
32
     * @var array
33
     */
34
    protected $signatures = [];
35
36
    /**
37
     * @var null|bool
38
     */
39
    protected $isPayloadEncoded;
40
    /**
41
     * @var Throwable
42
     */
43
    private $throwable;
44
45
    public function __construct(?string $payload, array $signatures, bool $isPayloadDetached, ?bool $isPayloadEncoded, Throwable $throwable)
46
    {
47
        $this->throwable = $throwable;
48
        $this->payload = $payload;
49
        $this->signatures = $signatures;
50
        $this->isPayloadDetached = $isPayloadDetached;
51
        $this->isPayloadEncoded = $isPayloadEncoded;
52
    }
53
54
    public function getPayload(): ?string
55
    {
56
        return $this->payload;
57
    }
58
59
    public function isPayloadDetached(): bool
60
    {
61
        return $this->isPayloadDetached;
62
    }
63
64
    public function getSignatures(): array
65
    {
66
        return $this->signatures;
67
    }
68
69
    public function getisPayloadEncoded(): ?bool
70
    {
71
        return $this->isPayloadEncoded;
72
    }
73
74
    public function getThrowable(): Throwable
75
    {
76
        return $this->throwable;
77
    }
78
}
79