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

MediaRequestInput::value()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
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