Conditions | 4 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 3 |
CRAP Score | 7.9062 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | 1 | public function voteOnTrust( |
|
24 | RegistrationResultInterface $registrationResult, |
||
25 | TrustPathInterface $trustPath, |
||
26 | ?MetadataInterface $metadata |
||
27 | ): TrustVote { |
||
28 | 1 | if ($metadata === null) { |
|
29 | 1 | return TrustVote::abstain(); |
|
30 | } |
||
31 | |||
32 | $trustAnchors = $metadata->getTrustAnchors(); |
||
33 | foreach ($trustAnchors as $anchor) { |
||
34 | if ($this->pathValidator->validate($trustPath, $anchor)) { |
||
35 | return TrustVote::trusted(); |
||
36 | } |
||
37 | } |
||
38 | return TrustVote::abstain(); |
||
39 | } |
||
41 |