Debian Codegraph @

lib/3rdParty/composer/web-token/jwt-library/KeyManagement/Analyzer/KeyAnalyzerManager.php

raw symbols SCIP
1 <?php
2
3 declare(strict_types=1);
4
5 namespace Jose\Component\KeyManagement\Analyzer;
6
7 use Jose\Component\Core\JWK;
8
9 class KeyAnalyzerManager
10 {
11 /**
12 * @var KeyAnalyzer[]
13 */
14 private array $analyzers = [];
15
16 /**
17 * Adds a Key Analyzer to the manager.
18 */
19 public function add(KeyAnalyzer $analyzer): void
20 {
21 $this->analyzers[] = $analyzer;
22 }
23
24 /**
25 * This method will analyze the JWK object using all analyzers. It returns a message bag that may contains messages.
26 */
27 public function analyze(JWK $jwk): MessageBag
28 {
29 $bag = new MessageBag();
30 foreach ($this->analyzers as $analyzer) {
31 $analyzer->analyze($jwk, $bag);
32 }
33
34 return $bag;
35 }
36 }