@@ -39,9 +39,12 @@ class Authenticator{
39
39
/**
40
40
* Authenticator constructor
41
41
*/
42
- public function __construct (SettingsContainerInterface |AuthenticatorOptions $ options = null , string $ secret = null ){
42
+ public function __construct (
43
+ SettingsContainerInterface |AuthenticatorOptions $ options = new AuthenticatorOptions ,
44
+ string |null $ secret = null
45
+ ){
43
46
// phpcs:ignore
44
- $ this ->setOptions ($ options ?? new AuthenticatorOptions );
47
+ $ this ->setOptions ($ options );
45
48
46
49
if ($ secret !== null ){
47
50
$ this ->setSecret ($ secret );
@@ -94,7 +97,7 @@ public function getSecret():string{
94
97
*
95
98
* @codeCoverageIgnore
96
99
*/
97
- public function createSecret (int $ length = null ):string {
100
+ public function createSecret (int | null $ length = null ):string {
98
101
return $ this ->authenticator ->createSecret ($ length );
99
102
}
100
103
@@ -107,7 +110,7 @@ public function createSecret(int $length = null):string{
107
110
*
108
111
* @codeCoverageIgnore
109
112
*/
110
- public function code (int $ data = null ):string {
113
+ public function code (int | null $ data = null ):string {
111
114
return $ this ->authenticator ->code ($ data );
112
115
}
113
116
@@ -120,7 +123,7 @@ public function code(int $data = null):string{
120
123
*
121
124
* @codeCoverageIgnore
122
125
*/
123
- public function verify (#[SensitiveParameter] string $ otp , int $ data = null ):bool {
126
+ public function verify (#[SensitiveParameter] string $ otp , int | null $ data = null ):bool {
124
127
return $ this ->authenticator ->verify ($ otp , $ data );
125
128
}
126
129
@@ -131,7 +134,7 @@ public function verify(#[SensitiveParameter] string $otp, int $data = null):bool
131
134
*
132
135
* @throws \InvalidArgumentException
133
136
*/
134
- public function getUri (string $ label , string $ issuer , int $ hotpCounter = null , bool $ omitSettings = null ):string {
137
+ public function getUri (string $ label , string $ issuer , int | null $ hotpCounter = null , bool | null $ omitSettings = null ):string {
135
138
$ label = trim ($ label );
136
139
$ issuer = trim ($ issuer );
137
140
0 commit comments