Conditions | 4 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
33 | function get_template_list() { |
||
34 | $file_list = scandir(APPPATH . 'views/templates/'); |
||
35 | foreach ($file_list as $i=>$file) { |
||
36 | if (!is_dir(APPPATH . "views/templates/$file") |
||
37 | || strpos($file, '.') === 0 |
||
38 | ) { |
||
39 | unset($file_list[$i]); |
||
40 | } else { |
||
41 | $file_list[$i] = pathinfo($file)['filename']; |
||
42 | } |
||
43 | } |
||
44 | return array_values(array_unique($file_list)); |
||
45 | } |
||
48 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.