InvalidHeaderException   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 41
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getHeader() 0 4 1
A getValue() 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\Component\Checker;
15
16
use Exception;
17
18
/**
19
 * This exception is thrown by header parameter checkers when a header parameter check failed.
20
 */
21
class InvalidHeaderException extends Exception
22
{
23
    /**
24
     * @var string
25
     */
26
    private $header;
27
28
    /**
29
     * @var mixed
30
     */
31
    private $value;
32
33
    /**
34
     * @param mixed $value
35
     */
36
    public function __construct(string $message, string $header, $value)
37
    {
38
        parent::__construct($message);
39
40
        $this->header = $header;
41
        $this->value = $value;
42
    }
43
44
    /**
45
     * Returns the header parameter that caused the exception.
46
     */
47
    public function getHeader(): string
48
    {
49
        return $this->header;
50
    }
51
52
    /**
53
     * Returns the header parameter value that caused the exception.
54
     *
55
     * @return mixed
56
     */
57
    public function getValue()
58
    {
59
        return $this->value;
60
    }
61
}
62