Skip to content

Commit 26da6ef

Browse files
committed
Signature and Encryption component error
This commit fixes the error that occurs when the signature or the encryption components are instaled but no configuration is set.
1 parent 7499661 commit 26da6ef

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/Bundle/JoseFramework/DependencyInjection/Source/Encryption/EncryptionSource.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,10 @@ public function load(array $configs, ContainerBuilder $container)
6767
$loader->load('jwe_serializers.yml');
6868
$loader->load('compression_methods.yml');
6969

70-
foreach ($this->sources as $source) {
71-
$source->load($configs['jwe'], $container);
70+
if (array_key_exists('jwe', $configs)) {
71+
foreach ($this->sources as $source) {
72+
$source->load($configs['jwe'], $container);
73+
}
7274
}
7375
}
7476

src/Bundle/JoseFramework/DependencyInjection/Source/Signature/SignatureSource.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,10 @@ public function load(array $configs, ContainerBuilder $container)
6666
$loader->load('jws_serializers.yml');
6767
$loader->load('signature_algorithms.yml');
6868

69-
foreach ($this->sources as $source) {
70-
$source->load($configs['jws'], $container);
69+
if (array_key_exists('jws', $configs)) {
70+
foreach ($this->sources as $source) {
71+
$source->load($configs['jws'], $container);
72+
}
7173
}
7274
}
7375

0 commit comments

Comments
 (0)