Skip to content

Commit

Permalink
Merge pull request #3 from kaushikindianic/master
Browse files Browse the repository at this point in the history
fixed issue
  • Loading branch information
joostfaassen committed Mar 2, 2016
2 parents d0c5022 + 0771ef6 commit 1b0eb0b
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/Client.php
Expand Up @@ -38,17 +38,17 @@ private function getStatusCode($ch)
$info = curl_getinfo($ch);
return (int)$info['http_code'];
}

public function getBaseUrl()
{
return $this->baseUrl;
}

public function getPartition()
{
return $this->partition;
}

public function getUsername()
{
return $this->username;
Expand All @@ -64,7 +64,7 @@ public function getUsersWithDetails()
}
return $users;
}

protected function itemToUser($data)
{
$user = new User($data['username']);
Expand Down Expand Up @@ -105,14 +105,14 @@ protected function itemToUser($data)
}
return $user;
}

protected function itemToAccount($data)
{
$account = new Account($data['name']);
$account->setDisplayName($data['display_name']);
$account->setAbout($data['about']);
$account->setEmail($data['email']);
if (isset($data['mobile']) {
if (isset($data['mobile'])) {
$account->setMobile($data['mobile']);
}
if (isset($data['type'])) {
Expand Down Expand Up @@ -146,22 +146,22 @@ protected function itemToAccount($data)

return $account;
}

public function getUserByUsername($username)
{

$data = $this->getData('/users/' . $username);
$user = $this->itemToUser($data);
return $user;
}

public function getAccountByName($name)
{
$data = $this->getData('/accounts/' . $name);
$account = $this->itemToAccount($data);
return $account;
}

public function getAccountsWithDetails()
{
$data = $this->getData('/accounts?details');
Expand Down Expand Up @@ -193,7 +193,7 @@ public function getData($uri)

return $data;
}

public function checkCredentials($username, $password)
{
try {
Expand Down

0 comments on commit 1b0eb0b

Please sign in to comment.