1 | <?php |
||||
2 | |||||
3 | if(!function_exists('JavaScript')){ |
||||
4 | /** |
||||
5 | * @return \Blok\JavaScript\JavaScript |
||||
6 | */ |
||||
7 | function javascript($key = null, $value = null){ |
||||
8 | |||||
9 | /** |
||||
10 | * @var $javascript \Blok\JavaScript\JavaScript |
||||
11 | */ |
||||
12 | $javascript = app('JavaScript'); |
||||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||||
13 | |||||
14 | if ($key && $value) { |
||||
15 | return $javascript->set($key, $value); |
||||
16 | } elseif (is_array($key)) { |
||||
17 | return $javascript->set($key); |
||||
0 ignored issues
–
show
$key of type array is incompatible with the type string expected by parameter $key of Blok\JavaScript\JavaScript::set() .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
18 | } elseif ($key) { |
||||
19 | return $javascript->get($key); |
||||
20 | } |
||||
21 | |||||
22 | return $javascript; |
||||
23 | } |
||||
24 | } |