This repository has been archived by the owner on Jun 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#30 Add functionality to set up multiple AWS SDK instances
- Loading branch information
Vlad Gorenkin
committed
Oct 9, 2018
1 parent
c9e2d2e
commit 9022e0c
Showing
5 changed files
with
135 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Ruwork\AwsBundle\Client; | ||
|
||
use Aws\Sdk; | ||
use Symfony\Component\DependencyInjection\ServiceLocator; | ||
|
||
final class AwsSdks | ||
{ | ||
private $locator; | ||
private $defaultName; | ||
|
||
public function __construct(ServiceLocator $locator, string $defaultName) | ||
{ | ||
$this->locator = $locator; | ||
$this->defaultName = $defaultName; | ||
} | ||
|
||
public function has(string $name): bool | ||
{ | ||
return $this->locator->has($name); | ||
} | ||
|
||
public function get(?string $name = null): Sdk | ||
{ | ||
return $this->locator->get($name ?? $this->defaultName); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters