Conditions | 5 |
Paths | 6 |
Total Lines | 20 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
12 | public function view() |
||
13 | { |
||
14 | $strings = $_GET['strings']; |
||
15 | $namespace = (empty($_GET['namespace']) ? null : General::sanitize($_GET['namespace'])); |
||
16 | |||
17 | $new = array(); |
||
18 | |||
19 | foreach ($strings as $key => $value) { |
||
20 | // Check value |
||
21 | if (empty($value) || $value = 'false') { |
||
22 | $value = $key; |
||
23 | } |
||
24 | |||
25 | $value = General::sanitize($value); |
||
26 | |||
27 | // Translate |
||
28 | $new[$value] = Lang::translate(urldecode($value), null, $namespace); |
||
29 | } |
||
30 | |||
31 | $this->_Result = $new; |
||
32 | } |
||
34 |
Classes in PHP are usually named in CamelCase.
In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. The whole name starts with a capital letter as well.
Thus the name database provider becomes
DatabaseProvider
.