Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
66.67% |
2 / 3 |
|
66.67% |
2 / 3 |
CRAP | |
0.00% |
0 / 1 |
| VideoBlock | |
66.67% |
2 / 3 |
|
66.67% |
2 / 3 |
4.59 | |
0.00% |
0 / 1 |
| label | n/a |
0 / 0 |
n/a |
0 / 0 |
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 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | namespace App\Widgets\Types; |
| 3 | use App\Widgets\AbstractWidget; |
| 4 | class VideoBlock extends AbstractWidget { |
| 5 | protected string $view='widgets.video-block'; |
| 6 | public function label():string{return 'Video';} public function icon():string{return 'fas fa-play-circle';} |
| 7 | public function description():string{return 'YouTube, Vimeo or direct video with a heading.';} |
| 8 | public function fields():array{return ['title'=>['type'=>'text','label'=>'Heading','default'=>''],'url'=>['type'=>'url','label'=>'Video URL','default'=>''],'poster'=>['type'=>'media','label'=>'Cover image','default'=>''],'autoplay'=>['type'=>'toggle','label'=>'Autoplay (muted)','default'=>false]];} |
| 9 | } |