Conditions | 5 |
Paths | 12 |
Total Lines | 16 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
11 | function getLink($names) |
||
12 | { |
||
13 | $test = $this->fullList(); |
||
14 | if(! is_array($names)) { |
||
15 | $names = [$names]; |
||
16 | } |
||
17 | $links = []; |
||
18 | foreach($names as $name) { |
||
19 | if(isset($test[$name])) { |
||
20 | $links[$name] = urlencode(str_replace(' ', '+', $name)); |
||
21 | } |
||
22 | } |
||
23 | if(count($links)) { |
||
24 | return '<link href="https://fonts.googleapis.com/css?family='.implode('%7c', $links).'" rel="stylesheet">'; |
||
25 | } |
||
26 | } |
||
27 | |||
867 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.