Debian Codegraph @

lib/3rdParty/composer/web-auth/webauthn-lib/src/MetadataService/Statement/CodeAccuracyDescriptor.php

raw symbols SCIP
1 <?php
2
3 declare(strict_types=1);
4
5 namespace Webauthn\MetadataService\Statement;
6
7 use Webauthn\Exception\MetadataStatementLoadingException;
8
9 class CodeAccuracyDescriptor extends AbstractDescriptor
10 {
11 public function __construct(
12 public readonly int $base,
13 public readonly int $minLength,
14 ?int $maxRetries = null,
15 ?int $blockSlowdown = null
16 ) {
17 $base >= 0 || throw MetadataStatementLoadingException::create(
18 'Invalid data. The value of "base" must be a positive integer'
19 );
20 $minLength >= 0 || throw MetadataStatementLoadingException::create(
21 'Invalid data. The value of "minLength" must be a positive integer'
22 );
23 parent::__construct($maxRetries, $blockSlowdown);
24 }
25
26 public static function create(int $base, int $minLength, ?int $maxRetries = null, ?int $blockSlowdown = null): self
27 {
28 return new self($base, $minLength, $maxRetries, $blockSlowdown);
29 }
30 }