| Conditions | 3 |
| Paths | 3 |
| Total Lines | 24 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php |
||
| 5 | public static function parse_gist($arguments, $caption = null, $parser = null) |
||
| 6 | { |
||
| 7 | // first things first, if we dont have a Gist ID, then we don't need to |
||
| 8 | // go any further |
||
| 9 | if (empty($arguments['id'])) { |
||
| 10 | return; |
||
| 11 | } |
||
| 12 | |||
| 13 | if (!empty($caption)) { |
||
| 14 | $arguments['Caption'] = $caption; |
||
| 15 | } |
||
| 16 | |||
| 17 | $customise = array(); |
||
| 18 | $customise['GistID'] = $arguments['id']; |
||
| 19 | |||
| 20 | //overide the defaults with the arguments supplied |
||
| 21 | $customise = array_merge($customise, $arguments); |
||
| 22 | |||
| 23 | //get our GIST template |
||
| 24 | $template = new SSViewer('GithubGist'); |
||
| 25 | |||
| 26 | //return the customised template |
||
| 27 | return $template->process(new ArrayData($customise)); |
||
| 28 | } |
||
| 29 | } |
||
| 30 |
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.