Skip to content

Commit 9d52375

Browse files
committed
Syntax improvements
1 parent 37fa52d commit 9d52375

5 files changed

Lines changed: 9 additions & 6 deletions

File tree

src/AbstractHttpClient.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ private function generateHttpResponse(string $method, string $url, array $option
7575
$response->setStatus($httpResponse->getStatusCode());
7676
$response->setHeaders($httpResponse->getHeaders(false));
7777
$response->setContent($httpResponse->toArray(false));
78-
} catch (DecodingExceptionInterface |
78+
} catch (
79+
DecodingExceptionInterface |
7980
RedirectionExceptionInterface |
8081
ClientExceptionInterface |
8182
ServerExceptionInterface |

src/Client.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class Client
66
{
7-
const API_VERSION = 'v2';
7+
private const API_VERSION = 'v2';
88
private string $baseUrl;
99
private ?string $bearerToken = null;
1010

@@ -34,7 +34,8 @@ public function setBearerToken(string $bearerToken): Client
3434
return $this;
3535
}
3636

37-
public function getHttpClient(HttpClientType $clientType): AbstractHttpClient {
37+
public function getHttpClient(HttpClientType $clientType): AbstractHttpClient
38+
{
3839
return new $clientType->value($this);
3940
}
4041
}

src/Clients/Ips/IpsClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66

77
class IpsClient extends AbstractHttpClient
88
{
9-
const URL = '/ips';
9+
protected const URL = '/ips';
1010
}

src/HttpClientInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
interface HttpClientInterface
66
{
77
public function delete(string $id): Response;
8-
public function get(?string $id, ?array $filters=[]): Response;
8+
public function get(?string $id, ?array $filters = []): Response;
99
public function patch(string $id, array $data): Response;
1010
public function post(array $data): Response;
1111
}

src/HttpClientType.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
use Dant89\IXAPIClient\Clients\RoleAssignments\RoleAssignmentsClient;
3030
use Dant89\IXAPIClient\Clients\Roles\RolesClient;
3131

32-
enum HttpClientType: string {
32+
enum HttpClientType: string
33+
{
3334
case AUTH = AuthClient::class;
3435
case ACCOUNT = AccountClient::class;
3536
case ACCOUNTS = AccountsClient::class;

0 commit comments

Comments
 (0)