installed plugin WP-WebAuthn version 1.2.8
This commit is contained in:
80
wp-content/plugins/wp-webauthn/vendor/ramsey/uuid/src/Builder/BuilderCollection.php
vendored
Normal file
80
wp-content/plugins/wp-webauthn/vendor/ramsey/uuid/src/Builder/BuilderCollection.php
vendored
Normal file
@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the ramsey/uuid library
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
* @copyright Copyright (c) Ben Ramsey <ben@benramsey.com>
|
||||
* @license http://opensource.org/licenses/MIT MIT
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Ramsey\Uuid\Builder;
|
||||
|
||||
use Ramsey\Collection\AbstractCollection;
|
||||
use Ramsey\Uuid\Converter\Number\GenericNumberConverter;
|
||||
use Ramsey\Uuid\Converter\Time\GenericTimeConverter;
|
||||
use Ramsey\Uuid\Converter\Time\PhpTimeConverter;
|
||||
use Ramsey\Uuid\Guid\GuidBuilder;
|
||||
use Ramsey\Uuid\Math\BrickMathCalculator;
|
||||
use Ramsey\Uuid\Nonstandard\UuidBuilder as NonstandardUuidBuilder;
|
||||
use Ramsey\Uuid\Rfc4122\UuidBuilder as Rfc4122UuidBuilder;
|
||||
use Traversable;
|
||||
|
||||
/**
|
||||
* A collection of UuidBuilderInterface objects
|
||||
*
|
||||
* @extends AbstractCollection<UuidBuilderInterface>
|
||||
*/
|
||||
class BuilderCollection extends AbstractCollection
|
||||
{
|
||||
public function getType(): string
|
||||
{
|
||||
return UuidBuilderInterface::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* @psalm-mutation-free
|
||||
* @psalm-suppress ImpureMethodCall
|
||||
* @psalm-suppress InvalidTemplateParam
|
||||
*/
|
||||
public function getIterator(): Traversable
|
||||
{
|
||||
return parent::getIterator();
|
||||
}
|
||||
|
||||
/**
|
||||
* Re-constructs the object from its serialized form
|
||||
*
|
||||
* @param string $serialized The serialized PHP string to unserialize into
|
||||
* a UuidInterface instance
|
||||
*
|
||||
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint
|
||||
* @psalm-suppress RedundantConditionGivenDocblockType
|
||||
*/
|
||||
public function unserialize($serialized): void
|
||||
{
|
||||
/** @var array<array-key, UuidBuilderInterface> $data */
|
||||
$data = unserialize($serialized, [
|
||||
'allowed_classes' => [
|
||||
BrickMathCalculator::class,
|
||||
GenericNumberConverter::class,
|
||||
GenericTimeConverter::class,
|
||||
GuidBuilder::class,
|
||||
NonstandardUuidBuilder::class,
|
||||
PhpTimeConverter::class,
|
||||
Rfc4122UuidBuilder::class,
|
||||
],
|
||||
]);
|
||||
|
||||
$this->data = array_filter(
|
||||
$data,
|
||||
function ($unserialized): bool {
|
||||
return $unserialized instanceof UuidBuilderInterface;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
26
wp-content/plugins/wp-webauthn/vendor/ramsey/uuid/src/Builder/DefaultUuidBuilder.php
vendored
Normal file
26
wp-content/plugins/wp-webauthn/vendor/ramsey/uuid/src/Builder/DefaultUuidBuilder.php
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the ramsey/uuid library
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
* @copyright Copyright (c) Ben Ramsey <ben@benramsey.com>
|
||||
* @license http://opensource.org/licenses/MIT MIT
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Ramsey\Uuid\Builder;
|
||||
|
||||
use Ramsey\Uuid\Rfc4122\UuidBuilder as Rfc4122UuidBuilder;
|
||||
|
||||
/**
|
||||
* @deprecated Transition to {@see Rfc4122UuidBuilder}.
|
||||
*
|
||||
* @psalm-immutable
|
||||
*/
|
||||
class DefaultUuidBuilder extends Rfc4122UuidBuilder
|
||||
{
|
||||
}
|
||||
76
wp-content/plugins/wp-webauthn/vendor/ramsey/uuid/src/Builder/DegradedUuidBuilder.php
vendored
Normal file
76
wp-content/plugins/wp-webauthn/vendor/ramsey/uuid/src/Builder/DegradedUuidBuilder.php
vendored
Normal file
@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the ramsey/uuid library
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
* @copyright Copyright (c) Ben Ramsey <ben@benramsey.com>
|
||||
* @license http://opensource.org/licenses/MIT MIT
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Ramsey\Uuid\Builder;
|
||||
|
||||
use Ramsey\Uuid\Codec\CodecInterface;
|
||||
use Ramsey\Uuid\Converter\NumberConverterInterface;
|
||||
use Ramsey\Uuid\Converter\Time\DegradedTimeConverter;
|
||||
use Ramsey\Uuid\Converter\TimeConverterInterface;
|
||||
use Ramsey\Uuid\DegradedUuid;
|
||||
use Ramsey\Uuid\Rfc4122\Fields as Rfc4122Fields;
|
||||
use Ramsey\Uuid\UuidInterface;
|
||||
|
||||
/**
|
||||
* @deprecated DegradedUuid instances are no longer necessary to support 32-bit
|
||||
* systems. Transition to {@see DefaultUuidBuilder}.
|
||||
*
|
||||
* @psalm-immutable
|
||||
*/
|
||||
class DegradedUuidBuilder implements UuidBuilderInterface
|
||||
{
|
||||
/**
|
||||
* @var NumberConverterInterface
|
||||
*/
|
||||
private $numberConverter;
|
||||
|
||||
/**
|
||||
* @var TimeConverterInterface
|
||||
*/
|
||||
private $timeConverter;
|
||||
|
||||
/**
|
||||
* @param NumberConverterInterface $numberConverter The number converter to
|
||||
* use when constructing the DegradedUuid
|
||||
* @param TimeConverterInterface|null $timeConverter The time converter to use
|
||||
* for converting timestamps extracted from a UUID to Unix timestamps
|
||||
*/
|
||||
public function __construct(
|
||||
NumberConverterInterface $numberConverter,
|
||||
?TimeConverterInterface $timeConverter = null
|
||||
) {
|
||||
$this->numberConverter = $numberConverter;
|
||||
$this->timeConverter = $timeConverter ?: new DegradedTimeConverter();
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds and returns a DegradedUuid
|
||||
*
|
||||
* @param CodecInterface $codec The codec to use for building this DegradedUuid instance
|
||||
* @param string $bytes The byte string from which to construct a UUID
|
||||
*
|
||||
* @return DegradedUuid The DegradedUuidBuild returns an instance of Ramsey\Uuid\DegradedUuid
|
||||
*
|
||||
* @psalm-pure
|
||||
*/
|
||||
public function build(CodecInterface $codec, string $bytes): UuidInterface
|
||||
{
|
||||
return new DegradedUuid(
|
||||
new Rfc4122Fields($bytes),
|
||||
$this->numberConverter,
|
||||
$codec,
|
||||
$this->timeConverter
|
||||
);
|
||||
}
|
||||
}
|
||||
74
wp-content/plugins/wp-webauthn/vendor/ramsey/uuid/src/Builder/FallbackBuilder.php
vendored
Normal file
74
wp-content/plugins/wp-webauthn/vendor/ramsey/uuid/src/Builder/FallbackBuilder.php
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the ramsey/uuid library
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
* @copyright Copyright (c) Ben Ramsey <ben@benramsey.com>
|
||||
* @license http://opensource.org/licenses/MIT MIT
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Ramsey\Uuid\Builder;
|
||||
|
||||
use Ramsey\Uuid\Codec\CodecInterface;
|
||||
use Ramsey\Uuid\Exception\BuilderNotFoundException;
|
||||
use Ramsey\Uuid\Exception\UnableToBuildUuidException;
|
||||
use Ramsey\Uuid\UuidInterface;
|
||||
|
||||
/**
|
||||
* FallbackBuilder builds a UUID by stepping through a list of UUID builders
|
||||
* until a UUID can be constructed without exceptions
|
||||
*
|
||||
* @psalm-immutable
|
||||
*/
|
||||
class FallbackBuilder implements UuidBuilderInterface
|
||||
{
|
||||
/**
|
||||
* @var BuilderCollection
|
||||
*/
|
||||
private $builders;
|
||||
|
||||
/**
|
||||
* @param BuilderCollection $builders An array of UUID builders
|
||||
*/
|
||||
public function __construct(BuilderCollection $builders)
|
||||
{
|
||||
$this->builders = $builders;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds and returns a UuidInterface instance using the first builder that
|
||||
* succeeds
|
||||
*
|
||||
* @param CodecInterface $codec The codec to use for building this instance
|
||||
* @param string $bytes The byte string from which to construct a UUID
|
||||
*
|
||||
* @return UuidInterface an instance of a UUID object
|
||||
*
|
||||
* @psalm-pure
|
||||
*/
|
||||
public function build(CodecInterface $codec, string $bytes): UuidInterface
|
||||
{
|
||||
$lastBuilderException = null;
|
||||
|
||||
foreach ($this->builders as $builder) {
|
||||
try {
|
||||
return $builder->build($codec, $bytes);
|
||||
} catch (UnableToBuildUuidException $exception) {
|
||||
$lastBuilderException = $exception;
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
throw new BuilderNotFoundException(
|
||||
'Could not find a suitable builder for the provided codec and fields',
|
||||
0,
|
||||
$lastBuilderException
|
||||
);
|
||||
}
|
||||
}
|
||||
39
wp-content/plugins/wp-webauthn/vendor/ramsey/uuid/src/Builder/UuidBuilderInterface.php
vendored
Normal file
39
wp-content/plugins/wp-webauthn/vendor/ramsey/uuid/src/Builder/UuidBuilderInterface.php
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the ramsey/uuid library
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
* @copyright Copyright (c) Ben Ramsey <ben@benramsey.com>
|
||||
* @license http://opensource.org/licenses/MIT MIT
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Ramsey\Uuid\Builder;
|
||||
|
||||
use Ramsey\Uuid\Codec\CodecInterface;
|
||||
use Ramsey\Uuid\UuidInterface;
|
||||
|
||||
/**
|
||||
* A UUID builder builds instances of UuidInterface
|
||||
*
|
||||
* @psalm-immutable
|
||||
*/
|
||||
interface UuidBuilderInterface
|
||||
{
|
||||
/**
|
||||
* Builds and returns a UuidInterface
|
||||
*
|
||||
* @param CodecInterface $codec The codec to use for building this UuidInterface instance
|
||||
* @param string $bytes The byte string from which to construct a UUID
|
||||
*
|
||||
* @return UuidInterface Implementations may choose to return more specific
|
||||
* instances of UUIDs that implement UuidInterface
|
||||
*
|
||||
* @psalm-pure
|
||||
*/
|
||||
public function build(CodecInterface $codec, string $bytes): UuidInterface;
|
||||
}
|
||||
Reference in New Issue
Block a user