Skip to content

Commit

Permalink
Apply fixes from StyleCI (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
sohaibilyas authored Jul 30, 2022
1 parent c7d5fbb commit b14c839
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/Facebook.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,22 @@ public function setResponseType(string $type = 'json')

public function getUser(string $userId = 'me', array $fields = ['id', 'name'], string $accessToken = null)
{
return $this->get($userId . '?fields=' . implode(',', $fields), $accessToken);
return $this->get($userId.'?fields='.implode(',', $fields), $accessToken);
}

public function getBusinesses(string $userId = 'me', array $fields = ['id', 'name'], int $limit = 100, string $accessToken = null)
{
return $this->get($userId . '/businesses?fields=' . implode(',', $fields) . '&limit=' . $limit, $accessToken);
return $this->get($userId.'/businesses?fields='.implode(',', $fields).'&limit='.$limit, $accessToken);
}

public function getPages(string $userId = 'me', array $fields = ['id', 'name'], int $limit = 100, string $accessToken = null)
{
return $this->get($userId . '/accounts?fields=' . implode(',', $fields) . '&limit=' . $limit, $accessToken);
return $this->get($userId.'/accounts?fields='.implode(',', $fields).'&limit='.$limit, $accessToken);
}

public function getAdAccounts(string $userId = 'me', array $fields = ['id', 'name'], int $limit = 100, string $accessToken = null)
{
return $this->get($userId . '/adaccounts?fields=' . implode(',', $fields) . '&limit=' . $limit, $accessToken);
return $this->get($userId.'/adaccounts?fields='.implode(',', $fields).'&limit='.$limit, $accessToken);
}

public function handleRedirect(callable $callable)
Expand Down Expand Up @@ -117,7 +117,7 @@ public function getLoginUrl(array $permissions = ['public_profile', 'email'])

public function get(string $path, string $accessToken = null)
{
$path = $path[0] == '/' ? $path : '/' . $path;
$path = $path[0] == '/' ? $path : '/'.$path;

$this->accessToken = $accessToken ? $accessToken : $this->accessToken;

Expand All @@ -127,10 +127,12 @@ public function get(string $path, string $accessToken = null)
}

try {
$this->response = $this->client->get($this->apiVersion . $path . $separator . 'access_token=' . $this->accessToken);
$this->response = $this->client->get($this->apiVersion.$path.$separator.'access_token='.$this->accessToken);

return $this->getResponse();
} catch (\Exception $e) {
$this->response = $e->getResponse();

return $this->getResponse();
}
}
Expand All @@ -154,6 +156,7 @@ public function post(string $path, array $params, string $accessToken = null)
return $this->getResponse();
} catch (\Exception $e) {
$this->response = $e->getResponse();

return $this->getResponse();
}
}
Expand All @@ -175,6 +178,7 @@ public function delete(string $path, string $accessToken = null)
return $this->getResponse();
} catch (\Exception $e) {
$this->response = $e->getResponse();

return $this->getResponse();
}
}
Expand Down

0 comments on commit b14c839

Please sign in to comment.