| Conditions | 3 |
| Paths | 3 |
| Total Lines | 19 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | public function getSetting($code) |
||
| 26 | { |
||
| 27 | $data = array(); |
||
| 28 | |||
| 29 | $query = $this->db->query(" |
||
| 30 | SELECT * |
||
| 31 | FROM setting |
||
| 32 | WHERE `code` = '" . $this->db->escape($code) . "' |
||
| 33 | "); |
||
| 34 | |||
| 35 | foreach ($query->rows as $result) { |
||
| 36 | if (!$result['serialized']) { |
||
| 37 | $data[$result['key']] = $result['value']; |
||
| 38 | } else { |
||
| 39 | $data[$result['key']] = json_decode($result['value'], true); |
||
| 40 | } |
||
| 41 | } |
||
| 42 | |||
| 43 | return $data; |
||
| 44 | } |
||
| 46 |
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.