@@ -39,9 +39,12 @@ class Authenticator{
3939 /**
4040 * Authenticator constructor
4141 */
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+ ){
4346 // phpcs:ignore
44- $ this ->setOptions ($ options ?? new AuthenticatorOptions );
47+ $ this ->setOptions ($ options );
4548
4649 if ($ secret !== null ){
4750 $ this ->setSecret ($ secret );
@@ -94,7 +97,7 @@ public function getSecret():string{
9497 *
9598 * @codeCoverageIgnore
9699 */
97- public function createSecret (int $ length = null ):string {
100+ public function createSecret (int | null $ length = null ):string {
98101 return $ this ->authenticator ->createSecret ($ length );
99102 }
100103
@@ -107,7 +110,7 @@ public function createSecret(int $length = null):string{
107110 *
108111 * @codeCoverageIgnore
109112 */
110- public function code (int $ data = null ):string {
113+ public function code (int | null $ data = null ):string {
111114 return $ this ->authenticator ->code ($ data );
112115 }
113116
@@ -120,7 +123,7 @@ public function code(int $data = null):string{
120123 *
121124 * @codeCoverageIgnore
122125 */
123- public function verify (#[SensitiveParameter] string $ otp , int $ data = null ):bool {
126+ public function verify (#[SensitiveParameter] string $ otp , int | null $ data = null ):bool {
124127 return $ this ->authenticator ->verify ($ otp , $ data );
125128 }
126129
@@ -131,7 +134,7 @@ public function verify(#[SensitiveParameter] string $otp, int $data = null):bool
131134 *
132135 * @throws \InvalidArgumentException
133136 */
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 {
135138 $ label = trim ($ label );
136139 $ issuer = trim ($ issuer );
137140
0 commit comments