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