Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
40.00% |
4 / 10 |
|
80.00% |
4 / 5 |
CRAP | |
0.00% |
0 / 1 |
| ImageBanner | |
40.00% |
4 / 10 |
|
80.00% |
4 / 5 |
10.40 | |
0.00% |
0 / 1 |
| key | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| label | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| icon | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| description | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| fields | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Widgets\Types; |
| 4 | |
| 5 | use App\Widgets\AbstractWidget; |
| 6 | |
| 7 | class ImageBanner extends AbstractWidget |
| 8 | { |
| 9 | protected string $view = 'widgets.image-banner'; |
| 10 | |
| 11 | public function key(): string |
| 12 | { |
| 13 | return 'image_banner'; |
| 14 | } |
| 15 | |
| 16 | public function label(): string |
| 17 | { |
| 18 | return 'Image banner'; |
| 19 | } |
| 20 | |
| 21 | public function icon(): string |
| 22 | { |
| 23 | return 'fas fa-image'; |
| 24 | } |
| 25 | |
| 26 | public function description(): string |
| 27 | { |
| 28 | return 'A full-width image that links somewhere.'; |
| 29 | } |
| 30 | |
| 31 | public function fields(): array |
| 32 | { |
| 33 | return [ |
| 34 | 'image' => ['type' => 'media', 'label' => 'Image', 'default' => ''], |
| 35 | 'alt' => ['type' => 'text', 'label' => 'Alt text', 'default' => ''], |
| 36 | 'link' => ['type' => 'text', 'label' => 'Links to (URL)', 'default' => ''], |
| 37 | 'caption' => ['type' => 'text', 'label' => 'Caption on image', 'default' => ''], |
| 38 | ]; |
| 39 | } |
| 40 | } |