Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
50.00% |
4 / 8 |
|
80.00% |
4 / 5 |
CRAP | |
0.00% |
0 / 1 |
| ContactInfo | |
50.00% |
4 / 8 |
|
80.00% |
4 / 5 |
8.12 | |
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 / 4 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Widgets\Types; |
| 4 | |
| 5 | use App\Widgets\AbstractWidget; |
| 6 | |
| 7 | class ContactInfo extends AbstractWidget |
| 8 | { |
| 9 | protected string $view = 'widgets.contact-info'; |
| 10 | |
| 11 | public function key(): string |
| 12 | { |
| 13 | return 'contact_info'; |
| 14 | } |
| 15 | |
| 16 | public function label(): string |
| 17 | { |
| 18 | return 'Contact details'; |
| 19 | } |
| 20 | |
| 21 | public function icon(): string |
| 22 | { |
| 23 | return 'fas fa-address-card'; |
| 24 | } |
| 25 | |
| 26 | public function description(): string |
| 27 | { |
| 28 | return 'Phone, email and address pulled from Settings.'; |
| 29 | } |
| 30 | |
| 31 | public function fields(): array |
| 32 | { |
| 33 | return [ |
| 34 | 'title' => ['type' => 'text', 'label' => 'Heading', 'default' => 'Get in touch'], |
| 35 | 'show_address' => ['type' => 'toggle', 'label' => 'Show address', 'default' => true], |
| 36 | ]; |
| 37 | } |
| 38 | } |