Issues (76)

Components/BlockCookieNotice/functions.php (2 issues)

Labels
Severity
1
<?php
2
3
namespace Flynt\Components\BlockCookieNotice;
4
5
use Flynt\Utils\Options;
6
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...
7
use Timber\Timber;
8
9
add_action('wp_footer', function () {
10
    $context = Timber::get_context();
11
    Timber::render_string('{{ renderComponent("BlockCookieNotice") }}', $context);
12
});
13
14
Options::addGlobal('BlockCookieNotice', [
15
    [
16
        'label' => __('Component Status', 'flynt'),
17
        'name' => 'cookieNoticeIsEnabled',
18
        'type' => 'true_false',
19
        'default_value' => 1,
20
        'ui' => 1,
21
        'ui_on_text' => __('Activated', 'flynt'),
22
        'ui_off_text' => __('Deactivated', 'flynt'),
23
    ],
24
    [
25
        'label' => __('Layout', 'flynt'),
26
        'name' => 'layout',
27
        'type' => 'select',
28
        'allow_null' => 0,
29
        'multiple' => 0,
30
        'ui' => 0,
31
        'ajax' => 0,
32
        'wrapper' => [
33
            'width' => 50
34
        ],
35
        'default_value' => 'layoutFloating',
36
        'choices' => [
37
            'layoutFloating' => __('Floating', 'flynt'),
38
            'layoutBottom' => __('Bottom', 'flynt'),
39
        ]
40
    ],
41
    array_merge(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

41
    array_merge(/** @scrutinizer ignore-call */ FieldVariables\getTheme(), [
Loading history...
42
        'wrapper' => [
43
            'width' => 50
44
        ]
45
    ])
46
]);
47
48
Options::addTranslatable('BlockCookieNotice', [
49
    [
50
        'label' => __('General', 'flynt'),
51
        'name' => 'general',
52
        'type' => 'tab',
53
        'placement' => 'top',
54
        'endpoint' => 0,
55
    ],
56
    [
57
        'label' => __('Content', 'flynt'),
58
        'name' => 'contentHtml',
59
        'type' => 'wysiwyg',
60
        'tabs' => 'visual,text',
61
        'default_value' => '<h4>This website uses cookies</h4><p>We inform you that this site uses own, technical and third parties cookies to make sure our web page is user-friendly and to guarantee a high functionality of the webpage. By continuing to browse this website, you declare to accept the use of cookies.</p>',
62
        'media_upload' => 0,
63
        'delay' => 1,
64
        'required' => 1,
65
    ],
66
    [
67
        'label' => __('Close Button Label', 'flynt'),
68
        'name' => 'closeButtonLabel',
69
        'type' => 'text',
70
        'default_value' => 'Ok',
71
        'required' => 1,
72
    ],
73
]);
74