Skip to content

Commit 5707444

Browse files
authored
Init DynamoDb (#314)
* Init DynamoDb * Dont check if arrays are null * Revert minor change to reduce the diff * fixed tests * Fixed more tests * Bugfix, make sure child objects is checked before used. * Generate * Solve the date issue * Update composer.json
1 parent c010545 commit 5707444

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/AwsClientFactory.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use AsyncAws\Core\Exception\InvalidArgument;
1616
use AsyncAws\Core\Exception\MissingDependency;
1717
use AsyncAws\Core\Sts\StsClient;
18+
use AsyncAws\DynamoDb\DynamoDbClient;
1819
use AsyncAws\Lambda\LambdaClient;
1920
use AsyncAws\S3\S3Client;
2021
use AsyncAws\Ses\SesClient;
@@ -92,6 +93,19 @@ public function cloudFormation(): CloudFormationClient
9293
return $this->serviceCache[__METHOD__];
9394
}
9495

96+
public function dynamoDb(): DynamoDbClient
97+
{
98+
if (!class_exists(DynamoDbClient::class)) {
99+
throw MissingDependency::create('async-aws/dynamo-db', 'DynamoDb');
100+
}
101+
102+
if (!isset($this->serviceCache[__METHOD__])) {
103+
$this->serviceCache[__METHOD__] = new DynamoDbClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
104+
}
105+
106+
return $this->serviceCache[__METHOD__];
107+
}
108+
95109
public function lambda(): LambdaClient
96110
{
97111
if (!class_exists(LambdaClient::class)) {

src/Test/TestCase.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ public static function assertRequestEqualsHttpRequest(string $expected, Request
7575

7676
break;
7777
case 'application/json':
78+
case 'application/x-amz-json-1.0':
7879
if ('' === \trim($body)) {
7980
self::assertSame($body, $actual->getBody()->stringify());
8081
} else {

0 commit comments

Comments
 (0)