Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Commit

Permalink
#30 Use container inside AwsSdks instead of locator
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlad Gorenkin committed Oct 15, 2018
1 parent 9022e0c commit 28487d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/AwsBundle/Client/AwsSdks.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@
namespace Ruwork\AwsBundle\Client;

use Aws\Sdk;
use Symfony\Component\DependencyInjection\ServiceLocator;
use Psr\Container\ContainerInterface;

final class AwsSdks
{
private $locator;
private $container;
private $defaultName;

public function __construct(ServiceLocator $locator, string $defaultName)
public function __construct(ContainerInterface $container, string $defaultName)
{
$this->locator = $locator;
$this->container = $container;
$this->defaultName = $defaultName;
}

public function has(string $name): bool
{
return $this->locator->has($name);
return $this->container->has($name);
}

public function get(?string $name = null): Sdk
{
return $this->locator->get($name ?? $this->defaultName);
return $this->container->get($name ?? $this->defaultName);
}
}
2 changes: 1 addition & 1 deletion src/AwsBundle/DependencyInjection/RuworkAwsExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function loadInternal(array $config, ContainerBuilder $container): void
$container
->findDefinition(AwsSdks::class)
->setArguments([
'$locator' => ServiceLocatorTagPass::register($container, $references),
'$container' => ServiceLocatorTagPass::register($container, $references),
'$defaultName' => $config['default_sdk'],
]);
}
Expand Down

0 comments on commit 28487d9

Please sign in to comment.