Passed
Push — master ( 443842...86f0b2 )
by Joshua
05:55 queued 01:59
created

Asset::getTitle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace SeamsCMS\Delivery\Model;
5
6
class Asset
7
{
8
    use HydratorTrait {
9
        fromArray as private fromArrayTrait;
10
    }
11
12
    /** @var string */
13
    private $link;
14
    /** @var string|null */
15
    private $thumbnailLink;
16
    /** @var int */
17
    private $size;
18
    /** @var string */
19
    private $path;
20
    /** @var string */
21
    private $title;
22
    /** @var string */
23
    private $mimetype;
24
    /** @var string */
25
    private $workspace;
26
    /** @var AssetMeta */
27
    private $meta;
28
29
    /**
30
     * @return string
31
     */
32
    public function getLink(): string
33
    {
34
        return $this->link;
35
    }
36
37
    /**
38
     * @return string|null
39
     */
40
    public function getThumbnailLink()
41
    {
42
        return $this->thumbnailLink;
43
    }
44
45
    /**
46
     * @return int
47
     */
48
    public function getSize(): int
49
    {
50
        return $this->size;
51
    }
52
53
    /**
54
     * @return string
55
     */
56 2
    public function getPath(): string
57
    {
58 2
        return $this->path;
59
    }
60
61
    /**
62
     * @return string
63
     */
64
    public function getTitle(): string
65
    {
66
        return $this->title;
67
    }
68
69
    /**
70
     * @return string
71
     */
72
    public function getMimetype(): string
73
    {
74
        return $this->mimetype;
75
    }
76
77
    /**
78
     * @return string
79
     */
80 2
    public function getWorkspace(): string
81
    {
82 2
        return $this->workspace;
83
    }
84
85
    /**
86
     * @return AssetMeta
87
     */
88
    public function getMeta(): AssetMeta
89
    {
90
        return $this->meta;
91
    }
92
93 2
    public static function fromArray(array $data)
94
    {
95 2
        $meta = AssetMeta::fromArray($data['meta']);
96 2
        $data = $data['asset'];
97 2
        $data['meta'] = $meta;
98
99 2
        return self::fromArrayTrait($data);
100
    }
101
}
102