Passed
Pull Request — develop (#13)
by Olivier
03:25
created

active_not_path_has()   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 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
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
/** @codeCoverageIgnoreStart */
4
5
if (! function_exists('active_url_is')) {
6
    /**
7
     * Alias os active_path_is for backward compatibility
8
     * @see active_path_is
9
     */
10
    function active_url_is(...$urls)
11
    {
12 1
        return active_path_is(...$urls);
13
    }
14
}
15
16
if (! function_exists('active_url_has')) {
17
    /**
18
    * Alias os active_path_has for backward compatibility
19
    * @see active_path_has
20
    */
21
    function active_url_has(...$paths)
22
    {
23 1
        return active_path_has(...$paths);
24
    }
25
}
26
27
/**@codeCoverageIgnoreEnd */
28
29
if (! function_exists('active_path_is')) {
30
    /**
31
     * @see Arcesilas\ActiveState\Active::ifPathIs()
32
     * @param $paths  Paths to check
0 ignored issues
show
Bug introduced by
The type Paths 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...
33
     * @return string
34
     */
35
    function active_path_is(...$paths)
36
    {
37 1
        return app('active-state')->ifPathIs(...$paths);
0 ignored issues
show
Bug Best Practice introduced by
The expression return app('active-state')->ifPathIs($paths) also could return the type boolean which is incompatible with the documented return type string.
Loading history...
Bug introduced by
The method ifPathIs() does not exist on Arcesilas\ActiveState\Active. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

37
        return app('active-state')->/** @scrutinizer ignore-call */ ifPathIs(...$paths);
Loading history...
38
    }
39
}
40
41
if (! function_exists('active_not_path_is')) {
42
    /**
43
     * @see Arcesilas\ActiveState\Active::ifNotPathIs()
44
     * @param $paths  Paths to check
45
     * @return string
46
     */
47
    function active_not_path_is(...$paths)
48
    {
49 1
        return app('active-state')->ifNotPathIs(...$paths);
0 ignored issues
show
Bug introduced by
The method ifNotPathIs() does not exist on Arcesilas\ActiveState\Active. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

49
        return app('active-state')->/** @scrutinizer ignore-call */ ifNotPathIs(...$paths);
Loading history...
Bug Best Practice introduced by
The expression return app('active-state')->ifNotPathIs($paths) also could return the type boolean which is incompatible with the documented return type string.
Loading history...
50
    }
51
}
52
53
if (! function_exists('active_path_has')) {
54
     /**
55
      * @see Arcesilas\ActiveState\Active::ifPathHas()
56
      * @param  string[]  $paths  Paths to check
57
      * @return string
58
      */
59
    function active_path_has(...$paths)
60
    {
61 1
        return app('active-state')->ifPathHas(...$paths);
0 ignored issues
show
Bug Best Practice introduced by
The expression return app('active-state')->ifPathHas($paths) also could return the type boolean which is incompatible with the documented return type string.
Loading history...
Bug introduced by
The method ifPathHas() does not exist on Arcesilas\ActiveState\Active. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

61
        return app('active-state')->/** @scrutinizer ignore-call */ ifPathHas(...$paths);
Loading history...
62
    }
63
}
64
65
if (! function_exists('active_not_path_has')) {
66
    /**
67
     * @see Arcesilas\ActiveState\Active::ifNotPathHas()
68
     * @param  string[]  $paths  Paths to check
69
     * @return string
70
     */
71
    function active_not_path_has(...$paths)
72
    {
73 1
        return app('active-state')->ifNotPathHas(...$paths);
0 ignored issues
show
Bug introduced by
The method ifNotPathHas() does not exist on Arcesilas\ActiveState\Active. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

73
        return app('active-state')->/** @scrutinizer ignore-call */ ifNotPathHas(...$paths);
Loading history...
Bug Best Practice introduced by
The expression return app('active-state')->ifNotPathHas($paths) also could return the type boolean which is incompatible with the documented return type string.
Loading history...
74
    }
75
}
76
77
if (! function_exists('active_route_is')) {
78
    /**
79
     * @see Arcesilas\ActiveState\Active::ifRouteIs()
80
     * @param string $route  The route name
81
     * @param array $parameters The route parameters used to build the url
82
     * @return string
83
     */
84
    function active_route_is($route, $parameters = [])
85
    {
86 1
        return app('active-state')->ifRouteIs($route, $parameters);
0 ignored issues
show
Bug introduced by
The method ifRouteIs() does not exist on Arcesilas\ActiveState\Active. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

86
        return app('active-state')->/** @scrutinizer ignore-call */ ifRouteIs($route, $parameters);
Loading history...
Bug Best Practice introduced by
The expression return app('active-state...Is($route, $parameters) also could return the type boolean which is incompatible with the documented return type string.
Loading history...
87
    }
88
}
89
90
if (! function_exists('active_not_route_is')) {
91
    /**
92
     * @see Arcesilas\ActiveState\Active::ifNotRouteIs()
93
     * @param string $route  The route name
94
     * @param array $parameters The route parameters used to build the url
95
     * @return string
96
     */
97
    function active_not_route_is($route, $parameters = [])
98
    {
99 1
        return app('active-state')->ifNotRouteIs($route, $parameters);
0 ignored issues
show
Bug Best Practice introduced by
The expression return app('active-state...Is($route, $parameters) also could return the type boolean which is incompatible with the documented return type string.
Loading history...
Bug introduced by
The method ifNotRouteIs() does not exist on Arcesilas\ActiveState\Active. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

99
        return app('active-state')->/** @scrutinizer ignore-call */ ifNotRouteIs($route, $parameters);
Loading history...
100
    }
101
}
102
103
if (! function_exists('active_route_in')) {
104
    /**
105
     * @see Arcesilas\ActiveState\Active::ifRouteIn()
106
     * @return string
107
     */
108
    function active_route_in(...$routes)
109
    {
110 1
        return app('active-state')->ifRouteIn(...$routes);
0 ignored issues
show
Bug Best Practice introduced by
The expression return app('active-state')->ifRouteIn($routes) also could return the type boolean which is incompatible with the documented return type string.
Loading history...
Bug introduced by
The method ifRouteIn() does not exist on Arcesilas\ActiveState\Active. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

110
        return app('active-state')->/** @scrutinizer ignore-call */ ifRouteIn(...$routes);
Loading history...
111
    }
112
}
113
114
if (! function_exists('active_not_route_in')) {
115
    /**
116
     * @see Arcesilas\ActiveState\Active::ifNotRouteIn()
117
     * @return string
118
     */
119
    function active_not_route_in(...$routes)
120
    {
121 1
        return app('active-state')->ifNotRouteIn(...$routes);
0 ignored issues
show
Bug Best Practice introduced by
The expression return app('active-state')->ifNotRouteIn($routes) also could return the type boolean which is incompatible with the documented return type string.
Loading history...
Bug introduced by
The method ifNotRouteIn() does not exist on Arcesilas\ActiveState\Active. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

121
        return app('active-state')->/** @scrutinizer ignore-call */ ifNotRouteIn(...$routes);
Loading history...
122
    }
123
}
124
125
if (! function_exists('active_query_is')) {
126
    /**
127
     * @see Arcesilas\ActiveState\Active::ifQueryIs()
128
     * @param array $parameters  The parameters to check iin the query string
129
     * @return string
130
     */
131
    function active_query_is(array ...$parameters)
132
    {
133 1
        return app('active-state')->ifQueryIs(...$parameters);
0 ignored issues
show
Bug Best Practice introduced by
The expression return app('active-state...>ifQueryIs($parameters) also could return the type boolean which is incompatible with the documented return type string.
Loading history...
Bug introduced by
The method ifQueryIs() does not exist on Arcesilas\ActiveState\Active. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

133
        return app('active-state')->/** @scrutinizer ignore-call */ ifQueryIs(...$parameters);
Loading history...
134
    }
135
}
136
137
if (! function_exists('active_not_query_is')) {
138
    /**
139
     * @see Arcesilas\ActiveState\Active::ifNotQueryIs()
140
     * @param array $parameters  The parameters to check iin the query string
141
     * @return string
142
     */
143
    function active_not_query_is(array ...$parameters)
144
    {
145 1
        return app('active-state')->ifNotQueryIs(...$parameters);
0 ignored issues
show
Bug introduced by
The method ifNotQueryIs() does not exist on Arcesilas\ActiveState\Active. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

145
        return app('active-state')->/** @scrutinizer ignore-call */ ifNotQueryIs(...$parameters);
Loading history...
Bug Best Practice introduced by
The expression return app('active-state...NotQueryIs($parameters) also could return the type boolean which is incompatible with the documented return type string.
Loading history...
146
    }
147
}
148
149
if (! function_exists('active_query_has')) {
150
    /**
151
     * @see Arcesilas\ActiveState\Active::ifQueryHas()
152
     * @param array $parameters  The parameters to check iin the query string
153
     * @return string
154
     */
155
    function active_query_has(...$parameters)
156
    {
157 1
        return app('active-state')->ifQueryHas(...$parameters);
0 ignored issues
show
Bug Best Practice introduced by
The expression return app('active-state...ifQueryHas($parameters) also could return the type boolean which is incompatible with the documented return type string.
Loading history...
Bug introduced by
The method ifQueryHas() does not exist on Arcesilas\ActiveState\Active. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

157
        return app('active-state')->/** @scrutinizer ignore-call */ ifQueryHas(...$parameters);
Loading history...
158
    }
159
}
160
161
if (! function_exists('active_not_query_has')) {
162
    /**
163
     * @see Arcesilas\ActiveState\Active::ifNotQueryHas()
164
     * @param array $parameters  The parameters to check iin the query string
165
     * @return string
166
     */
167
    function active_not_query_has(...$parameters)
168
    {
169 1
        return app('active-state')->ifNotQueryHas(...$parameters);
0 ignored issues
show
Bug introduced by
The method ifNotQueryHas() does not exist on Arcesilas\ActiveState\Active. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

169
        return app('active-state')->/** @scrutinizer ignore-call */ ifNotQueryHas(...$parameters);
Loading history...
Bug Best Practice introduced by
The expression return app('active-state...otQueryHas($parameters) also could return the type boolean which is incompatible with the documented return type string.
Loading history...
170
    }
171
}
172
173
if (! function_exists('active_query_has_only')) {
174
    /**
175
     * @see Arcesilas\ActiveState\Active::ifQueryHasOnly()
176
     * @param  string[]  $parameters
177
     * @return string
178
     */
179
    function active_query_has_only(...$parameters)
180
    {
181 1
        return app('active-state')->ifQueryHasOnly(...$parameters);
0 ignored issues
show
Bug Best Practice introduced by
The expression return app('active-state...eryHasOnly($parameters) also could return the type boolean which is incompatible with the documented return type string.
Loading history...
Bug introduced by
The method ifQueryHasOnly() does not exist on Arcesilas\ActiveState\Active. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

181
        return app('active-state')->/** @scrutinizer ignore-call */ ifQueryHasOnly(...$parameters);
Loading history...
182
    }
183
}
184
185
if (! function_exists('active_not_query_has_only')) {
186
    /**
187
     * @see Arcesilas\ActiveState\Active::ifNotQueryHasOnly()
188
     * @param  string[]  $parameters
189
     * @return string
190
     */
191
    function active_not_query_has_only(...$parameters)
192
    {
193 1
        return app('active-state')->ifNotQueryHasOnly(...$parameters);
0 ignored issues
show
Bug Best Practice introduced by
The expression return app('active-state...eryHasOnly($parameters) also could return the type boolean which is incompatible with the documented return type string.
Loading history...
Bug introduced by
The method ifNotQueryHasOnly() does not exist on Arcesilas\ActiveState\Active. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

193
        return app('active-state')->/** @scrutinizer ignore-call */ ifNotQueryHasOnly(...$parameters);
Loading history...
194
    }
195
}
196
197
if (! function_exists('active_query_contains')) {
198
    /**
199
     * @see Arcesilas\ActiveState\Active::ifQueryContains()
200
     * @param  string  $parameters
201
     * @return string
202
     */
203
    function active_query_contains($parameters)
204
    {
205 1
        return app('active-state')->ifQueryContains($parameters);
0 ignored issues
show
Bug Best Practice introduced by
The expression return app('active-state...ryContains($parameters) also could return the type boolean which is incompatible with the documented return type string.
Loading history...
Bug introduced by
The method ifQueryContains() does not exist on Arcesilas\ActiveState\Active. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

205
        return app('active-state')->/** @scrutinizer ignore-call */ ifQueryContains($parameters);
Loading history...
206
    }
207
}
208
209
if (! function_exists('active_not_query_contains')) {
210
    /**
211
     * @see Arcesilas\ActiveState\Active::ifNotQueryContains()
212
     * @param  string  $parameters
213
     * @return string
214
     */
215
    function active_not_query_contains($parameters)
216
    {
217 1
        return app('active-state')->ifNotQueryContains($parameters);
0 ignored issues
show
Bug introduced by
The method ifNotQueryContains() does not exist on Arcesilas\ActiveState\Active. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

217
        return app('active-state')->/** @scrutinizer ignore-call */ ifNotQueryContains($parameters);
Loading history...
Bug Best Practice introduced by
The expression return app('active-state...ryContains($parameters) also could return the type boolean which is incompatible with the documented return type string.
Loading history...
218
    }
219
}
220