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