| 1 |
<?php |
| 2 |
|
| 3 |
namespace AltchaOrg\Altcha; |
| 4 |
|
| 5 |
class ChallengeOptions |
| 6 |
{ |
| 7 |
public $algorithm; |
| 8 |
public $maxNumber; |
| 9 |
public $saltLength; |
| 10 |
public $hmacKey; |
| 11 |
public $salt; |
| 12 |
public $number; |
| 13 |
public $expires; |
| 14 |
public $params; |
| 15 |
|
| 16 |
public function __construct($options = []) |
| 17 |
{ |
| 18 |
$this->algorithm = $options['algorithm'] ?? Altcha::DEFAULT_ALGORITHM; |
| 19 |
$this->maxNumber = $options['maxNumber'] ?? Altcha::DEFAULT_MAX_NUMBER; |
| 20 |
$this->saltLength = $options['saltLength'] ?? Altcha::DEFAULT_SALT_LENGTH; |
| 21 |
$this->hmacKey = $options['hmacKey'] ?? ''; |
| 22 |
$this->salt = $options['salt'] ?? ''; |
| 23 |
$this->number = $options['number'] ?? 0; |
| 24 |
$this->expires = $options['expires'] ?? null; |
| 25 |
$this->params = $options['params'] ?? []; |
| 26 |
} |
| 27 |
} |
| 28 |
|