Passed
Push — master ( 2f2795...71165f )
by Iman
06:01
created

helpers.php ➔ json_widget()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
if (! function_exists('render_widget')) {
4
    function render_widget($widget, ...$args)
5
    {
6
        return app(\Imanghafoori\Widgets\Utils\WidgetRenderer::class)->renderWidget($widget, ...$args);
7
    }
8
}
9
10
if (! function_exists('expire_widgets')) {
11
    function expire_widgets($tags)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
12
    {
13
        return app(\Imanghafoori\Widgets\Utils\Cache::class)->expireTaggedWidgets($tags);
14
    }
15
}
16
17
if (! function_exists('json_widget')) {
18
    function json_widget($widget, ...$args)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
19
    {
20
        return app(\Imanghafoori\Widgets\Utils\WidgetJsonifier::class)->jsonResponse($widget, ...$args);
21
    }
22
}
23