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