Conditions | 5 |
Paths | 4 |
Total Lines | 18 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 5.675 |
1 | <?php |
||
18 | 3 | public function useTemplateOverride($data = null) |
|
19 | { |
||
20 | 3 | $template = $this->owner->AlternativeTemplate; |
|
21 | 3 | if (isset($template) && $template != '') { |
|
22 | 2 | if ($data) { |
|
23 | return $this->owner->customise(new ArrayData($data)) |
||
24 | ->renderWith(array($this->owner->AlternativeTemplate, $this->owner->ClassName, 'Page')); |
||
25 | } else { |
||
26 | 2 | return $this->owner->renderWith(array($this->owner->AlternativeTemplate, $this->owner->ClassName, 'Page')); |
|
27 | } |
||
28 | } else { |
||
29 | 1 | if ($data) { |
|
30 | return $data; |
||
31 | } else { |
||
32 | 1 | return array(); |
|
33 | } |
||
34 | } |
||
35 | } |
||
36 | } |
||
37 |
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.