Skip to content

Commit eff4efe

Browse files
authored
Implement CloudFront (#661)
* Added CloudFront client * Adding methods * Added mroe tetss * minor * minors * cs * Run CS fixer twice * Fixed CS * Update psalm baseline * Updated tests * minors * cs * Simpler logic * Easier to read
1 parent 96ff088 commit eff4efe

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/AwsClientFactory.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace AsyncAws\Core;
66

77
use AsyncAws\CloudFormation\CloudFormationClient;
8+
use AsyncAws\CloudFront\CloudFrontClient;
89
use AsyncAws\CloudWatchLogs\CloudWatchLogsClient;
910
use AsyncAws\CodeDeploy\CodeDeployClient;
1011
use AsyncAws\CognitoIdentityProvider\CognitoIdentityProviderClient;
@@ -90,6 +91,19 @@ public function cloudFormation(): CloudFormationClient
9091
return $this->serviceCache[__METHOD__];
9192
}
9293

94+
public function cloudFront(): CloudFrontClient
95+
{
96+
if (!class_exists(CloudFrontClient::class)) {
97+
throw MissingDependency::create('async-aws/cloud-front', 'CloudFront');
98+
}
99+
100+
if (!isset($this->serviceCache[__METHOD__])) {
101+
$this->serviceCache[__METHOD__] = new CloudFrontClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
102+
}
103+
104+
return $this->serviceCache[__METHOD__];
105+
}
106+
93107
public function cloudWatchLogs(): CloudWatchLogsClient
94108
{
95109
if (!class_exists(CloudWatchLogsClient::class)) {

0 commit comments

Comments
 (0)