Conditions | 7 |
Paths | 7 |
Total Lines | 21 |
Code Lines | 11 |
Lines | 21 |
Ratio | 100 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | View Code Duplication | public static function parse_shortcode($arguments, $content, $parser, $shortcode) |
|
27 | { |
||
28 | if (empty($arguments['id'])) { |
||
29 | return; |
||
30 | } |
||
31 | |||
32 | if (array_key_exists('id', $arguments) && $arguments['id']) { |
||
33 | $explanation = Explanation::get()->byID($arguments['id']); |
||
34 | } |
||
35 | |||
36 | if (!$explanation) { |
||
37 | return; |
||
38 | } |
||
39 | |||
40 | if (array_key_exists('title', $arguments) && $arguments['title']) { |
||
41 | $explanation->Title = $arguments['title']; |
||
42 | } |
||
43 | |||
44 | $template = new SSViewer('ExplanationShortcode'); |
||
45 | return $template->process($explanation); |
||
46 | } |
||
47 | |||
57 |
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.