Skip to content

Commit d447040

Browse files
committed
add docblocks
1 parent 4507f7f commit d447040

File tree

1 file changed

+44
-5
lines changed

1 file changed

+44
-5
lines changed

lib/ConnectionInfo.php

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,55 @@
44

55
class ConnectionInfo {
66

7+
/**
8+
* The adapter to use for this connection
9+
*
10+
* @var string
11+
*/
712
public $adapter = null;
13+
14+
/**
15+
* The host to use for this connection.
16+
*
17+
* @var string
18+
*/
819
public $host = null;
20+
21+
/**
22+
* The port to use for this connection.
23+
*
24+
* @var int
25+
*/
926
public $port = null;
27+
28+
/**
29+
* The database to use for this connection.
30+
*
31+
* @var string
32+
*/
1033
public $database = null;
1134

35+
/**
36+
* The username to use for this connection.
37+
*
38+
* @var string
39+
*/
1240
public $username = null;
41+
42+
/**
43+
* The password to use for this connection.
44+
*
45+
* @var string
46+
*/
1347
public $password = null;
1448

49+
/**
50+
* The charset to use for this connection.
51+
*
52+
* @var string
53+
*/
1554
public $charset = null;
1655

17-
public $decode = false;
18-
1956
public function __construct($input = array())
2057
{
2158
foreach($input as $prop => $value)
@@ -62,6 +99,8 @@ public static function from_connection_url($connection_url)
6299
$info->adapter = $url['scheme'];
63100
$info->host = $url['host'];
64101

102+
$decode = false;
103+
65104
if (isset($url['query']))
66105
{
67106
parse_str($url['query'], $params);
@@ -70,7 +109,7 @@ public static function from_connection_url($connection_url)
70109
$info->charset = $params['charset'];
71110

72111
if(isset($params['decode']))
73-
$info->decode = ($params['decode'] == 'true');
112+
$decode = ($params['decode'] == 'true');
74113
}
75114

76115
if(isset($url['path']))
@@ -102,10 +141,10 @@ public static function from_connection_url($connection_url)
102141
$info->port = $url['port'];
103142

104143
if (isset($url['user']))
105-
$info->username = $info->decode ? urldecode($url['user']) : $url['user'];
144+
$info->username = $decode ? urldecode($url['user']) : $url['user'];
106145

107146
if (isset($url['pass']))
108-
$info->password = $info->decode ? urldecode($url['pass']) : $url['pass'];
147+
$info->password = $decode ? urldecode($url['pass']) : $url['pass'];
109148

110149
return $info;
111150
}

0 commit comments

Comments
 (0)