Test Failed
Push — fix/media-validation ( 3351fe )
by Ben
09:34
created

MediaRequestInput   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
eloc 13
c 1
b 0
f 0
dl 0
loc 39
rs 10

5 Methods

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