cod consolidation and style updates
This commit is contained in:
@@ -10,12 +10,17 @@ final class PaddleClient
|
||||
{
|
||||
public function customer(?string $customerID): ?array
|
||||
{
|
||||
if (!$customerID || !config('rsync-studio.paddle.api_key')) return null;
|
||||
if (! $customerID || ! config('rsync-studio.paddle.api_key')) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$response = $this->request()->get('/customers/'.$customerID);
|
||||
|
||||
if (!$response->successful()) return null;
|
||||
if (! $response->successful()) {
|
||||
return null;
|
||||
}
|
||||
$data = $response->json('data');
|
||||
|
||||
return is_array($data) ? $data : null;
|
||||
}
|
||||
|
||||
@@ -62,13 +67,13 @@ final class PaddleClient
|
||||
|
||||
private function subscriptionData(Response $response, string $fallback): array
|
||||
{
|
||||
if (!$response->successful()) {
|
||||
if (! $response->successful()) {
|
||||
$detail = trim((string) ($response->json('error.detail') ?? ''));
|
||||
throw new RuntimeException($detail !== '' ? $detail : $fallback);
|
||||
}
|
||||
|
||||
$data = $response->json('data');
|
||||
if (!is_array($data)) {
|
||||
if (! is_array($data)) {
|
||||
throw new RuntimeException($fallback);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user