Skip to content

Commit 74fdfe7

Browse files
authored
[Symfony] Fixed empty clients key (#199)
* [Symfony] Fixed empty clients key * CS
1 parent 621085f commit 74fdfe7

File tree

5 files changed

+46
-5
lines changed

5 files changed

+46
-5
lines changed

CHANGELOG.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Change Log
2+
3+
## 0.1.1
4+
5+
### Added
6+
7+
- Support for async-aws/core: ^0.2
8+
- Support for CloudFormation, Lambda and SNS
9+
10+
### Fixed
11+
12+
- Configuration bug where you specified `async_aws.client:` and nothing more
13+
14+
## 0.1.0
15+
16+
First version

DependencyInjection/Configuration.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,12 @@ public function getConfigTreeBuilder()
4444
return $treeBuilder;
4545
}
4646

47-
private static function validateType(array $clients)
47+
private static function validateType(?array $clients)
4848
{
49+
if (null === $clients) {
50+
return [];
51+
}
52+
4953
$awsServices = AwsPackagesProvider::getServiceNames();
5054
foreach ($clients as $name => $config) {
5155
if (\in_array($name, $awsServices)) {

Tests/Functional/BundleInitializationTest.php

+12
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,18 @@ public function testNotRegisterServices()
7575
self::assertFalse($container->has(SqsClient::class));
7676
}
7777

78+
public function testEmptyClientsKey()
79+
{
80+
$kernel = $this->createKernel();
81+
$kernel->addConfigFile(__DIR__ . '/Resources/config/empty_clients_key.yaml');
82+
$this->bootKernel();
83+
84+
$container = $this->getContainer();
85+
self::assertTrue($container->has('async_aws.client.s3'));
86+
self::assertTrue($container->has('async_aws.client.sqs'));
87+
self::assertTrue($container->has(SqsClient::class));
88+
}
89+
7890
public function testNotRegisterSqs()
7991
{
8092
$kernel = $this->createKernel();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
framework:
2+
router:
3+
utf8: true
4+
5+
async_aws:
6+
config:
7+
region: eu-central-1
8+
9+
clients:

composer.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
"license": "MIT",
1212
"require": {
1313
"php": "^7.2.5",
14-
"async-aws/core": "^0.1.0",
14+
"async-aws/core": "^0.1 || ^0.2",
1515
"symfony/config": "^4.4 || ^5.0",
1616
"symfony/dependency-injection": "^4.4 || ^5.0",
1717
"symfony/http-kernel": "^4.4 || ^5.0"
1818
},
1919
"require-dev": {
20-
"async-aws/s3": "^0.1",
21-
"async-aws/ses": "^0.1",
22-
"async-aws/sqs": "^0.1",
20+
"async-aws/s3": "^0.1 || ^0.2",
21+
"async-aws/ses": "^0.1 || ^0.2",
22+
"async-aws/sqs": "^0.1 || ^0.2",
2323
"matthiasnoback/symfony-config-test": "^4.1",
2424
"nyholm/symfony-bundle-test": "^1.6.1"
2525
},

0 commit comments

Comments
 (0)