lib   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A get_configurations() 0 8 2
1
<?php
2
###############################################################################
3
# ASTPP - Open Source VoIP Billing Solution
4
#
5
# Copyright (C) 2016 iNextrix Technologies Pvt. Ltd.
6
# Samir Doshi <[email protected]>
7
# ASTPP Version 3.0 and above
8
# License https://www.gnu.org/licenses/agpl-3.0.html
9
#
10
# This program is free software: you can redistribute it and/or modify
11
# it under the terms of the GNU Affero General Public License as
12
# published by the Free Software Foundation, either version 3 of the
13
# License, or (at your option) any later version.
14
# 
15
# This program is distributed in the hope that it will be useful,
16
# but WITHOUT ANY WARRANTY; without even the implied warranty of
17
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
# GNU Affero General Public License for more details.
19
# 
20
# You should have received a copy of the GNU Affero General Public License
21
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
###############################################################################
23
24
class lib {
25
26
	var $config;
27
28
	function get_configurations($db) {
29
		$query = "SELECT * FROM system WHERE group_title IN ('global','opensips')";
30
		$res_conf = $db->run($query);
31
		foreach ($res_conf as $res_conf_key => $res_conf_value)
32
			$this->config[$res_conf_value['name']] = $res_conf_value['value'];
33
34
		return $this->config;
35
	}
36
37
}
38
39
?>
0 ignored issues
show
Best Practice introduced by
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...
40