Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
10 / 10 |
|
100.00% |
5 / 5 |
CRAP | |
100.00% |
1 / 1 |
| Heading | |
100.00% |
10 / 10 |
|
100.00% |
5 / 5 |
5 | |
100.00% |
1 / 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 | |
100.00% |
6 / 6 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Widgets\Types; |
| 4 | |
| 5 | use App\Widgets\AbstractWidget; |
| 6 | |
| 7 | class Heading extends AbstractWidget |
| 8 | { |
| 9 | protected string $view = 'widgets.heading'; |
| 10 | |
| 11 | public function key(): string |
| 12 | { |
| 13 | return 'heading'; |
| 14 | } |
| 15 | |
| 16 | public function label(): string |
| 17 | { |
| 18 | return 'Section heading'; |
| 19 | } |
| 20 | |
| 21 | public function icon(): string |
| 22 | { |
| 23 | return 'fas fa-heading'; |
| 24 | } |
| 25 | |
| 26 | public function description(): string |
| 27 | { |
| 28 | return 'A titled divider between sections.'; |
| 29 | } |
| 30 | |
| 31 | public function fields(): array |
| 32 | { |
| 33 | return [ |
| 34 | 'kicker' => ['type' => 'text', 'label' => 'Small label above', 'default' => ''], |
| 35 | 'title' => ['type' => 'text', 'label' => 'Title', 'default' => 'Section title'], |
| 36 | 'align' => ['type' => 'select', 'label' => 'Alignment', 'default' => 'left', |
| 37 | 'options' => ['left' => 'Left', 'center' => 'Centre']], |
| 38 | ]; |
| 39 | } |
| 40 | } |