Skip to content

Commit 25ddc99

Browse files
committed
Update TrustAnchorConfigBag
1 parent 2633ee4 commit 25ddc99

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

src/ValueAbstracts/TrustAnchorConfigBag.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ public function getByEntityId(string $entityId): ?TrustAnchorConfig
3838
}
3939

4040

41+
public function getByEntityIdOrFail(string $entityId): TrustAnchorConfig
42+
{
43+
return $this->trustAnchorConfigs[$entityId] ??
44+
throw new \InvalidArgumentException(sprintf("No trust anchor config found for entity ID '%s'.", $entityId));
45+
}
46+
47+
4148
/**
4249
* @return array<non-empty-string,\SimpleSAML\OpenID\ValueAbstracts\TrustAnchorConfig>
4350
*/
@@ -47,6 +54,30 @@ public function getAll(): array
4754
}
4855

4956

57+
/**
58+
* @return array<non-empty-string>
59+
*/
60+
public function getAllEntityIds(): array
61+
{
62+
return array_keys($this->trustAnchorConfigs);
63+
}
64+
65+
66+
public function has(string $entityId): bool
67+
{
68+
return isset($this->trustAnchorConfigs[$entityId]);
69+
}
70+
71+
72+
/**
73+
* @return array<non-empty-string,\SimpleSAML\OpenID\ValueAbstracts\TrustAnchorConfig>
74+
*/
75+
public function getInCommonWith(TrustAnchorConfigBag $otherBag): array
76+
{
77+
return array_intersect_key($this->getAll(), $otherBag->getAll());
78+
}
79+
80+
5081
/**
5182
* @return \ArrayIterator<string,\SimpleSAML\OpenID\ValueAbstracts\TrustAnchorConfig>
5283
*/

0 commit comments

Comments
 (0)