| Total Complexity | 5 |
| Total Lines | 47 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 4 | trait ShopItemPresenter |
||
| 5 | { |
||
| 6 | /** |
||
| 7 | * The default banner used when there is no banner for the item. |
||
| 8 | * |
||
| 9 | * @var string |
||
| 10 | */ |
||
| 11 | protected string $defaultIcon = '/images/shop/default_icon.svg'; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * Get the item url. |
||
| 15 | * |
||
| 16 | * @return string |
||
| 17 | */ |
||
| 18 | public function getItemUrlAttribute(): string |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Get the icon. |
||
| 29 | * |
||
| 30 | * @return string |
||
| 31 | */ |
||
| 32 | public function getItemIconAttribute(): string |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Parse a media and return it if isset or return the default banner. |
||
| 39 | * |
||
| 40 | * @param string $type The type of the media to get. |
||
| 41 | * |
||
| 42 | * @return string |
||
| 43 | */ |
||
| 44 | protected function parseMedia(string $type): string |
||
| 53 |