Passed
Push — develop ( 7318c1...2865ed )
by Olivier
05:49
created

active_query_is()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 1
cts 1
cp 1
crap 1
rs 10
1
<?php
2
3
if (! function_exists('active_url_is')) {
4
    /**
5
     * @see Arcesilas\ActiveState\Active::ifUrlIs()
6
     * @param $urls  Url to check
7
     * @return string
8
     */
9
    function active_url_is(...$urls)
10
    {
11 1
        return app('active-state')->ifUrlIs(...$urls);
12
    }
13
}
14
15
if (! function_exists('active_url_has')) {
16
     /**
17
      * @see Arcesilas\ActiveState\Active::ifUrlHas()
18
      * @param  string[]  $urls
19
      * @return string
20
      */
21
    function active_url_has(...$urls)
22
    {
23 1
        return app('active-state')->ifUrlHas(...$urls);
24
    }
25
}
26
27
if (! function_exists('active_route_is')) {
28
    /**
29
     * @see Arcesilas\ActiveState\Active::ifRouteIs()
30
     * @param string $route  The route name
31
     * @param array $parameters The route parameters used to build the url
32
     * @return string
33
     */
34
    function active_route_is($route, $parameters = [])
35
    {
36 1
        return app('active-state')->ifRouteIs($route, $parameters);
37
    }
38
}
39
40
if (! function_exists('active_route_in')) {
41
    /**
42
     * @see Arcesilas\ActiveState\Active::ifRouteIn()
43
     * @return string
44
     */
45
    function active_route_in(...$routes)
46
    {
47 1
        return app('active-state')->ifRouteIn(...$routes);
48
    }
49
}
50
51
if (! function_exists('active_query_is')) {
52
    /**
53
     * @see Arcesilas\ActiveState\Active::ifQueryIs()
54
     * @param array $parameters  The parameters to check iin the query string
55
     * @return string
56
     */
57
    function active_query_is(array ...$parameters)
58
    {
59 1
        return app('active-state')->ifQueryIs(...$parameters);
60
    }
61
}
62
63
if (! function_exists('active_query_has')) {
64
    /**
65
     * @see Arcesilas\ActiveState\Active::ifQueryHas()
66
     * @param array $parameters  The parameters to check iin the query string
67
     * @return string
68
     */
69
    function active_query_has(...$parameters)
70
    {
71 1
        return app('active-state')->ifQueryHas(...$parameters);
72
    }
73
}
74
75
if (! function_exists('active_query_has_only')) {
76
    /**
77
     * @see Arcesilas\ActiveState\Active::ifQueryHasOnly()
78
     * @param  string[]  $parameters
79
     * @return string
80
     */
81
    function active_query_has_only(...$parameters)
82
    {
83 1
        return app('active-state')->ifQueryHasOnly(...$parameters);
84
    }
85
}
86
87
if (! function_exists('active_query_contains')) {
88
    /**
89
     * @see Arcesilas\ActiveState\Active::ifQueryContains()
90
     * @param  string  $parameters
91
     * @return string
92
     */
93
    function active_query_contains($parameters)
94
    {
95 1
        return app('active-state')->ifQueryContains($parameters);
96
    }
97
}
98