Skip to content

Commit 707dc9b

Browse files
committed
remove the abstract ApiClient base class
1 parent 4b0d76b commit 707dc9b

File tree

6 files changed

+28
-57
lines changed

6 files changed

+28
-57
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ CHANGELOG
44
0.3.0
55
-----
66

7+
* Removed the `ApiClient` class. The `$requestHandler` and `$version` attributes
8+
have been moved to the former child classes of the `ApiClient` class and
9+
their visibility has been changed to `private`.
10+
11+
* The visibility of the `$documentDataSerializer` property of the `ActivityProfileApiClient`,
12+
`AgentProfileApiClient`, `DocumentApiClient`, and `StateApiClient` classes
13+
has been changed to `private`.
14+
715
* Removed the `getRequestHandler()` method from the API classes:
816

917
* `ActivityProfileApiClient::getRequestHandler()`

UPGRADE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ UPGRADE
44
Upgrading from 0.2 to 0.3
55
-------------------------
66

7+
* Removed the `ApiClient` class. The `$requestHandler` and `$version` attributes
8+
have been moved to the former child classes of the `ApiClient` class and
9+
their visibility has been changed to `private`.
10+
11+
* The visibility of the `$documentDataSerializer` property of the `ActivityProfileApiClient`,
12+
`AgentProfileApiClient`, `DocumentApiClient`, and `StateApiClient` classes
13+
has been changed to `private`.
14+
715
* Removed the `getRequestHandler()` method from the API classes:
816

917
* `ActivityProfileApiClient::getRequestHandler()`

src/Api/ApiClient.php

Lines changed: 0 additions & 36 deletions
This file was deleted.

src/Api/DocumentApiClient.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,11 @@
2121
*
2222
* @author Christian Flothmann <[email protected]>
2323
*/
24-
abstract class DocumentApiClient extends ApiClient
24+
abstract class DocumentApiClient
2525
{
26-
/**
27-
* @var DocumentDataSerializerInterface
28-
*/
29-
protected $documentDataSerializer;
26+
private $requestHandler;
27+
private $version;
28+
private $documentDataSerializer;
3029

3130
/**
3231
* @param HandlerInterface $requestHandler The HTTP request handler
@@ -35,8 +34,8 @@ abstract class DocumentApiClient extends ApiClient
3534
*/
3635
public function __construct(HandlerInterface $requestHandler, $version, DocumentDataSerializerInterface $documentDataSerializer)
3736
{
38-
parent::__construct($requestHandler, $version);
39-
37+
$this->requestHandler = $requestHandler;
38+
$this->version = $version;
4039
$this->documentDataSerializer = $documentDataSerializer;
4140
}
4241

src/Api/StatementsApiClient.php

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,12 @@
2727
*
2828
* @author Christian Flothmann <[email protected]>
2929
*/
30-
final class StatementsApiClient extends ApiClient implements StatementsApiClientInterface
30+
final class StatementsApiClient implements StatementsApiClientInterface
3131
{
32-
/**
33-
* @var StatementSerializerInterface
34-
*/
32+
private $requestHandler;
33+
private $version;
3534
private $statementSerializer;
36-
37-
/**
38-
* @var StatementResultSerializerInterface
39-
*/
4035
private $statementResultSerializer;
41-
42-
/**
43-
* @var ActorSerializerInterface
44-
*/
4536
private $actorSerializer;
4637

4738
/**
@@ -58,7 +49,8 @@ public function __construct(
5849
StatementResultSerializerInterface $statementResultSerializer,
5950
ActorSerializerInterface $actorSerializer
6051
) {
61-
parent::__construct($requestHandler, $version);
52+
$this->requestHandler = $requestHandler;
53+
$this->version = $version;
6254
$this->statementSerializer = $statementSerializer;
6355
$this->statementResultSerializer = $statementResultSerializer;
6456
$this->actorSerializer = $actorSerializer;

src/XApiClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*
2525
* @author Christian Flothmann <[email protected]>
2626
*/
27-
final class XApiClient extends ApiClient implements XApiClientInterface
27+
final class XApiClient implements XApiClientInterface
2828
{
2929
/**
3030
* @var SerializerRegistryInterface

0 commit comments

Comments
 (0)