Issues (76)

Components/SliderImages/functions.php (3 issues)

1
<?php
2
3
namespace Flynt\Components\SliderImages;
4
5
use Flynt\FieldVariables;
0 ignored issues
show
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\Options;
7
8
add_filter('Flynt/addComponentData?name=SliderImages', function ($data) {
9
    $translatableOptions = Options::getTranslatable('SliderOptions');
10
    $data['jsonData'] = [
11
        'options' => array_merge($translatableOptions, $data['options']),
0 ignored issues
show
It seems like $translatableOptions can also be of type false; however, parameter $arrays of array_merge() does only seem to accept array, maybe add an additional type check? ( Ignorable by Annotation )

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

11
        'options' => array_merge(/** @scrutinizer ignore-type */ $translatableOptions, $data['options']),
Loading history...
12
    ];
13
    return $data;
14
});
15
16
function getACFLayout()
17
{
18
    return [
19
        'name' => 'sliderImages',
20
        'label' => 'Slider: Images',
21
        'sub_fields' => [
22
            [
23
                'label' => __('General', 'flynt'),
24
                'name' => 'generalTab',
25
                'type' => 'tab',
26
                'placement' => 'top',
27
                'endpoint' => 0
28
            ],
29
            [
30
                'label' => __('Title', 'flynt'),
31
                'name' => 'preContentHtml',
32
                'type' => 'wysiwyg',
33
                'instructions' => __('Want to add a headline? And a paragraph? Go ahead! Or just leave it empty and nothing will be shown.', 'flynt'),
34
                'media_upload' => 0,
35
            ],
36
            [
37
                'label' => __('Images', 'flynt'),
38
                'name' => 'images',
39
                'type' => 'gallery',
40
                'min' => 2,
41
                'preview_size' => 'medium',
42
                'mime_types' => 'jpg,jpeg,png',
43
                'instructions' => __('Image-Format: JPG, PNG.', 'flynt'),
44
                'required' => 1
45
            ],
46
            [
47
                'label' => __('Options', 'flynt'),
48
                'name' => 'optionsTab',
49
                'type' => 'tab',
50
                'placement' => 'top',
51
                'endpoint' => 0
52
            ],
53
            [
54
                'label' => '',
55
                'name' => 'options',
56
                'type' => 'group',
57
                'layout' => 'row',
58
                'sub_fields' => [
59
                    [
60
                        'label' => __('Enable Autoplay', 'flynt'),
61
                        'name' => 'autoplay',
62
                        'type' => 'true_false',
63
                        'default_value' => 0,
64
                        'ui' => 1
65
                    ],
66
                    [
67
                        'label' => __('Autoplay Speed (in milliseconds)', 'flynt'),
68
                        'name' => 'autoplaySpeed',
69
                        'type' => 'number',
70
                        'min' => 2000,
71
                        'step' => 1,
72
                        'default_value' => 4000,
73
                        'required' => 1,
74
                        'conditional_logic' => [
75
                            [
76
                                [
77
                                    'fieldPath' => 'autoplay',
78
                                    'operator' => '==',
79
                                    'value' => 1
80
                                ]
81
                            ]
82
                        ],
83
                    ],
84
                    FieldVariables\getTheme()
0 ignored issues
show
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

84
                    /** @scrutinizer ignore-call */ 
85
                    FieldVariables\getTheme()
Loading history...
85
                ]
86
            ]
87
        ]
88
    ];
89
}
90