| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Webauthn\Exception; |
| 6 | |
| 7 | use Throwable; |
| 8 | |
| 9 | final class CounterException extends WebauthnException |
| 10 | { |
| 11 | public function __construct( |
| 12 | public int $currentCounter, |
| 13 | public int $authenticatorCounter, |
| 14 | string $message, |
| 15 | ?Throwable $previous = null |
| 16 | ) { |
| 17 | parent::__construct($message, $previous); |
| 18 | } |
| 19 | |
| 20 | public static function create( |
| 21 | int $currentCounter, |
| 22 | int $authenticatorCounter, |
| 23 | string $message, |
| 24 | ?Throwable $previous = null |
| 25 | ): self { |
| 26 | return new self($currentCounter, $authenticatorCounter, $message, $previous); |
| 27 | } |
| 28 | } |