Total Complexity | 4 |
Total Lines | 48 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | class Image |
||
8 | { |
||
9 | /** @var string */ |
||
10 | protected $name; |
||
11 | |||
12 | /** @var string|null */ |
||
13 | protected $localPath; |
||
14 | |||
15 | /** |
||
16 | * Image constructor. |
||
17 | * |
||
18 | * @param $name |
||
19 | * @param string|null $localPath |
||
20 | */ |
||
21 | 34 | public function __construct($name, $localPath = null) |
|
22 | { |
||
23 | 34 | $this->name = $name; |
|
24 | 34 | $this->localPath = $localPath; |
|
25 | } |
||
26 | |||
27 | /** |
||
28 | * Return the name for this image. |
||
29 | * |
||
30 | * @return string |
||
31 | */ |
||
32 | 27 | public function getName() |
|
33 | { |
||
34 | 27 | return $this->name; |
|
35 | } |
||
36 | |||
37 | /** |
||
38 | * Return the un-versioned name for this image. |
||
39 | * |
||
40 | * @return string |
||
41 | */ |
||
42 | 5 | public function getUnVersionedName() |
|
43 | { |
||
44 | 5 | return Str::before($this->name, ':'); |
|
45 | } |
||
46 | |||
47 | /** |
||
48 | * Return the local path for the image, if it is local. |
||
49 | * |
||
50 | * @return string|null |
||
51 | */ |
||
52 | 7 | public function getLocalPath() |
|
55 | } |
||
56 | } |
||
57 |