| Conditions | 6 |
| Paths | 2 |
| Total Lines | 23 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 16 |
| CRAP Score | 6 |
| 1 | <?php |
||
| 32 | 1 | private function makeList($pages) |
|
| 33 | { |
||
| 34 | 1 | $output = ''; |
|
| 35 | 1 | if (count($pages)) { |
|
| 36 | $output = ' |
||
| 37 | 1 | <ul class="sitemap-list">'; |
|
| 38 | 1 | foreach ($pages as $page) { |
|
| 39 | 1 | if (!($page instanceof ErrorPage) && $page->ShowInMenus && $page->Title != $this->Title) { |
|
| 40 | $output .= ' |
||
| 41 | 1 | <li><a href="'.$page->URLSegment.'" title="Go to the '.Convert::raw2xml($page->Title).' page">'.Convert::raw2xml($page->MenuTitle).'</a>'; |
|
| 42 | 1 | $whereStatement = 'ParentID = '.$page->ID; |
|
| 43 | //$childPages = new DataObjectSet(); |
||
| 44 | 1 | $childPages = DataObject::get('Page', $whereStatement); |
|
| 45 | 1 | $output .= $this->makeList($childPages); |
|
| 46 | $output .= ' |
||
| 47 | 1 | </li>'; |
|
| 48 | 1 | } |
|
| 49 | 1 | } |
|
| 50 | $output .= ' |
||
| 51 | 1 | </ul>'; |
|
| 52 | 1 | } |
|
| 53 | 1 | return $output; |
|
| 54 | } |
||
| 55 | } |
||
| 56 |
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.