|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
|
|
4
|
|
|
namespace Wearesho\Yii\Tests\Mocks; |
|
5
|
|
|
|
|
6
|
|
|
use Carbon\CarbonInterval; |
|
7
|
|
|
|
|
8
|
|
|
use Wearesho\Yii\Interfaces\TokenRepositoryConfigInterface; |
|
9
|
|
|
|
|
10
|
|
|
/** |
|
11
|
|
|
* Class TokenRepositorySettingsMock |
|
12
|
|
|
* @package Wearesho\Yii\Tests\Mocks |
|
13
|
|
|
* |
|
14
|
|
|
* @internal |
|
15
|
|
|
*/ |
|
16
|
|
|
class TokenRepositoryConfigMock implements TokenRepositoryConfigInterface |
|
17
|
|
|
{ |
|
18
|
|
|
/** @var CarbonInterval */ |
|
19
|
|
|
protected $expirePeriod; |
|
20
|
|
|
|
|
21
|
|
|
/** @var int */ |
|
22
|
|
|
protected $verifyLimit = 3; |
|
23
|
|
|
|
|
24
|
|
|
/** @var int */ |
|
25
|
|
|
protected $deliveryLimit = 3; |
|
26
|
|
|
|
|
27
|
|
|
/** |
|
28
|
|
|
* TokenRepositoryConfigMock constructor. |
|
29
|
|
|
*/ |
|
30
|
|
|
public function __construct() |
|
31
|
|
|
{ |
|
32
|
|
|
$this->expirePeriod = new CarbonInterval(0, 0, 0, 0, 1); |
|
33
|
|
|
} |
|
34
|
|
|
|
|
35
|
|
|
/** |
|
36
|
|
|
* @return CarbonInterval |
|
37
|
|
|
*/ |
|
38
|
|
|
public function getExpirePeriod(): CarbonInterval |
|
39
|
|
|
{ |
|
40
|
|
|
return $this->expirePeriod; |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* @return int |
|
45
|
|
|
*/ |
|
46
|
|
|
public function getVerifyLimit(): int |
|
47
|
|
|
{ |
|
48
|
|
|
return $this->verifyLimit; |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* @return int |
|
53
|
|
|
*/ |
|
54
|
|
|
public function getDeliveryLimit(): int |
|
55
|
|
|
{ |
|
56
|
|
|
return $this->deliveryLimit; |
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
|
|
/** |
|
60
|
|
|
* @param CarbonInterval $expirePeriod |
|
61
|
|
|
*/ |
|
62
|
|
|
public function setExpirePeriod(CarbonInterval $expirePeriod) |
|
63
|
|
|
{ |
|
64
|
|
|
$this->expirePeriod = $expirePeriod; |
|
65
|
|
|
} |
|
66
|
|
|
|
|
67
|
|
|
/** |
|
68
|
|
|
* @param int $deliveryLimit |
|
69
|
|
|
*/ |
|
70
|
|
|
public function setDeliveryLimit(int $deliveryLimit) |
|
71
|
|
|
{ |
|
72
|
|
|
$this->deliveryLimit = $deliveryLimit; |
|
73
|
|
|
} |
|
74
|
|
|
|
|
75
|
|
|
/** |
|
76
|
|
|
* @param int $verifyLimit |
|
77
|
|
|
*/ |
|
78
|
|
|
public function setVerifyLimit(int $verifyLimit) |
|
79
|
|
|
{ |
|
80
|
|
|
$this->verifyLimit = $verifyLimit; |
|
81
|
|
|
} |
|
82
|
|
|
} |