File tree Expand file tree Collapse file tree
src/VerifiableCredentials/VcDataModel/Claims Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55namespace SimpleSAML \OpenID \VerifiableCredentials \VcDataModel \Claims ;
66
7- use JsonSerializable ;
7+ use SimpleSAML \ OpenID \ Claims \ ClaimInterface ;
88use SimpleSAML \OpenID \Codebooks \AtContextsEnum ;
9+ use SimpleSAML \OpenID \Codebooks \ClaimsEnum ;
910use SimpleSAML \OpenID \Exceptions \VcDataModelException ;
1011
11- class VcAtContextClaimValue implements JsonSerializable
12+ class VcAtContextClaimValue implements ClaimInterface
1213{
1314 /**
1415 * @param mixed[] $otherContexts
@@ -32,10 +33,7 @@ public function __construct(
3233 */
3334 public function jsonSerialize (): array
3435 {
35- return [
36- $ this ->baseContext ,
37- ...$ this ->otherContexts ,
38- ];
36+ return $ this ->getValue ();
3937 }
4038
4139 public function getBaseContext (): string
@@ -50,4 +48,20 @@ public function getOtherContexts(): array
5048 {
5149 return $ this ->otherContexts ;
5250 }
51+
52+ public function getName (): string
53+ {
54+ return ClaimsEnum::AtContext->name ;
55+ }
56+
57+ /**
58+ * @return mixed[]
59+ */
60+ public function getValue (): array
61+ {
62+ return [
63+ $ this ->baseContext ,
64+ ...$ this ->otherContexts ,
65+ ];
66+ }
5367}
Original file line number Diff line number Diff line change 55namespace SimpleSAML \OpenID \VerifiableCredentials \VcDataModel \Claims ;
66
77use DateTimeImmutable ;
8- use JsonSerializable ;
8+ use SimpleSAML \OpenID \Claims \ClaimInterface ;
9+ use SimpleSAML \OpenID \Codebooks \ClaimsEnum ;
910
10- class VcClaimValue implements JsonSerializable
11+ class VcClaimValue implements ClaimInterface
1112{
1213 /**
1314 * @param null|non-empty-string $id
@@ -33,8 +34,7 @@ public function __construct(
3334 */
3435 public function jsonSerialize (): array
3536 {
36- // TODO: Implement jsonSerialize() method.
37- return [];
37+ return $ this ->getValue ();
3838 }
3939
4040 public function getAtContext (): VcAtContextClaimValue
@@ -87,4 +87,18 @@ public function getCredentialStatus(): ?VcCredentialStatusClaimValue
8787 {
8888 return $ this ->credentialStatusClaimValue ;
8989 }
90+
91+ public function getName (): string
92+ {
93+ return ClaimsEnum::Vc->value ;
94+ }
95+
96+ /**
97+ * @return mixed[]
98+ */
99+ public function getValue (): array
100+ {
101+ // TODO: Implement getValue() method.
102+ return [];
103+ }
90104}
Original file line number Diff line number Diff line change 44
55namespace SimpleSAML \OpenID \VerifiableCredentials \VcDataModel \Claims ;
66
7- use JsonSerializable ;
7+ use SimpleSAML \OpenID \Claims \ClaimInterface ;
8+ use SimpleSAML \OpenID \Codebooks \ClaimsEnum ;
89
9- class VcCredentialSubjectClaimBag implements JsonSerializable
10+ class VcCredentialSubjectClaimBag implements ClaimInterface
1011{
1112 /** @var \SimpleSAML\OpenID\VerifiableCredentials\VcDataModel\Claims\VcCredentialSubjectClaimValue[] */
1213 protected array $ vcCredentialSubjectClaimValueValues ;
@@ -25,6 +26,19 @@ public function __construct(
2526 * @return mixed[]
2627 */
2728 public function jsonSerialize (): array
29+ {
30+ return $ this ->getValue ();
31+ }
32+
33+ public function getName (): string
34+ {
35+ return ClaimsEnum::Credential_Subject->value ;
36+ }
37+
38+ /**
39+ * @return mixed[]
40+ */
41+ public function getValue (): array
2842 {
2943 return array_map (
3044 fn (
Original file line number Diff line number Diff line change 44
55namespace SimpleSAML \OpenID \VerifiableCredentials \VcDataModel \Claims ;
66
7- use JsonSerializable ;
7+ use SimpleSAML \OpenID \Claims \ClaimInterface ;
8+ use SimpleSAML \OpenID \Codebooks \ClaimsEnum ;
89
9- class VcCredentialSubjectClaimValue implements JsonSerializable
10+ class VcCredentialSubjectClaimValue implements ClaimInterface
1011{
1112 /**
1213 * @param non-empty-array<mixed> $data
@@ -24,6 +25,19 @@ public function get(int|string $key): mixed
2425 * @return non-empty-array<mixed>
2526 */
2627 public function jsonSerialize (): array
28+ {
29+ return $ this ->getValue ();
30+ }
31+
32+ public function getName (): string
33+ {
34+ return ClaimsEnum::Credential_Subject->value ;
35+ }
36+
37+ /**
38+ * @return non-empty-array<mixed>
39+ */
40+ public function getValue (): array
2741 {
2842 return $ this ->data ;
2943 }
You can’t perform that action at this time.
0 commit comments