| Total Complexity | 3 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | class AtoZView extends BaseView { |
||
| 6 | public function display(): array { |
||
| 7 | $data = [ |
||
| 8 | 'template_name' => 'atoz', |
||
| 9 | 'this_page' => 'glossary', |
||
| 10 | ]; |
||
| 11 | |||
| 12 | |||
| 13 | $az = filter_input(INPUT_GET, 'az', FILTER_VALIDATE_REGEXP, ['options' => ['default' => 'A', 'regexp' => '#^[A-Z]$#']]); |
||
| 14 | |||
| 15 | $data['letter'] = $az; |
||
| 16 | |||
| 17 | if ($this->has_edit_access()) { |
||
| 18 | $url = new \MySociety\TheyWorkForYou\Url('glossary_addterm'); |
||
| 19 | $data['add_url'] = $url->generate('url'); |
||
| 20 | } |
||
| 21 | |||
| 22 | $glossary = new \GLOSSARY(['sort' => 'regexp_replace']); |
||
| 23 | $glossary->current_letter = $az; |
||
| 24 | |||
| 25 | $data['page_title'] = $az . ': Glossary Index'; |
||
| 26 | $data['glossary'] = $glossary; |
||
| 27 | return $data; |
||
| 28 | } |
||
| 29 | |||
| 30 | private function get_next_prev($glossary): array { |
||
| 51 | } |
||
| 52 | } |
||
| 53 |
This check looks for private methods that have been defined, but are not used inside the class.