File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 13
13
*/
14
14
class EncryptionManagerRegistry
15
15
{
16
- private array $ managers ;
16
+ private array $ managers = [] ;
17
17
private string $ defaultCode ;
18
18
19
19
/**
20
20
* EncryptionManagerRegistry constructor.
21
21
*
22
22
* @param string $defaultCode
23
- * @param iterable|\Traversable $managers
23
+ * @param iterable|\Traversable|EncryptionManagerInterface[] $managers
24
24
*/
25
25
public function __construct (string $ defaultCode , iterable $ managers )
26
26
{
27
- $ this ->managers = iterator_to_array ($ managers );
27
+ /** @var EncryptionManagerInterface $manager */
28
+ foreach (iterator_to_array ($ managers ) as $ manager ) {
29
+ $ this ->managers [$ manager ->getEncryptionAdapter ()->getCode ()] = $ manager ;
30
+ }
28
31
$ this ->defaultCode = $ defaultCode ;
29
32
}
30
33
You can’t perform that action at this time.
0 commit comments