File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 8
8
9
9
class HashRNGProvider implements IRNGProvider
10
10
{
11
- public function __construct (private string $ algorithm = 'sha256 ' )
11
+ public function __construct (private readonly string $ algorithm = 'sha256 ' )
12
12
{
13
13
$ algos = array_values (hash_algos ());
14
14
if (!in_array ($ this ->algorithm , $ algos , true )) {
Original file line number Diff line number Diff line change 6
6
7
7
class OpenSSLRNGProvider implements IRNGProvider
8
8
{
9
- public function __construct (private bool $ requirestrong = true )
9
+ public function __construct (private readonly bool $ requirestrong = true )
10
10
{
11
11
}
12
12
Original file line number Diff line number Diff line change @@ -28,13 +28,13 @@ class TwoFactorAuth
28
28
private static array $ _base32lookup = array ();
29
29
30
30
public function __construct (
31
- private ?string $ issuer = null ,
32
- private int $ digits = 6 ,
33
- private int $ period = 30 ,
34
- private Algorithm $ algorithm = Algorithm::Sha1,
35
- private ?IQRCodeProvider $ qrcodeprovider = null ,
36
- private ?IRNGProvider $ rngprovider = null ,
37
- private ?ITimeProvider $ timeprovider = null
31
+ private readonly ?string $ issuer = null ,
32
+ private readonly int $ digits = 6 ,
33
+ private readonly int $ period = 30 ,
34
+ private readonly Algorithm $ algorithm = Algorithm::Sha1,
35
+ private ?IQRCodeProvider $ qrcodeprovider = null ,
36
+ private ?IRNGProvider $ rngprovider = null ,
37
+ private ?ITimeProvider $ timeprovider = null
38
38
) {
39
39
if ($ this ->digits <= 0 ) {
40
40
throw new TwoFactorAuthException ('Digits must be > 0 ' );
You can’t perform that action at this time.
0 commit comments