@@ -28,20 +28,16 @@ public static function convert(Anchor $protobufAnchor)
28
28
$ anchorTypesMap = self ::getAnchorTypesMap ();
29
29
30
30
foreach ($ X509CertsList as $ certX509Obj ) {
31
- $ certExtArr = $ certX509Obj ->tbsCertificate ->extensions ;
32
-
33
- foreach ($ anchorTypesMap as $ oid => $ anchorType )
34
- {
35
- foreach ($ certExtArr as $ extObj ) {
36
- $ extRaw = (array ) $ extObj ;
37
- $ oidFound = array_search ($ oid , $ extRaw , TRUE );
38
- if ($ oidFound !== FALSE ) {
39
- $ extEncodedValue = $ extRaw ['extnValue ' ];
40
-
41
- if (
42
- is_string ($ extEncodedValue )
43
- && ($ decodedAnchorValue = self ::decodeAnchorValue ($ ASN1 , $ X509 , $ extEncodedValue ))
44
- ) {
31
+ $ certExtsArr = $ certX509Obj ->tbsCertificate ->extensions ;
32
+
33
+ foreach ($ anchorTypesMap as $ oid => $ anchorType ) {
34
+ foreach ($ certExtsArr as $ extObj ) {
35
+ $ extArr = (array ) $ extObj ;
36
+ $ oidFound = array_search ($ oid , $ extArr , TRUE );
37
+ if ($ oidFound !== FALSE && is_string ($ extArr ['extnValue ' ])) {
38
+ $ extEncodedValue = $ extArr ['extnValue ' ];
39
+
40
+ if ($ decodedAnchorValue = self ::decodeAnchorValue ($ ASN1 , $ X509 , $ extEncodedValue )) {
45
41
$ yotiAnchor = self ::createYotiAnchor (
46
42
$ decodedAnchorValue ,
47
43
$ anchorType ,
@@ -54,7 +50,7 @@ public static function convert(Anchor $protobufAnchor)
54
50
'yoti_anchor ' => $ yotiAnchor
55
51
];
56
52
// We are only looking for one YotiAnchor from protobufAnchor
57
- break ;
53
+ return $ anchorMap ;
58
54
}
59
55
}
60
56
}
0 commit comments