Passed
Push — master ( 1b6940...c5a534 )
by Dominik
01:45
created

NegotiatedValue   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 38
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getValue() 0 4 1
A getAttributes() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Chubbyphp\ApiHttp\Negotiation;
6
7
final class NegotiatedValue
8
{
9
    /**
10
     * @var string
11
     */
12
    private $value;
13
14
    /**
15
     * @var array
16
     */
17
    private $attributes;
18
19
    /**
20
     * @param string $value
21
     * @param array  $attributes
22
     */
23 2
    public function __construct(string $value, array $attributes = [])
24
    {
25 2
        $this->value = $value;
26 2
        $this->attributes = $attributes;
27 2
    }
28
29
    /**
30
     * @return string
31
     */
32 2
    public function getValue(): string
33
    {
34 2
        return $this->value;
35
    }
36
37
    /**
38
     * @return array
39
     */
40 2
    public function getAttributes(): array
41
    {
42 2
        return $this->attributes;
43
    }
44
}
45