Skip to content
This repository was archived by the owner on Sep 4, 2021. It is now read-only.

Commit ed4ad61

Browse files
author
Pascal Krason
committed
Prefixed username & password properties with rpc
1 parent 8e30335 commit ed4ad61

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

src/Client.php

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ class Client
2626
* JSONRPC User Name
2727
* @var string
2828
*/
29-
private $username = null;
29+
private $rpcUsername = null;
3030

3131
/**
3232
* JSONRPC Password
3333
* @var string
3434
*/
35-
private $password = null;
35+
private $rpcPassword = null;
3636

3737
/**
3838
* Last Message-ID
@@ -44,21 +44,21 @@ class Client
4444
* @param string $host
4545
* @param int $port
4646
* @param int $id
47-
* @param string $username
48-
* @param string $password
47+
* @param null $rpcUsername
48+
* @param null $rpcPassword
4949
*/
5050
public function __construct(
5151
$host = 'http://127.0.0.1',
5252
$port = 7777,
5353
$id = 0,
54-
$username = null,
55-
$password = null
54+
$rpcUsername = null,
55+
$rpcPassword = null
5656
) {
5757
$this->setHost($host);
5858
$this->setPort($port);
5959
$this->setId($id);
60-
$this->setUsername($username);
61-
$this->setPassword($password);
60+
$this->setRpcUsername($rpcUsername);
61+
$this->setRpcPassword($rpcPassword);
6262
}
6363

6464
/**
@@ -133,9 +133,9 @@ private function executeCurlRequest($request)
133133
]);
134134

135135
// Authorization
136-
if ($this->getUsername() && $this->getPassword()) {
136+
if ($this->getRpcUsername() && $this->getRpcPassword()) {
137137
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
138-
curl_setopt($curl, CURLOPT_USERPWD, $this->getUsername() . ":" . $this->getPassword());
138+
curl_setopt($curl, CURLOPT_USERPWD, $this->getRpcUsername() . ":" . $this->getRpcPassword());
139139
}
140140

141141
// Execute request & convert data to array
@@ -198,39 +198,39 @@ public function setPort($port)
198198
/**
199199
* @return string
200200
*/
201-
public function getUsername()
201+
public function getRpcUsername()
202202
{
203-
return $this->username;
203+
return $this->rpcUsername;
204204
}
205205

206206
/**
207-
* @param string $username
207+
* @param string $rpcUsername
208208
*
209209
* @return Client
210210
*/
211-
public function setUsername($username)
211+
public function setRpcUsername($rpcUsername)
212212
{
213-
$this->username = $username;
213+
$this->rpcUsername = $rpcUsername;
214214

215215
return $this;
216216
}
217217

218218
/**
219219
* @return string
220220
*/
221-
public function getPassword()
221+
public function getRpcPassword()
222222
{
223-
return $this->password;
223+
return $this->rpcPassword;
224224
}
225225

226226
/**
227-
* @param string $password
227+
* @param string $rpcPassword
228228
*
229229
* @return Client
230230
*/
231-
public function setPassword($password)
231+
public function setRpcPassword($rpcPassword)
232232
{
233-
$this->password = $password;
233+
$this->rpcPassword = $rpcPassword;
234234

235235
return $this;
236236
}

0 commit comments

Comments
 (0)