Skip to content

Commit

Permalink
bump to 0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
onairmarc committed Aug 31, 2023
1 parent 73bbf62 commit ec1e976
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "encoredigitalgroup/planningcenter-php-sdk",
"description": "PHP SDK for the Planning Center API",
"type": "library",
"version": "0.4.0",
"version": "0.5.0",
"license": "MIT",
"autoload": {
"psr-4": {
Expand Down
25 changes: 13 additions & 12 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ public function configure($config = [])
);
}

public function send($request)
{
$client = $GLOBALS['pcoClient'];
try {
$res = $client->sendAsync($request)->wait();
} catch (ClientException $e) {
return json_encode($this->processResponse($e->getResponse()));
}

return json_encode($this->processResponse($res));

}
protected function processResponse($res): array
{
$response_body = $res->getBody();
Expand Down Expand Up @@ -68,16 +80,5 @@ protected function processResponse($res): array
return $response;
}

public function send($request)
{
$client = $GLOBALS['pcoClient'];
try {
$res = $client->sendAsync($request)->wait();
} catch (ClientException $e) {
return json_encode($this->processResponse($e->getResponse()));
}

return json_encode($this->processResponse($res));

}

}

0 comments on commit ec1e976

Please sign in to comment.