Skip to content

Commit b3ad65b

Browse files
authored
Remove dependency to http-client (#325)
* Remove dependency to http-client * Use "minimum-stability":"dev"
1 parent f19db42 commit b3ad65b

23 files changed

+66
-66
lines changed

src/DynamoDbClient.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function createTable($input): CreateTableOutput
5151
{
5252
$response = $this->getResponse(CreateTableInput::create($input)->request());
5353

54-
return new CreateTableOutput($response, $this->httpClient);
54+
return new CreateTableOutput($response);
5555
}
5656

5757
/**
@@ -77,7 +77,7 @@ public function deleteItem($input): DeleteItemOutput
7777
{
7878
$response = $this->getResponse(DeleteItemInput::create($input)->request());
7979

80-
return new DeleteItemOutput($response, $this->httpClient);
80+
return new DeleteItemOutput($response);
8181
}
8282

8383
/**
@@ -97,7 +97,7 @@ public function deleteTable($input): DeleteTableOutput
9797
{
9898
$response = $this->getResponse(DeleteTableInput::create($input)->request());
9999

100-
return new DeleteTableOutput($response, $this->httpClient);
100+
return new DeleteTableOutput($response);
101101
}
102102

103103
/**
@@ -114,7 +114,7 @@ public function describeTable($input): DescribeTableOutput
114114
{
115115
$response = $this->getResponse(DescribeTableInput::create($input)->request());
116116

117-
return new DescribeTableOutput($response, $this->httpClient);
117+
return new DescribeTableOutput($response);
118118
}
119119

120120
/**
@@ -137,7 +137,7 @@ public function getItem($input): GetItemOutput
137137
{
138138
$response = $this->getResponse(GetItemInput::create($input)->request());
139139

140-
return new GetItemOutput($response, $this->httpClient);
140+
return new GetItemOutput($response);
141141
}
142142

143143
/**
@@ -156,7 +156,7 @@ public function listTables($input = []): ListTablesOutput
156156
$input = ListTablesInput::create($input);
157157
$response = $this->getResponse($input->request());
158158

159-
return new ListTablesOutput($response, $this->httpClient, $this, $input);
159+
return new ListTablesOutput($response, $this, $input);
160160
}
161161

162162
/**
@@ -185,7 +185,7 @@ public function putItem($input): PutItemOutput
185185
{
186186
$response = $this->getResponse(PutItemInput::create($input)->request());
187187

188-
return new PutItemOutput($response, $this->httpClient);
188+
return new PutItemOutput($response);
189189
}
190190

191191
/**
@@ -219,7 +219,7 @@ public function query($input): QueryOutput
219219
$input = QueryInput::create($input);
220220
$response = $this->getResponse($input->request());
221221

222-
return new QueryOutput($response, $this->httpClient, $this, $input);
222+
return new QueryOutput($response, $this, $input);
223223
}
224224

225225
/**
@@ -252,7 +252,7 @@ public function scan($input): ScanOutput
252252
$input = ScanInput::create($input);
253253
$response = $this->getResponse($input->request());
254254

255-
return new ScanOutput($response, $this->httpClient, $this, $input);
255+
return new ScanOutput($response, $this, $input);
256256
}
257257

258258
/**
@@ -282,7 +282,7 @@ public function updateItem($input): UpdateItemOutput
282282
{
283283
$response = $this->getResponse(UpdateItemInput::create($input)->request());
284284

285-
return new UpdateItemOutput($response, $this->httpClient);
285+
return new UpdateItemOutput($response);
286286
}
287287

288288
/**
@@ -306,7 +306,7 @@ public function updateTable($input): UpdateTableOutput
306306
{
307307
$response = $this->getResponse(UpdateTableInput::create($input)->request());
308308

309-
return new UpdateTableOutput($response, $this->httpClient);
309+
return new UpdateTableOutput($response);
310310
}
311311

312312
protected function getServiceCode(): string

src/Result/CreateTableOutput.php

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

33
namespace AsyncAws\DynamoDb\Result;
44

5+
use AsyncAws\Core\Response;
56
use AsyncAws\Core\Result;
67
use AsyncAws\DynamoDb\ValueObject\ArchivalSummary;
78
use AsyncAws\DynamoDb\ValueObject\AttributeDefinition;
@@ -18,8 +19,6 @@
1819
use AsyncAws\DynamoDb\ValueObject\SSEDescription;
1920
use AsyncAws\DynamoDb\ValueObject\StreamSpecification;
2021
use AsyncAws\DynamoDb\ValueObject\TableDescription;
21-
use Symfony\Contracts\HttpClient\HttpClientInterface;
22-
use Symfony\Contracts\HttpClient\ResponseInterface;
2322

2423
class CreateTableOutput extends Result
2524
{
@@ -35,9 +34,9 @@ public function getTableDescription(): ?TableDescription
3534
return $this->TableDescription;
3635
}
3736

38-
protected function populateResult(ResponseInterface $response, HttpClientInterface $httpClient): void
37+
protected function populateResult(Response $response): void
3938
{
40-
$data = $response->toArray(false);
39+
$data = $response->toArray();
4140

4241
$this->TableDescription = empty($data['TableDescription']) ? null : new TableDescription([
4342
'AttributeDefinitions' => empty($data['TableDescription']['AttributeDefinitions']) ? [] : (function (array $json): array {

src/Result/DeleteItemOutput.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22

33
namespace AsyncAws\DynamoDb\Result;
44

5+
use AsyncAws\Core\Response;
56
use AsyncAws\Core\Result;
67
use AsyncAws\DynamoDb\ValueObject\AttributeValue;
78
use AsyncAws\DynamoDb\ValueObject\Capacity;
89
use AsyncAws\DynamoDb\ValueObject\ConsumedCapacity;
910
use AsyncAws\DynamoDb\ValueObject\ItemCollectionMetrics;
10-
use Symfony\Contracts\HttpClient\HttpClientInterface;
11-
use Symfony\Contracts\HttpClient\ResponseInterface;
1211

1312
class DeleteItemOutput extends Result
1413
{
@@ -59,9 +58,9 @@ public function getItemCollectionMetrics(): ?ItemCollectionMetrics
5958
return $this->ItemCollectionMetrics;
6059
}
6160

62-
protected function populateResult(ResponseInterface $response, HttpClientInterface $httpClient): void
61+
protected function populateResult(Response $response): void
6362
{
64-
$data = $response->toArray(false);
63+
$data = $response->toArray();
6564

6665
$this->Attributes = empty($data['Attributes']) ? [] : (function (array $json): array {
6766
$items = [];

src/Result/DeleteTableOutput.php

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

33
namespace AsyncAws\DynamoDb\Result;
44

5+
use AsyncAws\Core\Response;
56
use AsyncAws\Core\Result;
67
use AsyncAws\DynamoDb\ValueObject\ArchivalSummary;
78
use AsyncAws\DynamoDb\ValueObject\AttributeDefinition;
@@ -18,8 +19,6 @@
1819
use AsyncAws\DynamoDb\ValueObject\SSEDescription;
1920
use AsyncAws\DynamoDb\ValueObject\StreamSpecification;
2021
use AsyncAws\DynamoDb\ValueObject\TableDescription;
21-
use Symfony\Contracts\HttpClient\HttpClientInterface;
22-
use Symfony\Contracts\HttpClient\ResponseInterface;
2322

2423
class DeleteTableOutput extends Result
2524
{
@@ -35,9 +34,9 @@ public function getTableDescription(): ?TableDescription
3534
return $this->TableDescription;
3635
}
3736

38-
protected function populateResult(ResponseInterface $response, HttpClientInterface $httpClient): void
37+
protected function populateResult(Response $response): void
3938
{
40-
$data = $response->toArray(false);
39+
$data = $response->toArray();
4140

4241
$this->TableDescription = empty($data['TableDescription']) ? null : new TableDescription([
4342
'AttributeDefinitions' => empty($data['TableDescription']['AttributeDefinitions']) ? [] : (function (array $json): array {

src/Result/DescribeTableOutput.php

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

33
namespace AsyncAws\DynamoDb\Result;
44

5+
use AsyncAws\Core\Response;
56
use AsyncAws\Core\Result;
67
use AsyncAws\DynamoDb\ValueObject\ArchivalSummary;
78
use AsyncAws\DynamoDb\ValueObject\AttributeDefinition;
@@ -18,8 +19,6 @@
1819
use AsyncAws\DynamoDb\ValueObject\SSEDescription;
1920
use AsyncAws\DynamoDb\ValueObject\StreamSpecification;
2021
use AsyncAws\DynamoDb\ValueObject\TableDescription;
21-
use Symfony\Contracts\HttpClient\HttpClientInterface;
22-
use Symfony\Contracts\HttpClient\ResponseInterface;
2322

2423
class DescribeTableOutput extends Result
2524
{
@@ -35,9 +34,9 @@ public function getTable(): ?TableDescription
3534
return $this->Table;
3635
}
3736

38-
protected function populateResult(ResponseInterface $response, HttpClientInterface $httpClient): void
37+
protected function populateResult(Response $response): void
3938
{
40-
$data = $response->toArray(false);
39+
$data = $response->toArray();
4140

4241
$this->Table = empty($data['Table']) ? null : new TableDescription([
4342
'AttributeDefinitions' => empty($data['Table']['AttributeDefinitions']) ? [] : (function (array $json): array {

src/Result/GetItemOutput.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22

33
namespace AsyncAws\DynamoDb\Result;
44

5+
use AsyncAws\Core\Response;
56
use AsyncAws\Core\Result;
67
use AsyncAws\DynamoDb\ValueObject\AttributeValue;
78
use AsyncAws\DynamoDb\ValueObject\Capacity;
89
use AsyncAws\DynamoDb\ValueObject\ConsumedCapacity;
9-
use Symfony\Contracts\HttpClient\HttpClientInterface;
10-
use Symfony\Contracts\HttpClient\ResponseInterface;
1110

1211
class GetItemOutput extends Result
1312
{
@@ -43,9 +42,9 @@ public function getItem(): array
4342
return $this->Item;
4443
}
4544

46-
protected function populateResult(ResponseInterface $response, HttpClientInterface $httpClient): void
45+
protected function populateResult(Response $response): void
4746
{
48-
$data = $response->toArray(false);
47+
$data = $response->toArray();
4948

5049
$this->Item = empty($data['Item']) ? [] : (function (array $json): array {
5150
$items = [];

src/Result/ListTablesOutput.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22

33
namespace AsyncAws\DynamoDb\Result;
44

5+
use AsyncAws\Core\Response;
56
use AsyncAws\Core\Result;
67
use AsyncAws\DynamoDb\DynamoDbClient;
78
use AsyncAws\DynamoDb\Input\ListTablesInput;
8-
use Symfony\Contracts\HttpClient\HttpClientInterface;
9-
use Symfony\Contracts\HttpClient\ResponseInterface;
109

1110
class ListTablesOutput extends Result implements \IteratorAggregate
1211
{
@@ -108,9 +107,9 @@ public function getTableNames(bool $currentPageOnly = false): iterable
108107
}
109108
}
110109

111-
protected function populateResult(ResponseInterface $response, HttpClientInterface $httpClient): void
110+
protected function populateResult(Response $response): void
112111
{
113-
$data = $response->toArray(false);
112+
$data = $response->toArray();
114113

115114
$this->TableNames = empty($data['TableNames']) ? [] : (function (array $json): array {
116115
$items = [];

src/Result/PutItemOutput.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22

33
namespace AsyncAws\DynamoDb\Result;
44

5+
use AsyncAws\Core\Response;
56
use AsyncAws\Core\Result;
67
use AsyncAws\DynamoDb\ValueObject\AttributeValue;
78
use AsyncAws\DynamoDb\ValueObject\Capacity;
89
use AsyncAws\DynamoDb\ValueObject\ConsumedCapacity;
910
use AsyncAws\DynamoDb\ValueObject\ItemCollectionMetrics;
10-
use Symfony\Contracts\HttpClient\HttpClientInterface;
11-
use Symfony\Contracts\HttpClient\ResponseInterface;
1211

1312
class PutItemOutput extends Result
1413
{
@@ -59,9 +58,9 @@ public function getItemCollectionMetrics(): ?ItemCollectionMetrics
5958
return $this->ItemCollectionMetrics;
6059
}
6160

62-
protected function populateResult(ResponseInterface $response, HttpClientInterface $httpClient): void
61+
protected function populateResult(Response $response): void
6362
{
64-
$data = $response->toArray(false);
63+
$data = $response->toArray();
6564

6665
$this->Attributes = empty($data['Attributes']) ? [] : (function (array $json): array {
6766
$items = [];

src/Result/QueryOutput.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22

33
namespace AsyncAws\DynamoDb\Result;
44

5+
use AsyncAws\Core\Response;
56
use AsyncAws\Core\Result;
67
use AsyncAws\DynamoDb\DynamoDbClient;
78
use AsyncAws\DynamoDb\Input\QueryInput;
89
use AsyncAws\DynamoDb\ValueObject\AttributeValue;
910
use AsyncAws\DynamoDb\ValueObject\Capacity;
1011
use AsyncAws\DynamoDb\ValueObject\ConsumedCapacity;
11-
use Symfony\Contracts\HttpClient\HttpClientInterface;
12-
use Symfony\Contracts\HttpClient\ResponseInterface;
1312

1413
class QueryOutput extends Result implements \IteratorAggregate
1514
{
@@ -159,9 +158,9 @@ public function getScannedCount(): ?int
159158
return $this->ScannedCount;
160159
}
161160

162-
protected function populateResult(ResponseInterface $response, HttpClientInterface $httpClient): void
161+
protected function populateResult(Response $response): void
163162
{
164-
$data = $response->toArray(false);
163+
$data = $response->toArray();
165164

166165
$this->Items = empty($data['Items']) ? [] : (function (array $json): array {
167166
$items = [];

src/Result/ScanOutput.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22

33
namespace AsyncAws\DynamoDb\Result;
44

5+
use AsyncAws\Core\Response;
56
use AsyncAws\Core\Result;
67
use AsyncAws\DynamoDb\DynamoDbClient;
78
use AsyncAws\DynamoDb\Input\ScanInput;
89
use AsyncAws\DynamoDb\ValueObject\AttributeValue;
910
use AsyncAws\DynamoDb\ValueObject\Capacity;
1011
use AsyncAws\DynamoDb\ValueObject\ConsumedCapacity;
11-
use Symfony\Contracts\HttpClient\HttpClientInterface;
12-
use Symfony\Contracts\HttpClient\ResponseInterface;
1312

1413
class ScanOutput extends Result implements \IteratorAggregate
1514
{
@@ -159,9 +158,9 @@ public function getScannedCount(): ?int
159158
return $this->ScannedCount;
160159
}
161160

162-
protected function populateResult(ResponseInterface $response, HttpClientInterface $httpClient): void
161+
protected function populateResult(Response $response): void
163162
{
164-
$data = $response->toArray(false);
163+
$data = $response->toArray();
165164

166165
$this->Items = empty($data['Items']) ? [] : (function (array $json): array {
167166
$items = [];

0 commit comments

Comments
 (0)