Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
9 | public static function handle($parameter) |
||
10 | { |
||
11 | $parameter = str_replace(['"', "'"], null, $parameter); |
||
12 | $array = explode(',', $parameter); |
||
13 | $url = trim($array[0]); |
||
14 | $defer = trim(@$array[1]) ?? null; |
||
15 | |||
16 | if ($defer) { |
||
17 | return "<script src='{$url}' defer></script>"; |
||
18 | } |
||
19 | |||
20 | return "<script src='{$url}'></script>"; |
||
21 | } |
||
22 | } |