Total Complexity | 12 |
Total Lines | 109 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
20 | class Asset |
||
21 | { |
||
22 | use HydratorTrait { |
||
23 | fromArray as private fromArrayTrait; |
||
24 | } |
||
25 | |||
26 | /** @var string */ |
||
27 | private $link; |
||
28 | /** @var string|null */ |
||
29 | private $thumbnailLink; |
||
30 | /** @var int */ |
||
31 | private $size; |
||
32 | /** @var string */ |
||
33 | private $path; |
||
34 | /** @var string */ |
||
35 | private $title; |
||
36 | /** @var string */ |
||
37 | private $mimetype; |
||
38 | /** @var string */ |
||
39 | private $workspace; |
||
40 | /** @var AssetMeta */ |
||
41 | private $meta; |
||
42 | |||
43 | /** |
||
44 | * Asset constructor. |
||
45 | * |
||
46 | */ |
||
47 | 5 | protected function __construct() { |
|
48 | 5 | } |
|
49 | |||
50 | /** |
||
51 | * @return string |
||
52 | */ |
||
53 | 1 | public function getLink(): string |
|
54 | { |
||
55 | 1 | return $this->link; |
|
56 | } |
||
57 | |||
58 | /** |
||
59 | * @return string|null |
||
60 | */ |
||
61 | 1 | public function getThumbnailLink() |
|
62 | { |
||
63 | 1 | return $this->thumbnailLink; |
|
64 | } |
||
65 | |||
66 | /** |
||
67 | * @return int |
||
68 | */ |
||
69 | 1 | public function getSize(): int |
|
72 | } |
||
73 | |||
74 | /** |
||
75 | * @return string |
||
76 | */ |
||
77 | 5 | public function getPath(): string |
|
78 | { |
||
79 | 5 | return $this->path; |
|
80 | } |
||
81 | |||
82 | /** |
||
83 | * @return string |
||
84 | */ |
||
85 | 1 | public function getTitle(): string |
|
86 | { |
||
87 | 1 | return $this->title; |
|
88 | } |
||
89 | |||
90 | /** |
||
91 | * @return string |
||
92 | */ |
||
93 | 1 | public function getMimetype(): string |
|
96 | } |
||
97 | |||
98 | /** |
||
99 | * @return string |
||
100 | */ |
||
101 | 5 | public function getWorkspace(): string |
|
104 | } |
||
105 | |||
106 | /** |
||
107 | * @return AssetMeta |
||
108 | */ |
||
109 | 1 | public function getMeta(): AssetMeta |
|
112 | } |
||
113 | |||
114 | /** |
||
115 | * @param array $data |
||
116 | * @return Asset |
||
117 | */ |
||
118 | 8 | public static function fromArray(array $data) |
|
131 |