Completed
Push — master ( aca41d...4ea5a8 )
by Dominik
18s queued 12s
created

getACFLayout()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 42
Code Lines 31

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 31
nc 1
nop 0
dl 0
loc 42
rs 9.424
c 0
b 0
f 0
1
<?php
2
3
namespace Flynt\Components\BlockVideoOembed;
4
5
use Flynt\FieldVariables;
0 ignored issues
show
Bug introduced by
The type Flynt\FieldVariables was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Flynt\Utils\Oembed;
7
8
add_filter('Flynt/addComponentData?name=BlockVideoOembed', function ($data) {
9
    $data['video'] = Oembed::setSrcAsDataAttribute(
10
        $data['oembed'],
11
        [
12
            'autoplay' => 'true'
13
        ]
14
    );
15
16
    return $data;
17
});
18
19
function getACFLayout()
20
{
21
    return [
22
        'name' => 'blockVideoOembed',
23
        'label' => 'Block: Video Oembed',
24
        'sub_fields' => [
25
            [
26
                'label' => 'General',
27
                'name' => 'generalTab',
28
                'type' => 'tab',
29
                'placement' => 'top',
30
                'endpoint' => 0
31
            ],
32
            [
33
                'name' => 'posterImage',
34
                'label' => 'Poster Image',
35
                'type' => 'image',
36
                'preview_size' => 'medium',
37
                'mime_types' => 'jpg,jpeg',
38
                'instructions' => 'Recommended Size: Min-Width 1200px; Min-Height: 675px; Image-Format: JPG, Aspect Ratio 16/9.',
39
                'required' => 1
40
            ],
41
            [
42
                'label' => 'Video',
43
                'name' => 'oembed',
44
                'type' => 'oembed',
45
                'required' => 1
46
            ],
47
            [
48
                'label' => 'Options',
49
                'name' => 'optionsTab',
50
                'type' => 'tab',
51
                'placement' => 'top',
52
                'endpoint' => 0
53
            ],
54
            [
55
                'label' => '',
56
                'name' => 'options',
57
                'type' => 'group',
58
                'layout' => 'row',
59
                'sub_fields' => [
60
                    FieldVariables\getTheme()
0 ignored issues
show
Bug introduced by
The function getTheme was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

60
                    /** @scrutinizer ignore-call */ 
61
                    FieldVariables\getTheme()
Loading history...
61
                ]
62
            ]
63
        ]
64
    ];
65
}
66