CoreFiles by mySites.guru
AuthenticationExtensionsClientOutputsLoader.php26 lines, 857 bytes, from Joomla_6.2.0-rc2-Release_Candidate-Full_Package.zip
Raw History Compare with 6.2.0-rc1
md5
a3c7c0b719b1412eac1972cef470b563
sha1
897fb484b74a1240a07fc9f6557020bde31ddb5f
sha256
c8f0c2c930e23f10c7147d55ad937b0524638934b33cdff87689b014196eb555
<?php

declare(strict_types=1);

namespace Webauthn\AuthenticationExtensions;

use CBOR\CBORObject;
use CBOR\MapObject;
use function is_string;
use Webauthn\Exception\AuthenticationExtensionException;

abstract class AuthenticationExtensionsClientOutputsLoader
{
    public static function load(CBORObject $object): AuthenticationExtensionsClientOutputs
    {
        $object instanceof MapObject || throw AuthenticationExtensionException::create('Invalid extension object');
        $data = $object->normalize();
        $extensions = AuthenticationExtensionsClientOutputs::create();
        foreach ($data as $key => $value) {
            is_string($key) || throw AuthenticationExtensionException::create('Invalid extension key');
            $extensions->add(AuthenticationExtension::create($key, $value));
        }

        return $extensions;
    }
}

The same content is in 155 releases, Joomla 5.0.0-alpha1 to 6.2.1-rc1. See them all, or every version of this file.