Debian Codegraph @

lib/3rdParty/composer/web-auth/webauthn-lib/src/PublicKeyCredentialSource.php

raw symbols SCIP
1 <?php
2
3 declare(strict_types=1);
4
5 namespace Webauthn;
6
7 /**
8 * @see https://www.w3.org/TR/webauthn/#iface-pkcredential
9 *
10 * @deprecated since 5.3, use CredentialRecord instead. Will be removed in 6.0.
11 */
12 class PublicKeyCredentialSource extends CredentialRecord
13 {
14 /**
15 * @internal Bridge for legacy CanSaveCredentialSource repositories.
16 * Wraps a CredentialRecord into a PublicKeyCredentialSource without copying additional state
17 * (PublicKeyCredentialSource has no own properties).
18 */
19 public static function fromCredentialRecord(CredentialRecord $credentialRecord): self
20 {
21 if ($credentialRecord instanceof self) {
22 return $credentialRecord;
23 }
24
25 return new self(
26 $credentialRecord->publicKeyCredentialId,
27 $credentialRecord->type,
28 $credentialRecord->transports,
29 $credentialRecord->attestationType,
30 $credentialRecord->trustPath,
31 $credentialRecord->aaguid,
32 $credentialRecord->credentialPublicKey,
33 $credentialRecord->userHandle,
34 $credentialRecord->counter,
35 $credentialRecord->otherUI,
36 $credentialRecord->backupEligible,
37 $credentialRecord->backupStatus,
38 $credentialRecord->uvInitialized,
39 );
40 }
41 }