| Total Complexity | 4 |
| Total Lines | 69 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class Callout extends Component |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * The callout icon (a Font Awesome icon). |
||
| 12 | * |
||
| 13 | * @var string |
||
| 14 | */ |
||
| 15 | public $icon; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * The callout theme (info, success, warning or danger). |
||
| 19 | * |
||
| 20 | * @var string |
||
| 21 | */ |
||
| 22 | public $theme; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * The callout title. |
||
| 26 | * |
||
| 27 | * @var string |
||
| 28 | */ |
||
| 29 | public $title; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Extra classes for the title container. This provides a way to customize |
||
| 33 | * the title style. |
||
| 34 | * |
||
| 35 | * @var string |
||
| 36 | */ |
||
| 37 | public $titleClass; |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Create a new component instance. |
||
| 41 | * |
||
| 42 | * @return void |
||
| 43 | */ |
||
| 44 | 2 | public function __construct( |
|
| 45 | $theme = null, $icon = null, $title = null, $titleClass = null |
||
| 46 | ) { |
||
| 47 | 2 | $this->theme = $theme; |
|
| 48 | 2 | $this->icon = $icon; |
|
| 49 | 2 | $this->title = UtilsHelper::applyHtmlEntityDecoder($title); |
|
| 50 | 2 | $this->titleClass = $titleClass; |
|
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * Make the class attribute for the callout item. |
||
| 55 | * |
||
| 56 | * @return string |
||
| 57 | */ |
||
| 58 | 1 | public function makeCalloutClass() |
|
| 59 | { |
||
| 60 | 1 | $classes = ['callout']; |
|
| 61 | |||
| 62 | 1 | if (! empty($this->theme)) { |
|
| 63 | 1 | $classes[] = "callout-{$this->theme}"; |
|
| 64 | } |
||
| 65 | |||
| 66 | 1 | return implode(' ', $classes); |
|
| 67 | } |
||
| 68 | |||
| 69 | /** |
||
| 70 | * Get the view / contents that represent the component. |
||
| 71 | * |
||
| 72 | * @return \Illuminate\View\View|string |
||
| 73 | */ |
||
| 74 | 1 | public function render() |
|
| 77 | } |
||
| 78 | } |
||
| 79 |