Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
47 | public function create(array $aliases): AlgorithmManager |
||
48 | { |
||
49 | $algorithms = []; |
||
50 | foreach ($aliases as $alias) { |
||
51 | if (array_key_exists($alias, $this->algorithms)) { |
||
52 | $algorithms[] = $this->algorithms[$alias]; |
||
53 | } else { |
||
54 | throw new \InvalidArgumentException(sprintf('The algorithm with the alias "%s" is not supported.', $alias)); |
||
55 | } |
||
56 | } |
||
57 | |||
58 | return AlgorithmManager::create($algorithms); |
||
59 | } |
||
60 | |||
69 |